View source: R/coef.heckmanGE.R View source: R/coef.heckmanGE.R
coef.heckmanGE | R Documentation |
This function extracts the coefficients from a heckmanGE
class object. You can specify which parts of the model you want to retrieve the coefficients for: selection, outcome, dispersion, or correlation. By default, the function returns the complete coefficient vector for all parts.
## S3 method for class 'heckmanGE'
coef(
object,
part = c("selection", "outcome", "dispersion", "correlation"),
...
)
object |
An object of class |
part |
A character vector indicating which parts of the model coefficients to return. Valid options are: |
... |
Additional arguments passed to or from other methods. Currently, these are not used in this method but must be included to match the generic method signature. |
The coef.heckmanGE
function retrieves coefficients from the heckmanGE
model object based on the specified parts. The parts represent different components of the Heckman model:
"selection"
: Coefficients related to the selection equation.
"outcome"
: Coefficients related to the outcome equation.
"dispersion"
: Coefficients related to the dispersion equation.
"correlation"
: Coefficients related to the correlation between selection and outcome.
By default, the function returns coefficients from all parts. You can specify one or more parts in the part
argument to extract coefficients from specific components.
A numeric vector containing the coefficients extracted from the model object. The coefficients correspond to the specified model parts, returned in the order they are requested.
data(MEPS2001)
selectEq <- dambexp ~ age + female + educ + blhisp + totchr + ins + income
outcomeEq <- lnambx ~ age + female + educ + blhisp + totchr + ins
dispersion <- ~ age + female + totchr + ins
correlation <- ~ age
fit <- heckmanGE(selection = selectEq,
outcome = outcomeEq,
dispersion = dispersion,
correlation = correlation,
data = MEPS2001)
# Extracting all coefficients:
coef(fit)
# Extracting only the selection and outcome coefficients:
coef(fit, part = c("selection", "outcome"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.