HeckmanCL: Classic Heckman Model Fit Function

View source: R/HeckmanCL.R

HeckmanCLR Documentation

Classic Heckman Model Fit Function

Description

Fits the classical Heckman sample selection model using Maximum Likelihood Estimation (MLE). Initial parameter estimates are obtained via the two-step method.

Usage

HeckmanCL(selection, outcome, data = sys.frame(sys.parent()), start = NULL)

Arguments

selection

A formula specifying the selection equation.

outcome

A formula specifying the primary outcome equation.

data

A data frame containing the variables in the model.

start

An optional numeric vector of initial parameter values. If not provided, default values are used.

Details

This function estimates the parameters of the classical Heckman sample selection model via MLE, accounting for potential sample selection bias. It uses the optim function with the BFGS method to find the parameter estimates that maximize the log-likelihood function. The initial values for optimization are obtained using the two-step Heckman method.

The function returns a rich set of results, including:

  • Estimated coefficients for the selection and outcome equations.

  • Standard deviation of the outcome error term (sigma).

  • Correlation between the errors of the selection and outcome equations (rho).

  • Measures of model fit (AIC, BIC).

  • Standard errors (approximated by the square root of the Fisher information diagonal).

Value

A list containing:

  • coefficients: A named numeric vector of estimated parameters.

  • value: The value of the (negative) log-likelihood at convergence.

  • loglik: The maximized log-likelihood.

  • counts: Number of gradient evaluations performed.

  • hessian: Hessian matrix at the optimum.

  • fisher_infoHC: The (approximate) Fisher information matrix.

  • prop_sigmaHC: Approximate standard errors.

  • level: Levels of the selection variable.

  • nObs: Number of observations.

  • nParam: Number of estimated parameters.

  • N0: Number of unobserved (censored) observations.

  • N1: Number of observed (uncensored) observations.

  • NXS: Number of parameters in the selection equation.

  • NXO: Number of parameters in the outcome equation.

  • df: Degrees of freedom (observations minus parameters).

  • aic: Akaike Information Criterion.

  • bic: Bayesian Information Criterion.

  • initial.value: Initial parameter values used in the optimization.

References

\insertRef

heckman1979samplessmodels

Examples

data(MEPS2001)
attach(MEPS2001)
selectEq <- dambexp ~ age + female + educ + blhisp + totchr + ins + income
outcomeEq <- lnambx ~ age + female + educ + blhisp + totchr + ins
HeckmanCL(selectEq, outcomeEq, data = MEPS2001)


ssmodels documentation built on June 8, 2025, 10:49 a.m.