extract,opsr-method {OPSR}R Documentation

Extract Method for OPSR Model Fits

Description

This is the main method called when using functions from the texreg-package.

Usage

## S4 method for signature 'opsr'
extract(
  model,
  beside = FALSE,
  include.structural = TRUE,
  include.selection = TRUE,
  include.outcome = TRUE,
  include.pseudoR2 = FALSE,
  include.R2 = FALSE,
  ...
)

Arguments

model

an object of class "opsr".

beside

if TRUE, prints structural, selection and outcome coefficients side-by-side.

include.structural

whether or not structural coefficients should be printed.

include.selection

whether or not selection coefficients should be printed.

include.outcome

whether or not outcome coefficients should be printed.

include.pseudoR2

whether or not the pseudo R2 statistic for the selection component should be printed. See also the 'Details' section.

include.R2

whether or not the R2 statistic for the outcome component should be printed.

...

additional arguments passed to summary.opsr.

Details

The extract method is called internally. Higher-level functions from the texreg-package pass arguments via ... to extract.

include.pseudoR2 reports both the "equally likely" (EL) and "market share" (MS) pseudo R2.

Value

A texreg-class object representing the statistical model.

See Also

texreg-package, texreg::texreg, texreg::screenreg and related functions.

Examples

sim_dat <- opsr_simulate()
dat <- sim_dat$data
model <- ys | yo ~ xs1 + xs2 | xo1 + xo2
fit <- opsr(model, dat)
fit_null <- opsr_null_model(fit)
fit_intercept <- update(fit, ~ . | 1)

texreg::screenreg(fit)
texreg::screenreg(fit, beside = TRUE)
texreg::screenreg(fit, beside = TRUE, include.pseudoR2 = TRUE, include.R2 = TRUE)
texreg::screenreg(list(fit_null, fit_intercept, fit))

[Package OPSR version 0.1.2 Index]