step2: Heckman's Two-Step Method

View source: R/step2.R

step2R Documentation

Heckman's Two-Step Method

Description

Estimates the parameters of the classical Heckman selection model using the two-step method. The first step fits a probit model for the selection equation. In the second step, the inverse Mills ratio (IMR) is included as an additional regressor in the outcome equation.

Usage

step2(YS, XS, YO, XO)

Arguments

YS

A binary vector indicating selection (1 if observed, 0 otherwise).

XS

A matrix of covariates for the selection equation.

YO

A numeric vector representing the outcome variable of interest.

XO

A matrix of covariates for the outcome equation.

Details

This function implements the two-step estimation procedure of the classical Heckman model. In the first step, a probit model is estimated to predict the selection indicator YS using the selection covariates XS. The IMR is calculated from this model. In the second step, an ordinary least squares (OLS) regression of the observed outcome YO on XO and the IMR is performed for the uncensored observations (YS == 1).

The function also calculates:

  • sigma: The estimated standard deviation of the outcome equation's error term.

  • rho: The estimated correlation between the error terms of the selection and outcome equations.

Value

A numeric vector containing the parameter estimates from the two-step Heckman model:

  • Coefficients of the selection equation (probit model).

  • Coefficients of the outcome equation (excluding the IMR term).

  • Estimated sigma.

  • Estimated rho.

References

\insertAllCited

Examples

data(MEPS2001)
attach(MEPS2001)
YS <- dambexp
XS <- cbind(age, female, educ, blhisp, totchr, ins)
YO <- lnambx
XO <- cbind(age, female, educ, blhisp, totchr, ins, income)
step2(YS, XS, YO, XO)


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