Tutorials › Econometrics (Graduate) › Common Mistakes In Residual-Inclusion Analysis

Endogeneity and Control Functions · Tutorial 250 of 952

Common Mistakes In Residual-Inclusion Analysis

Learn to diagnose four common errors in residual-inclusion analysis and interpret its specification and inference with appropriate caution.

Advanced 11 min read

What You'll Learn

  • Distinguish first-stage fitted values from residuals in nonlinear outcome models
  • Identify why exogenous controls generally belong in both the first stage and outcome equation
  • Interpret a residual-inclusion test as a conditional endogeneity test, not an instrument-validity test
  • Explain why estimated residuals create generated-regressor uncertainty
  • Choose inference that accounts for estimation in both stages
  • Recognize when ordinary first-stage residuals are inappropriate for a discrete endogenous regressor

Why Residual-Inclusion Errors Matter

Residual inclusion is a control-function strategy: a first-stage model produces a residual that is included in an outcome equation to represent the part of an endogenous regressor associated with unobserved determinants of the outcome. The strategy can be useful in nonlinear models, where substituting fitted values for the endogenous regressor does not generally reproduce a valid instrumental-variables estimator. But the procedure depends on the model and its assumptions. A residual term does not automatically make an outcome equation causal, and its presence does not repair every first-stage or inference error.

The most consequential mistakes are related but distinct: using fitted values where a control-function residual is called for; omitting relevant exogenous controls from the outcome equation; treating a residual test as evidence that instruments are valid; and calculating uncertainty as if the estimated residuals were observed data. The examples below use hypothetical data and fitted models to show what each mistake changes.

Definition: Let \(x_i\) be an endogenous regressor, \(z_i\) a vector of excluded instruments, and \(w_i\) a vector of exogenous controls. A first-stage model gives a fitted conditional mean \(\widehat{x}_i=\widehat{m}(z_i,w_i)\); its residual is \(\hat{v}_i=x_i-\widehat{x}_i\). In residual inclusion, the outcome model includes the observed \(x_i\), the required controls \(w_i\), and a function of \(\hat{v}_i\). The fitted value \(\widehat{x}_i\) and residual \(\hat{v}_i\) are different quantities and play different roles.

Fitted Values Are Not Control-Function Residuals

In a simple continuous-regressor first stage, write \(x_i=m(z_i,w_i;\gamma)+v_i\), where \(v_i\) is the first-stage disturbance and \(\gamma\) indexes the first-stage model. Residual inclusion uses an estimate of \(v_i\), not an estimate of the conditional mean \(m(z_i,w_i;\gamma)\), as the additional control. A representative nonlinear outcome specification is

$$ g\{E(y_i\mid x_i,w_i,v_i)\} =\beta_0+\beta_1 x_i+w_i'\delta+\lambda(v_i), $$

where \(g\) is an appropriate link function and \(\lambda\) is the specified control-function term. In an estimated model, \(\hat{v}_i\) stands in for the unobserved \(v_i\). The validity of this representation requires substantive assumptions: the instrument must be relevant, excluded from the structural outcome equation conditional on \(w_i\), and appropriately exogenous; the first-stage specification must capture the relevant dependence; and conditioning on the control function must adequately account for the relationship between \(x_i\) and unobserved outcome determinants. Residual inclusion is not a substitute for those conditions.

Why not insert \(\widehat{x}_i\) instead? The observed \(x_i\) contains both its instrument-predicted component and its first-stage disturbance. The residual is informative about the latter. Replacing \(x_i\) by \(\widehat{x}_i\), or including \(\widehat{x}_i\) as if it were \(\hat{v}_i\), discards or confuses that information. In a nonlinear model, it also changes the conditional quantity being modeled. In general, a nonlinear function of an expectation is not the expectation of that nonlinear function: \(h\{E(X)\}\neq E\{h(X)\}\). Thus, substituting a fitted value into a nonlinear outcome model is not generally an equivalent way to control for endogeneity. This differs from the role of first-stage fitted values in linear two-stage least squares.

Worked Example: Keeping the Fitted Value and Residual Separate

Suppose a hypothetical first stage predicts a patient’s treatment exposure, in hours, from an excluded instrument and observed controls. For one patient, the fitted exposure is \(\widehat{x}_i=4.2\) hours, while observed exposure is \(x_i=5.0\) hours. The estimated residual is

$$ \hat{v}_i=x_i-\widehat{x}_i=5.0-4.2=0.8\text{ hours}. $$

Suppose a hypothetical probit outcome model has fitted index

$$ \hat{\eta}_i=-1.00+0.35x_i+0.20w_i+0.60\hat{v}_i, $$

where \(w_i=1\) is a centered control measured in its stated scale. Using the observed exposure and the residual gives

$$ \hat{\eta}_i=-1.00+0.35(5.0)+0.20(1)+0.60(0.8)=1.43, \qquad \widehat{P}(y_i=1\mid x_i,w_i,\hat{v}_i)=\Phi(1.43)\approx0.9236. $$

This is the model’s fitted conditional probability under the stated residual-inclusion specification. If someone substitutes the fitted exposure \(4.2\) for the residual and drops the observed \(x_i\), the resulting index is \(-1.00+0.35(4.2)+0.20(1)=0.67\), giving \(\Phi(0.67)\approx0.7486\). That is a different calculation from the specified model, not a valid alternative estimate of the same probability. The numerical contrast illustrates the mistake; it does not establish that either model is causally valid.

The specific first-stage residual also depends on the type of endogenous regressor and the model used for its first stage. For a continuous regressor under an appropriate conditional-mean specification, the ordinary residual \(x_i-\widehat{x}_i\) is a natural candidate. For a discrete endogenous regressor, an ordinary residual from a linear probability first stage may not be the appropriate control. The residual or control function must match the first-stage model and the assumptions behind the outcome specification.

Do Not Drop Required Controls

Let \(w_i\) contain exogenous variables that belong in the structural outcome equation. In the usual control-function setup, those controls also enter the first stage, along with the excluded instruments. The outcome equation must retain them: the residual is not a general-purpose replacement for omitted covariates. If a control directly predicts the outcome, or is needed to make the instrument’s exogeneity condition conditional on observed variables, omitting it can change the target relationship and undermine the intended interpretation.

It is useful to check the two equations separately. The first stage uses \(z_i\) and the relevant exogenous controls \(w_i\) to model \(x_i\). The outcome equation uses \(x_i\), the structural controls \(w_i\), and the control-function term. Having a variable in the first stage does not automatically mean it has been controlled for in the outcome equation.

Worked Example: A Control Present in Only One Equation

Suppose a hypothetical binary-outcome model uses exposure \(x_i\), an excluded instrument \(z_i\), education \(w_i\), and an estimated first-stage residual. The first stage is

$$ \widehat{x}_i=2.0+0.60z_i+0.50w_i. $$

For a person with \(z_i=1\), \(w_i=2\), and observed \(x_i=5\), the fitted value is \(2.0+0.60(1)+0.50(2)=3.60\), so \(\hat{v}_i=5-3.60=1.40\). Suppose the structural probit index is

$$ \eta_i=-0.80+0.30x_i+0.50w_i+0.40\hat{v}_i. $$

Including education gives \(\eta_i=-0.80+0.30(5)+0.50(2)+0.40(1.40)=2.26\), and the fitted probability is \(\Phi(2.26)\approx0.9881\). If education is mistakenly omitted while the other displayed coefficients are held fixed to isolate its contribution, the index becomes \(2.26-0.50(2)=1.26\), giving \(\Phi(1.26)\approx0.8962\). A real omitted-variable fit would also re-estimate the other coefficients, so this calculation is not its predicted result. It shows directly that the residual does not stand in for education’s modeled contribution to the outcome.

The practical check is to compare the structural equation with the intended outcome specification: every required exogenous control should be present there, not merely used to calculate first-stage residuals. Whether a variable belongs in the structural equation depends on the model and causal question; the rule is not to add every available variable mechanically.

A Residual Test Is Not an Instrument-Validity Test

A test of a residual-inclusion coefficient asks whether the estimated control-function term contributes to the outcome equation, conditional on the chosen model and included variables. In a simple specification with \(\lambda(v_i)=\rho v_i\), the null \(H_0:\rho=0\) is commonly interpreted as no evidence of endogeneity captured by that control function, under the model’s assumptions. Rejection is evidence against that null. It does not prove that the instruments satisfy exclusion or exogeneity.

Instrument validity and residual-test results concern different claims. Relevance concerns whether the instrument predicts the endogenous regressor conditional on controls. Exclusion and exogeneity concern whether it has a direct relationship with the outcome disturbance after conditioning on the specified controls. A residual coefficient test does not establish these conditions. If an instrument is invalid, a significant residual coefficient does not repair it; a nonsignificant coefficient does not certify it. The test can also have limited power, and its interpretation depends on the first-stage and outcome specifications being adequate.

Worked Example: Interpreting a Residual-Coefficient Test

Suppose a hypothetical probit control-function outcome model estimates the coefficient on \(\hat{v}_i\) as \(0.42\), with standard error \(0.18\). For a large-sample two-sided Wald test of \(H_0:\rho=0\), the statistic is

$$ z=\frac{0.42-0}{0.18}=2.33. $$

Under the standard normal reference distribution, the two-sided p-value is approximately \(0.0198\). At significance level \(\alpha=0.05\), this is evidence against a zero residual coefficient under the specified model. In context, the test provides evidence of endogeneity captured by this control-function term, conditional on the maintained assumptions.

It does not show that the excluded instrument is valid. Separate substantive justification and suitable assessment of the instrument assumptions are still required. Nor does the p-value give the probability that \(H_0\) is true; it is the probability, under \(H_0\) and the test’s reference assumptions, of observing a statistic at least as extreme as the one obtained.

Estimated Residuals Create Inference Uncertainty

The residuals \(\hat{v}_i\) are generated regressors: they are calculated using estimated first-stage parameters rather than observed directly. An outcome-stage standard error that treats them as fixed can fail to account for the uncertainty introduced by estimating the first stage. The size and direction of the difference are not known in advance; generated-regressor uncertainty does not mean that the corrected standard error must always be larger.

Inference should follow a method justified for the specified model. Options include an appropriate joint-estimation or stacked estimating-equation variance calculation that accounts for both stages, or a bootstrap that resamples the data and re-estimates the first stage and outcome model in every replicate. Bootstrapping only the outcome stage while holding the original residuals fixed leaves out the first-stage estimation uncertainty. If observations are dependent within sampling units, the resampling and variance method must also respect that dependence structure.

Worked Example: Comparing Naive and Generated-Regressor Standard Errors

Suppose a hypothetical nonlinear residual-inclusion model estimates a treatment coefficient of \(0.24\). Treating \(\hat{v}_i\) as fixed gives a standard error of \(0.08\); a method that accounts for both stages gives a standard error of \(0.11\). Under a large-sample two-sided normal Wald approximation, the naive calculation is

$$ z_{\text{naive}}=\frac{0.24}{0.08}=3.00, \qquad p_{\text{naive}}\approx0.0027. $$

Using the two-stage uncertainty estimate instead gives

$$ z_{\text{accounted}}=\frac{0.24}{0.11}=2.18, \qquad p_{\text{accounted}}\approx0.029. $$

Both calculations use the same coefficient, but they imply different precision. At \(\alpha=0.05\), the second calculation still gives evidence against a zero coefficient under its assumptions, while the naive calculation makes the evidence look stronger than the uncertainty-accounting method does. The appropriate conclusion depends on the validity of the chosen variance method, not on selecting whichever standard error is more favorable.

A Practical Diagnostic Sequence

Before interpreting a residual-inclusion estimate, check the stages and the inference as a connected procedure. These checks do not prove the identifying assumptions, but they help expose common specification and reporting errors.

1
Write down the two equations.
Identify the endogenous regressor, excluded instruments, exogenous controls, and outcome link. Confirm that the outcome equation has the observed endogenous regressor and the intended control function.
2
Check how the control function was constructed.
For a continuous regressor, verify that the residual is observed minus fitted, using the stated first-stage model. For a discrete regressor, verify that the control function is suitable for its first-stage model rather than assuming an ordinary residual is appropriate.
3
Audit the controls and identifying assumptions.
Check that required exogenous controls appear in the structural outcome equation and that instrument relevance, exclusion, and exogeneity are defended separately.
4
Match the inference to the estimation.
Use a variance or resampling procedure that accounts for first-stage estimation, and state exactly what any residual-inclusion test assesses.

Common Mistakes

  • Calling a fitted value a residual. The fitted value is the predicted component of \(x_i\); the residual is \(x_i-\widehat{x}_i\). Keep their definitions and roles distinct.
  • Using fitted values as a nonlinear shortcut. A nonlinear outcome model with fitted exposure is not generally equivalent to the specified residual-inclusion model or to a valid instrument-based estimator.
  • Leaving a structural control out of the outcome equation. Including a variable only in the first stage does not control for its outcome relationship.
  • Calling a significant residual test proof of valid instruments. The test concerns the modeled control-function contribution; it does not establish exclusion or exogeneity.
  • Reporting second-stage uncertainty as if residuals were observed. Generated residuals depend on estimated first-stage parameters, so inference must account for that estimation.
Key takeaway: Residual inclusion is a model-based strategy, not an automatic correction. Use the correct control function, retain the required outcome controls, interpret residual tests narrowly, and account for uncertainty from estimating the first stage.

Check Your Understanding

Try these questions before reviewing the explanations above.

  1. A first stage gives \(\widehat{x}_i=6.1\), while the observed \(x_i=5.4\). What is the estimated residual, and why is it not interchangeable with the fitted value?
  2. Why is replacing observed \(x_i\) by \(\widehat{x}_i\) generally not equivalent to residual inclusion in a nonlinear outcome model?
  3. A control enters the first stage but is omitted from the outcome equation. What potential problem does this create?
  4. A test rejects the null that the residual-inclusion coefficient is zero. What claim does this support under the model, and what does it not establish about the instrument?
  5. Why might a bootstrap that holds first-stage residuals fixed fail to account for all relevant estimation uncertainty?
Clinical Biostats