Why Include a First-Stage Residual?
A count outcome might record the number of hospital visits, insurance claims, or purchases. A Poisson or negative-binomial model can describe such outcomes through a conditional mean, often using an exponential function to keep fitted means positive. But if a regressor is endogenous, an ordinary count regression can still give a misleading estimate: the regressor may be related to unobserved determinants of the count.
A control-function approach addresses this problem by using the first-stage residual as an additional outcome-regression variable. The residual summarizes the part of the endogenous regressor not explained by the instruments and included exogenous covariates. Under a suitable conditional-dependence assumption, including it makes the remaining variation in the regressor conditionally unrelated to the outcome disturbance. The approach is not justified merely by the fact that a residual can be calculated; its validity depends on the first-stage and outcome-model assumptions stated below.
The instruments must predict \(x_i\) conditional on \(w_i\), and the excluded instruments must not have a direct effect on the outcome conditional on the structural regressors and the control function. In addition, the control function must adequately summarize the dependence between \(x_i\) and the outcome disturbance. These are substantive identification and specification requirements, not properties guaranteed by a two-stage calculation.
From a Conditional Error Decomposition to a Count Mean
A useful way to see the logic is to suppose that the structural conditional mean before accounting for endogeneity has a multiplicative unobserved component:
Here \(u_i\) captures unobserved determinants of the outcome. If \(x_i\) is endogenous, \(u_i\) and the first-stage disturbance \(v_i\) are conditionally dependent. A linear control-function specification assumes a decomposition \(u_i=\lambda v_i+\varepsilon_i\), with the conditional expectation \(E[\exp(\varepsilon_i)\mid v_i,w_i,z_i]\) constant. The constant can be absorbed into the intercept. Taking the conditional expectation over \(\varepsilon_i\) then gives:
where \(\beta_0\) includes the constant factor. This calculation motivates including \(v_i\) in the exponential index. A suitable joint normal model for latent errors can imply a linear conditional correction of this form, but linearity is an assumption about the conditional dependence, not a universal consequence of endogeneity. More generally, the correction may be a nonlinear function \(h(v_i)\); then a linear residual term may be misspecified.
Poisson Residual Inclusion
For a conditional Poisson model, the distributional assumption is \(Y_i\mid x_i,w_i,v_i\sim\operatorname{Poisson}(\mu_i)\), with \(\mu_i\) given by the control-function mean above. A Poisson random variable has conditional mean \(\mu_i\) and conditional variance \(\mu_i\). The likelihood contribution for an observed count \(y_i\) is \(e^{-\mu_i}\mu_i^{y_i}/y_i!\). The Poisson distribution is a full conditional-distribution assumption; if the target is only the conditional mean, Poisson quasi-maximum likelihood can instead be used with a correctly specified mean and an appropriate robust variance estimator.
Worked Example: Constructing and Using a Poisson Control Function
Suppose a hypothetical study models the number of annual service visits \(Y_i\). The first-stage estimate for visits’ endogenous predictor \(x_i\) is \(\hat x_i=0.8+0.5z_i+0.3w_i\). For one individual, \(z_i=2\), \(w_i=1\), and the observed \(x_i=2.6\). The fitted first-stage value and residual are:
Suppose the estimated Poisson conditional mean is \(\hat\mu_i=\exp(-0.4+0.25x_i+0.2w_i+0.6\hat v_i)\). Substituting the observed values gives:
Under the fitted model, this individual’s conditional expected number of annual visits is about 2.117. The model’s conditional Poisson variance for this individual is also 2.117. Holding \(x_i\) and \(w_i\) fixed, a one-unit increase in the residual changes the fitted mean by the factor \(\exp(0.6)\approx1.822\). That is a model-based conditional association, not a causal effect of changing a residual.
The calculation requires more than a good numerical fit. It relies on the instrument exclusion and relevance conditions, a valid first-stage residual, and the assumption that the linear residual term adequately controls the relevant dependence. If the conditional Poisson distribution is assumed, that distributional specification is also required; for a mean-only Poisson fit, the conditional mean must still be correctly specified.
Negative-Binomial Residual Inclusion
A negative-binomial model keeps the same control-function conditional mean but allows more conditional variance than the Poisson model. Use the NB2 parameterization, in which \(Y_i\mid x_i,w_i,v_i\) has a negative-binomial distribution with mean \(\mu_i\) and dispersion parameter \(\alpha>0\):
The conditional mean can be specified as \(\exp(\beta_0+x_i\beta+w_i'\gamma+\lambda v_i)\), with \(\hat v_i\) used in estimation. The additional dispersion parameter allows the conditional variance to exceed the conditional mean. It does not, by itself, correct endogeneity: the control-function assumptions are still needed. A standard distributional interpretation of NB2 is a Poisson count conditional on a gamma-distributed rate, with the gamma variation independent of the covariates and control function given the specified conditional mean.
Worked Example: Negative-Binomial Mean and Variance
Consider a hypothetical model for the number of monthly claims, with estimated conditional mean \(\hat\mu_i=\exp(-0.2+0.3x_i-0.1w_i+0.5\hat v_i)\) and estimated NB2 dispersion \(\hat\alpha=0.4\). For an individual with \(x_i=1.5\), \(w_i=2\), and \(\hat v_i=-0.4\), the index is:
Thus the fitted mean is \(\hat\mu_i=\exp(-0.15)\approx0.8607\) claims per month. The NB2 conditional variance is:
The fitted variance, about 1.157 squared claims, exceeds the fitted mean of 0.8607 claims because the estimated dispersion is positive. Holding \(w_i\) and \(\hat v_i\) fixed, a one-unit increase in \(x_i\) multiplies the fitted mean by \(\exp(0.3)\approx1.350\), or increases it by about 35.0%. This is a conditional mean comparison under the model, not evidence that the coefficient is causal without the identifying assumptions.
Estimation, Interpretation, and a Residual Check
A basic two-step implementation estimates the first-stage regression of \(x_i\) on \(z_i\) and \(w_i\), saves \(\hat v_i\), and then estimates the Poisson or negative-binomial outcome model using \(x_i\), \(w_i\), and \(\hat v_i\). The structural coefficient \(\beta\) describes the conditional log-mean slope for \(x_i\), holding the included covariates and control function fixed. In particular, a one-unit increase in \(x_i\) multiplies the model’s conditional mean by \(\exp(\beta)\), under the specified model. The residual coefficient \(\lambda\) is not the effect of an intervention on the residual; it is a parameter in the correction for conditional dependence.
Testing \(H_0:\lambda=0\) can provide a diagnostic for endogeneity within this particular specification. A nonzero estimate is evidence of residual dependence conditional on the included variables, if the model and inference are valid. A failure to reject does not establish exogeneity: the test may have limited power, and misspecified instruments, first stages, or control functions can undermine its interpretation. Standard errors must account for the fact that \(\hat v_i\) was estimated in the first stage. Treating it as a directly observed covariate and using an ordinary second-stage variance formula can understate or otherwise misstate uncertainty; use inference appropriate for estimated control functions.
Worked Example: Testing the Residual Term
Suppose a hypothetical Poisson residual-inclusion fit gives \(\hat\lambda=0.45\) with a standard error that accounts for first-stage estimation of \(0.18\). To test \(H_0:\lambda=0\) against \(H_a:\lambda\ne0\), the large-sample Wald statistic is:
Using a standard normal reference distribution, the two-sided p-value is \(2[1-\Phi(2.50)]\approx0.0124\). At significance level \(\alpha=0.05\), reject \(H_0\) for this fitted specification. An approximate 95% Wald interval is:
The interval is in units of the model’s log conditional mean per unit of first-stage residual. It excludes zero, consistent with the test. The result indicates evidence that the residual term contributes to the specified conditional mean; it does not prove that the instruments are valid, that the linear control function is correct, or that endogeneity has been completely removed.
Why Fitted-Value Substitution Is Not the Same Procedure
A common error is to replace \(x_i\) by its first-stage fitted value \(\hat x_i\) in the nonlinear outcome model and treat the resulting regression as a solution to endogeneity. In nonlinear models, this generally changes the conditional mean being modeled and does not reproduce the control-function correction. Residual inclusion instead retains the observed \(x_i\) and adds \(\hat v_i\), relying on the specified conditional-dependence relationship. This distinction matters because the exponential mean is nonlinear: substituting a fitted regressor is not generally equivalent to conditioning on the residual.
The residual-inclusion approach is also not automatic protection against misspecification. The first stage must capture the conditional mean of \(x_i\) sufficiently well; instruments must be relevant and excluded from the structural outcome equation; and the assumed residual correction must be adequate. If the relationship between the residual and the conditional mean is nonlinear, a linear term \(\lambda\hat v_i\) may not suffice. A negative-binomial dispersion term can accommodate overdispersion, but it cannot repair a failed exclusion restriction or an inadequate control function.
Check Your Understanding
Work through these questions using the definitions and assumptions in this tutorial.
- Write a linear first-stage equation for an endogenous continuous regressor \(x_i\), and define its estimated residual.
- In a Poisson residual-inclusion model, what does \(\exp(\beta)\) represent for a one-unit increase in \(x_i\), holding the other index terms fixed?
- Under the NB2 parameterization, calculate the conditional variance when \(\mu_i=2\) and \(\alpha=0.25\).
- Why does a significant estimate of \(\lambda\) not establish that the excluded instruments are valid?
- Explain why a negative-binomial dispersion parameter does not, by itself, address endogeneity.