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.
Arguments
- object
An object of class
heckmanGE
, which contains the fitted model.- part
A character vector indicating which parts of the model coefficients to return. Valid options are:
"selection"
,"outcome"
,"dispersion"
, and"correlation"
. Multiple parts can be specified. By default, all parts are included in the returned coefficients.- ...
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.
Value
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.
Details
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.
Examples
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)
#> Error in eval(mfS): object 'selectEq' not found
# Extracting all coefficients:
coef(fit)
#> Error: object 'fit' not found
# Extracting only the selection and outcome coefficients:
coef(fit, part = c("selection", "outcome"))
#> Error: object 'fit' not found