Tutorials › Econometrics (Graduate) › Murphy-Topel Inference for the Generated Selection Correction

Sample Selection Models · Tutorial 551 of 952

Murphy-Topel Inference for the Generated Selection Correction

Learn how first-stage estimation changes the sampling variance of the Heckman two-step estimator and how to compute inference that accounts for it.

Advanced 12 min read

What You'll Learn

  • Define the stacked estimating equations for the probit and selected-outcome stages.
  • Differentiate the generated inverse Mills ratio with respect to the probit index.
  • Derive the two-step estimator’s influence function and asymptotic variance.
  • Construct a plug-in Murphy–Topel variance estimate for a coefficient or contrast.
  • Explain why ordinary and heteroskedasticity-robust second-stage OLS standard errors omit first-stage uncertainty.
  • Compare naive and corrected standard errors and confidence intervals.

Why Second-Stage OLS Uncertainty Is Not the Whole Story

In Heckman two-step estimation, the second-stage regression includes an estimated inverse Mills ratio. It is therefore not an ordinary regression with a fixed design matrix: the correction term changes when the first-stage probit estimate changes. Treating the fitted correction as known omits a source of sampling variation and can make standard errors too small or otherwise inaccurate.

The Murphy–Topel approach accounts for this dependence by treating the two stages as one stacked estimation problem. It combines the second-stage estimating equation with the first-stage probit score, then derives the variance of the resulting joint influence function. The method is useful both for a model-based covariance calculation and for a sandwich estimate that allows more general variation in the estimating contributions.

Model, Notation, and Conditions

For each observation \(i\), let \(D_i\) indicate whether the outcome is observed, let \(z_i\) be the selection covariates, and let \(x_i\) be the outcome covariates. The selection equation is \(D_i=1[z_i'\gamma+u_i>0]\). The outcome equation is \(y_i=x_i'\beta+\epsilon_i\), observed only when \(D_i=1\). Under the Gaussian sample-selection model, \(u_i\) has a standard normal distribution, the outcome error has standard deviation \(\sigma\), and their correlation is \(\rho\). The conditional mean of the outcome error among selected observations is \(\rho\sigma\lambda(z_i'\gamma)\), where \(\lambda(t)=\phi(t)/\Phi(t)\), \(\phi\) is the standard normal density, and \(\Phi\) is its cumulative distribution function.

Write \(\delta=\rho\sigma\), \(\eta_i=z_i'\gamma\), and \(w_i(\gamma)=(x_i',\lambda(\eta_i))'\). The second-stage parameter is \(\theta=(\beta',\delta)'\). Thus, among selected observations, the conditional-mean regression is \(y_i=w_i(\gamma)'\theta+r_i\), with \(E[r_i\mid x_i,z_i,D_i=1]=0\) under the stated model. The two-step procedure estimates \(\gamma\) by probit on the full sample, computes \(\widehat\lambda_i=\lambda(z_i'\hat\gamma)\), and regresses selected outcomes on \(x_i\) and \(\widehat\lambda_i\).

Conditions for the derivation: Assume independent, identically distributed observations; a correctly specified probit selection probability \(P(D_i=1\mid z_i)=\Phi(z_i'\gamma)\); the stated conditional outcome mean; finite moments sufficient for the central limit theorem; and nonsingular first- and second-stage population information matrices. These conditions make the two stages’ population estimating equations equal to zero and permit a first-order expansion around the true parameters. Inference is asymptotic; the formulas do not guarantee accurate finite-sample coverage.

Use full-sample normalization for both estimating equations. This makes the selected-outcome equation an average over all \(n\) observations, with unselected observations contributing zero. Its root is exactly the selected-sample OLS estimate, because multiplying that equation by \(n\) gives the usual selected-sample normal equations.

Stacking the Two Estimating Equations

Let \(P_i=\Phi(\eta_i)\). The probit score contribution for observation \(i\) is

$$ s_i(\gamma)= z_i\frac{\phi(\eta_i)\{D_i-P_i\}}{P_i(1-P_i)}. $$

The second-stage contribution is \(g_i(\theta,\gamma)=D_iw_i(\gamma)\{y_i-w_i(\gamma)'\theta\}\). The two estimates solve the sample averages of \(s_i(\gamma)\) and \(g_i(\theta,\gamma)\) equal to zero. Define the population matrices

$$ I=E\!\left[\frac{\phi(\eta_i)^2}{P_i(1-P_i)}z_i z_i'\right], \qquad Q=E[D_iw_iw_i']. $$

Under a correctly specified probit, \(I\) is both the expected negative derivative of the score and the score variance. \(Q\) is the second-stage design matrix in full-sample normalization. Both are required to be nonsingular for the corresponding parameters to be locally identified by these equations.

The key extra derivative is the effect of changing \(\gamma\) on the second-stage equation. Since \(\lambda\) is a generated regressor, its derivative must be included. Differentiating the ratio \(\phi(t)/\Phi(t)\) gives

$$ \lambda'(t) =\frac{-t\phi(t)\Phi(t)-\phi(t)^2}{\Phi(t)^2} =-\lambda(t)\{t+\lambda(t)\}. $$

Let \(e\) be a vector of zeros with a one in its last position, corresponding to the inverse Mills ratio in \(w_i\). For \(r_i=y_i-w_i'\theta\), the derivative matrix of the second-stage equation with respect to \(\gamma\) is

$$ C =E\!\left[ D_i\left\{ e\,r_i\lambda'(\eta_i)z_i' -w_i\delta\lambda'(\eta_i)z_i' \right\} \right]. $$

The first term differentiates the \(w_i\) multiplying the residual; the second differentiates the residual itself, because its fitted value includes \(\delta\lambda(\eta_i)\). Omitting either term does not give the derivative of the estimating equation. Under the correctly specified conditional-mean model, \(E[r_i\mid x_i,z_i,D_i=1]=0\), so the expectation of the first term is zero. Keeping it in the general derivative makes clear where that simplification comes from.

Influence Function and Murphy–Topel Variance

A first-order expansion of the probit equation gives \(\sqrt n(\hat\gamma-\gamma)=I^{-1}n^{-1/2}\sum_i s_i+o_p(1)\). Expanding the outcome equation jointly in \(\theta\) and \(\gamma\) gives a second contribution: changing \(\gamma\) changes the fitted inverse Mills ratios and hence the second-stage equation. Since the derivative with respect to \(\theta\) is \(-Q\), the resulting expansion is

$$ \sqrt n(\hat\theta-\theta) = Q^{-1}\frac{1}{\sqrt n}\sum_{i=1}^n \left\{g_i+C I^{-1}s_i\right\} +o_p(1). $$

This is the Murphy–Topel adjustment in influence-function form. The term \(g_i\) is the contribution one would use if the generated correction were fixed. The term \(C I^{-1}s_i\) is the contribution transmitted from first-stage estimation. Because the same observations inform both stages, the two terms need not be independent; their covariance belongs in the variance calculation.

Theorem: Under the stated regularity conditions, the asymptotic covariance matrix of \(\hat\theta\) is
$$ \operatorname{Avar}(\hat\theta) = \frac{1}{n}Q^{-1}\Omega Q^{-1}, \qquad \Omega=\operatorname{Var}\!\left(g_i+C I^{-1}s_i\right). $$

The matrices \(Q\) and \(I\) are symmetric here, so their inverses are also symmetric. Expanding the middle variance shows the contributions explicitly:

$$ \Omega = \operatorname{Var}(g_i) +C I^{-1}\operatorname{Var}(s_i)I^{-1}C' +\operatorname{Cov}(g_i,s_i)I^{-1}C' +C I^{-1}\operatorname{Cov}(s_i,g_i). $$

For the correctly specified probit, \(\operatorname{Var}(s_i)=I\). If, in addition, the conditional outcome-mean assumption makes \(\operatorname{Cov}(g_i,s_i)=0\), the expression simplifies to \(\Omega=\operatorname{Var}(g_i)+C I^{-1}C'\). The general formula is safer to present and implement: it retains the empirical cross-covariance and does not require setting it to zero by assumption.

Practical Calculation and Worked Examples

Worked Example: Differentiating the Generated Correction

Suppose a selected observation has estimated probit index \(z_i'\hat\gamma=0.5\), and the fitted inverse Mills ratio is reported as \(\widehat\lambda(0.5)=0.5092\). Find the derivative used to describe how the correction changes with the index.

Use \(\lambda'(t)=-\lambda(t)\{t+\lambda(t)\}\). Substituting the displayed rounded value gives

$$ \widehat\lambda'(0.5) \approx -0.5092(0.5+0.5092) =-0.5092(1.0092) =-0.51388464 \approx -0.5139. $$

Thus, near this index, a small increase in the index decreases the fitted correction. For example, an index increase of 0.01 corresponds to an approximate change of \(-0.5139(0.01)=-0.005139\), using the local derivative. This is a first-order approximation, not an exact change over a finite interval.

Worked Example: A Scalar Murphy–Topel Variance Adjustment

Consider one coefficient contrast \(a'\theta\), with influence contribution \(h_i=a'Q^{-1}g_i\) from the second stage and first-stage adjustment \(kI^{-1}s_i\), where \(k=a'Q^{-1}C\). For a hypothetical calculation, suppose there is one first-stage parameter, \(I=4\), \(k=0.30\), \(\operatorname{Var}(h_i)=0.0400\), \(\operatorname{Var}(s_i)=4\), and \(\operatorname{Cov}(h_i,s_i)=0\). Calculate the variance of the influence contribution.

The adjusted contribution is \(h_i+0.30(1/4)s_i=h_i+0.075s_i\). Its variance, using the zero covariance specified in this example, is

$$ \operatorname{Var}(h_i+0.075s_i) =0.0400+(0.075)^2(4) =0.0400+0.0225 =0.0625. $$

The asymptotic variance of the estimated contrast is therefore \(0.0625/n\), and its asymptotic standard error is \(0.25/\sqrt n\) in the contrast’s units. If the first-stage term were omitted, the variance contribution would be only \(0.0400/n\), giving \(0.20/\sqrt n\). The omitted component is not a penalty applied automatically in every dataset: the general formula also includes cross-covariances, which can increase or decrease the total.

In practice, estimate the matrices and covariance from fitted contributions. Evaluate \(\hat s_i\), \(\hat g_i\), and the sample analogues \(\hat I\), \(\hat Q\), and \(\hat C\) at \((\hat\gamma,\hat\theta)\). Form the adjusted contribution \(\hat v_i=\hat g_i+\hat C\hat I^{-1}\hat s_i\). The sample covariance of these contributions, combined with \(\hat Q^{-1}\) on both sides and the \(1/n\) scaling, gives a sandwich estimate. Centering the contributions by their sample mean is a standard finite-sample implementation; at an exact solution their relevant averages are zero up to numerical precision. This calculation captures heteroskedasticity in the contributions as well as the generated-regressor adjustment.

Worked Example: Comparing Standard Errors and Intervals

Suppose a hypothetical two-step analysis estimates the selected-sample outcome coefficient on education to be \(1.20\) dollars per hour for each additional year of education. The naive second-stage standard error is \(0.20\), while the Murphy–Topel standard error is \(0.25\). Compare their approximate 95% confidence intervals using the normal critical value \(1.96\).

The naive interval is \(1.20\pm1.96(0.20)\). Its margin of error is \(0.392\) dollars per hour per year, giving \([0.808,1.592]\). The corrected interval is \(1.20\pm1.96(0.25)\); its margin of error is \(0.490\), giving \([0.710,1.690]\), after rounding to three decimal places.

The corrected interval is wider in this example because the estimated first stage adds variance. Its frequentist interpretation is that, under the model and repeated sampling, intervals constructed by this procedure would cover the coefficient about 95% of the time asymptotically. It is not a statement that this particular interval has a 95% probability of containing the fixed coefficient.

Why Naive Standard Errors Can Mislead

Conventional second-stage OLS standard errors condition on the values of \(\widehat\lambda_i\) as if they were fixed. A heteroskedasticity-robust OLS sandwich improves the estimate of the second-stage contribution’s variance, but it still treats the generated correction as fixed. Neither calculation, by itself, includes \(C I^{-1}s_i\) or its covariance with \(g_i\). A second-stage robust covariance matrix is therefore not automatically a Murphy–Topel covariance matrix.

Under the conditional-mean model, \(g_i\) can be uncorrelated with the probit score because the corrected outcome residual has conditional mean zero given the covariates and selection. Even in that case, first-stage uncertainty generally remains: the term \(C I^{-1}C'\) is present when the score variance equals \(I\). If the first-stage score and outcome contribution are not uncorrelated, the cross terms must also be retained.

The distinction matters most when the generated correction is sensitive to the first-stage parameters, when first-stage uncertainty is substantial, or when the second-stage sample is limited. The correction is also relevant for standard errors of linear contrasts: for a contrast \(a'\theta\), use \(a'\widehat{\operatorname{Var}}(\hat\theta)a\), not a variance that ignores the generated regressor.

Common Mistakes

  • Treating the fitted inverse Mills ratio as observed data. This ignores its dependence on \(\hat\gamma\). Include the derivative of the second-stage equation with respect to \(\gamma\).
  • Assuming robust OLS standard errors solve the generated-regressor problem. They address heteroskedasticity in the second-stage contribution, but not uncertainty transmitted from the probit. Use the stacked sandwich or an equivalent Murphy–Topel calculation.
  • Dropping cross-covariances without justification. The two equations use the same observations. Keep the covariance terms in the general estimator unless the model and conditions justify their removal.
  • Using the selected-sample size inconsistently. With full-sample normalization, \(Q\) and the influence contributions are population averages over all observations, with \(D_i=0\) contributions set to zero. Selected-sample normalization is also possible, but its scaling must be carried through consistently.
  • Calling the correction a causal adjustment. It corrects the conditional mean under the selection-model assumptions; it does not, by itself, establish a causal interpretation for an outcome coefficient.
Key takeaway: In two-step selection estimation, the second-stage coefficient inherits first-stage sampling variation through the generated inverse Mills ratio. The Murphy–Topel variance accounts for this by using the influence contribution \(g_i+C I^{-1}s_i\), including its variance and any cross-covariance terms.

Check Your Understanding

Use the definitions and derivation above to answer these questions.

  1. Why does the selected-outcome estimating equation include \(D_i\) when it is normalized over the full sample?
  2. Differentiate \(\lambda(t)=\phi(t)/\Phi(t)\) and explain why its derivative enters the Murphy–Topel adjustment.
  3. In the influence function, what does \(C I^{-1}s_i\) represent?
  4. Why can a heteroskedasticity-robust second-stage OLS standard error still omit relevant uncertainty?
  5. Under what condition can the cross-covariance between the first- and second-stage contributions be set to zero?
Clinical Biostats