*! version 1.0.0 6feb2022

Title

gtsheckman -- A generalized two-step Heckman selection model

Syntax

gtsheckman
depvar
[indepvars]
[if] [in]
,
select (depvar_s =
varlist_s)
[options]

As in heckman, depvar is the dependent variable, subject to sample selection,
indepvars is the list of independent regressors,
depvar_s is the binary selection indicator, and
varlist_s is the list of independent regressors in the selection equation.

Model
*select() specifies the selection equation: dependent and independent variables

het(varlist) independent variables to model the variance in the selection equation

clp(varlist) independent variables to be interacted with the inverse mills ratio

SE/Robust
vce(vcetype) vcetype may be robust or cluster clustervar

Reporting
lambda generates the (scaled) inverse mills ratio (lambda) as a variable

Maximize
maximize_options controls the maximization process; seldom used

*select() is required.

Description

gtsheckman fits regression models with selection by using Heckman's two-step consistent estimator.
It is similar to the two step consistent heckman estimator, but allows for heteroskedasticity in the first step and a more general specification of the control function.
Moreover it provides both heteroskedastic robust inference as well as cluster robust inference.
Therefore this command encompasses the two step consistent heckman estimator as a special case.
The methodology was proposed and studied by Carlson and Joshi (2022).

Options

Model

select(depvar_s = varlist_s) specifies the variables for the selection equation. It is an integral part of specifying a Heckman model and is required. the selection equation should contain at least one variables that is not in the outcome equation.
depvar_s should be coded as 0 or 1, with 0 indicating an observation not selected and 1 indicating a selected observation.

het(varlist) specifies the independent variables in the variance function for the heteroskedastic probit estimator in the first stage.

clp(varlist) specifies the independent variables to be interacted with lambda (inverse mills ratio) in the control function in the second stage.

SE/Robust

vce(vcetype) specifies the stype of standard errors reported, which includes types that are robust to some kinds of misspecification (robust), and that allow for intragroup correlation (cluster clustervar).

Reporting

lambda generates the (scaled) inverse mills ratio as a new variable named lambda. The inverse mills ratio is calculated from the first stage selection equation estimates, and will be scaled by the inverse of the conditional variance estimates when the option het() is specified. Some post estimation commands (like margins and predict) will require the lambda option be specified.

Maximization

maximize_options controls the maximization process; see help maximize. Use of them is likely to be rare.

Examples

Setup

. use http://fmwww.bc.edu/ec-p/data/wooldridge/mroz, clear

Obtain Heckman's two-step consistent estimates

. gtsheckman lwage educ exper expersq, select(inlf = educ exper expersq age nwifeinc kidslt6 kidsge6)

Obtain Heckman's two-step consistent estimates with heteroskedastic robust standard errors

. gtsheckman lwage educ exper expersq, select(inlf = educ exper expersq age nwifeinc kidslt6 kidsge6) vce(robust)

Obtain Heckman's two-step consistent estimates with heteroskedasticity in the sample selection equation and robust standard errors

. gtsheckman lwage educ exper expersq, select(inlf = educ exper expersq age nwifeinc kidslt6 kidsge6) het(educ kidslt6 kidsge6) vce(robust)

Obtain Heckman's two-step consistent estimates with heteroskedasticity in the sample selection equation and covariance, and robust standard errors

. gtsheckman lwage educ exper expersq, select(inlf = educ exper expersq age nwifeinc kidslt6 kidsge6) het(educ kidslt6 kidsge6) clp(educ kidslt6 kidsge6) vce(robust)

Additional examples can be found in the gtsheckman_examples.do do-file.

Stored results

gtsheckman stores the following in e():

Scalars

e(N) number of observations

e(N_selected) number of selected observations

e(N_nonselected) number of nonselected observations

Macros

e(cmd) gtsheckman

e(vce) vcetype specified in vce()

e(vcetype) title used to label Std. Err.

e(properties) b V

Matrices

e(b) coefficient vector

e(V) variance-covariance matrix of the estimators

Functions

e(sample) estimation sample

Author

Alyssa H. Carlson
Department of Economics, University of Missouri

carlsonah@missouri.edu
https://carlsonah.mufaculty.umsystem.edu/

References

Carlson, A. H., and Joshi, R. 2024.
Sample Selection in Linear Panel Data Models with Heterogenous Coefficents.
Journal of Applied Econometrics
39(2):237-255.
URL: https://doi.org/10.1002/jae.3022