In many social and health studies, outcomes are seen only for some people: wages for workers, costs for care seekers, ratings for respondents. If unobservables that govern sample entry correlate with unobservables in the outcome equation, regression on the visible subsample is biased—sample selection bias, not ordinary missing-at-random noise.[1][2] Heckman’s selection model (Tobit-2) writes selection as its own equation and adds an inverse Mills ratio to the outcome equation so the conditional mean of the error among the selected can be controlled.[1][2] Below: structure and steps, then a Mroz87 contrast of three estimators, then assumptions and limits. Censored Tobit models and historical selection-bias cases live in other column pieces; here the focus is the Heckman correction itself. Reading selection bias as “an omitted variable correlated with the error among the selected” clarifies what the inverse Mills ratio does and keeps it from being mistaken for casual missing-data imputation.[1]
Selection, outcome, and the inverse Mills ratio
There are two equations: selection decides whether the outcome is observed; the outcome equation holds the conditional mean of interest. Errors are bivariate normal with correlation ρ; the target is the population outcome coefficients, not a descriptive fit among those already selected.[1] Among the selected, the outcome error’s conditional mean is generally nonzero and proportional to the inverse Mills ratio λ=φ(·)/Φ(·); adding λ as a regressor plugs that omitted conditional mean back in.[1][3] If ρ=0, subsample OLS suffices; if ρ≠0, ignoring λ folds selection bias into the slopes. Empirically λ moves sharply when selection probabilities near 0 or 1 and more smoothly in the middle—so selection-equation fit feeds into outcome stability.[1]
Two-step, maximum likelihood, and exclusion
The two-step (heckit) estimator fits a probit for selection, computes λ, then runs the outcome regression with λ included; ordinary second-step OLS standard errors are biased—use the package’s corrected variance (summary or vcov), not a plain lm table.[1][3] Joint maximum likelihood is the other common path. Exclusion requires at least one variable in selection but not in the outcome; otherwise identification leans on λ’s nonlinearity and is often fragile.[1] Two-step ρ can leave [−1,1], making Mills-related SEs unreliable; different optimizers can also change SEs—report the method.[1][3] A common identification failure is stuffing every wage regressor into selection with no factor that shifts employment without shifting wages—then λ is nearly a nonlinear transform of education and experience, and coefficients chatter.
Mroz87: labor-force selection and log wages
Mroz87 has 753 married women; 428 have 1975 hours and wages, and 325 have unobserved outcomes.[4] This article follows the Wooldridge example 17.5 specification in the sampleSelection docs (not the Greene 22.8 / JSS 5.1 alternative): outcome log(wage)~educ+exper+exper²; selection adds nwifeinc, age, kids5, and kids618 as exclusion variables that enter selection but not the wage equation.[4][3] We estimate OLS on workers only, then heckit two-step and selection ML, on R 4.3.3 with sampleSelection 1.2-12. In the selection equation, kids5 is significantly negative and education and experience significantly positive—descriptively consistent with harder employment with young children and higher participation with schooling/experience—but those selection slopes serve this demo only, not policy claims.[4]
Worker-only OLS: education ≈0.107 (SE≈0.014), experience ≈0.042 (SE≈0.013), experience squared ≈−0.00081 (SE≈0.00039). Two-step outcome: education ≈0.109, experience ≈0.044, experience squared ≈−0.00086; inverse Mills ≈0.032 (SE≈0.134), not distinguishable from zero; σ≈0.664, ρ≈0.049. ML: education ≈0.108, experience ≈0.043, experience squared ≈−0.00084; σ≈0.663, ρ≈0.027 (SE≈0.147), again no reliable departure from zero.[3][4] Under this specification and sample, the three methods’ education and experience slopes are very close; the Mills term (and ρ) do not support a strong claim that selection correction is required—read points with intervals, and do not equate “ran Heckman” with “found selection bias.” Wald intervals in the figure overlap for education and experience across methods; what widens is the two-step λ interval covering zero, matching the table.

Figure: Mroz87 coefficients for education and experience (Wald 95% intervals) under worker-only OLS, Heckman two-step, and ML; two-step also shows the inverse Mills ratio. Wooldridge 17.5 specification; redrawn from sampleSelection estimates.
Reading exclusion and model limits
Whether exclusion variables are credible is institutional: do children, non-wife income, and age affect wages only through work participation? That is part of the identification story, not a software guarantee.[1][4] The model also leans on bivariate normality; without exclusion it leans on functional form, and thin overlap in selection probabilities can make λ nearly collinear. Coefficients from a 1975 PSID married-women sample are not contemporary labor-market findings—this run only demonstrates estimation and reading.[4] If Mills is significant but the exclusion story fails, safer writing admits fragile identification rather than translating a significant λ into a substantive “markets are selected” claim; an insignificant λ also does not prove “no selection”—low power or weak exclusion can hide correlation.[1] Selection bias and instrumental variables both need external variation; Heckman models selection directly—see the IV article for parallels. Censored Tobit in the broader Tobit family is a separate piece.
Heckman selection writes “who is seen” as a selection equation and uses the inverse Mills ratio to correct a nonzero conditional error mean in the outcome equation; two-step and ML are the usual routes, and exclusion plus bivariate normality must be stated before reading slopes.[1] In the Mroz87 demo, OLS and both Heckman fits give similar education and experience slopes, with insignificant Mills and ρ—selection correction does not rewrite the story every time.[3][4] Plotting three coefficient sets side by side makes “how much correction changed” visible; it is not a license to pick the most dramatic set for storytelling. The short checklist after the demo: write both equations, state exclusion, report corrected SEs, and show uncertainty in ρ (or λ).
References
-
Toomet, O., & Henningsen, A. (2008). Sample selection models in R: Package sampleSelection. Journal of Statistical Software, 27(7), 1–23. https://doi.org/10.18637/jss.v027.i07
-
Heckman, J. J. (1979). Sample selection bias as a specification error. Econometrica, 47(1), 153–161. https://doi.org/10.2307/1912352
-
sampleSelection::selection reference. https://search.r-project.org/CRAN/refmans/sampleSelection/html/selection.html
-
sampleSelection::Mroz87 reference. https://search.r-project.org/CRAN/refmans/sampleSelection/html/Mroz87.html