Tutorials › Propensity Score Matching and Instrumental Variables › Residual Inclusion For Count Outcomes

Binary and Nonlinear Outcome IV Methods · Tutorial 560 of 699

Residual Inclusion For Count Outcomes

Learn to include a first-stage residual in a count model, interpret the resulting treatment effects, and assess the assumptions and diagnostics that make this control-function approach credible.

Advanced 10 min read

What You'll Learn

  • Define the control-function assumptions for residual inclusion in a count-outcome model.
  • Construct and interpret a first-stage residual for a binary exposure.
  • Fit and interpret Poisson and negative-binomial residual-inclusion models.
  • Convert log-mean coefficients into incidence-rate ratios and mean contrasts.
  • Recognize instrument, specification, and inference problems that can undermine the analysis.

Why Count Outcomes Need a Control Function

A count outcome records how many times an event occurs during a defined period or opportunity: for example, the number of hospital visits in a year. If an exposure is endogenous, its association with the count outcome can reflect unmeasured causes of both exposure and outcome. Instrumental-variable methods address this problem only under substantive assumptions about the instrument and the model linking exposure to outcome.

For a nonlinear outcome model, replacing the observed exposure with a first-stage fitted value is generally not equivalent to including a control function. Residual inclusion instead adds information about the part of exposure not explained by the instrument and measured covariates. The resulting method is often called two-stage residual inclusion (2SRI). The control-function logic is that, under a suitable model, this residual captures the relevant dependence between exposure and the unobserved determinants of the outcome.

Definition: Let \(Y\) be a nonnegative count, \(D\) a binary potentially endogenous exposure, \(Z\) an instrument, and \(X\) a vector of observed covariates. A residual-inclusion count model estimates a first-stage model for \(D\) given \(Z\) and \(X\), forms a residual \(R\) from that model, and includes \(D\), \(X\), and \(R\) in a Poisson or negative-binomial outcome model.

The residual is a control function only when the assumed first-stage and outcome structures make it sufficient to control the relevant endogeneity. Merely adding a residual does not make an invalid instrument valid, nor does it guarantee that unmeasured confounding has been removed.

Assumptions and Model Specification

For a transparent version with a binary exposure, suppose the first stage is a linear probability model:

$$ D_i=\pi_0+\pi_Z Z_i+\pi_X^\top X_i+V_i,\qquad \widehat R_i=D_i-\widehat D_i. $$

Here \(\widehat D_i\) is the fitted value from regressing \(D\) on \(Z\) and \(X\), and \(\widehat R_i\) is the estimated first-stage residual. The linear probability model is used here to define this residual-inclusion procedure; it can produce fitted values outside zero and one, so its adequacy should be considered rather than assumed.

For a Poisson outcome model, the conditional mean is specified as

$$ E(Y_i\mid D_i,X_i,\widehat R_i) =\mu_i =\exp\!\left(\beta_0+\beta_DD_i+\beta_X^\top X_i+\rho\widehat R_i\right). $$

The Poisson model also specifies a Poisson conditional distribution, whose variance equals its mean. A negative-binomial model retains this log conditional mean but permits overdispersion. Under the common NB2 parameterization, its conditional variance is \(\mu_i+\alpha\mu_i^2\), where \(\alpha>0\). Neither choice alone addresses endogeneity; the residual term and the assumptions behind it do that work.

A causal interpretation requires, at minimum, a relevant instrument (the instrument predicts exposure conditional on \(X\)), instrument independence from unmeasured causes of the outcome given \(X\), and an exclusion restriction (the instrument has no effect on the outcome except through exposure). The conditional mean form must also be appropriate, and the residual must adequately represent the dependence induced by endogeneity. For the simple linear first stage above, this entails a suitable linear conditional-mean specification for \(D\) and a control-function relationship in which the outcome mean depends on the first-stage disturbance through the included residual. These are substantive modeling assumptions, not consequences of estimating the two regressions.

There must also be adequate exposure variation across instrument values and covariate patterns. If the instrument barely predicts exposure, the residual-inclusion estimate can be unstable and imprecise. Covariates in both stages should be chosen to represent relevant pre-exposure common causes, not variables caused by the exposure. If observation time varies, a model may include the log of time at risk as an offset; then the modeled count mean is interpreted relative to that exposure time.

How Residual Inclusion Works

The justification is a control-function argument. If the first-stage conditional mean is correctly specified, then the first-stage disturbance is represented by \(V_i=D_i-E(D_i\mid Z_i,X_i)\). The estimated residual \(\widehat R_i\) approximates this disturbance. If the outcome conditional mean depends on the unobserved exposure disturbance through a specified function of \(V_i\), conditioning on the residual accounts for that dependence. The treatment coefficient is then estimated while holding the control function and covariates fixed.

$$ E(Y_i\mid D_i,X_i,V_i) =\exp\!\left(\beta_0+\beta_DD_i+\beta_X^\top X_i+\rho V_i\right). $$

Replacing the unobserved \(V_i\) with \(\widehat R_i\) gives the second-stage model. This argument depends on both the first-stage and outcome control-function specifications. In particular, a residual term with the wrong functional form may fail to control endogeneity. In practice the first-stage residual is estimated, not observed, so uncertainty calculations should account for both stages.

1
Estimate the exposure model.
Regress the binary exposure \(D\) on the instrument \(Z\) and covariates \(X\), using a specified first-stage model.
2
Form residuals.
For the linear probability first stage, calculate \(\widehat R_i=D_i-\widehat D_i\) for every observation.
3
Fit the count model.
Estimate a Poisson or negative-binomial model for \(Y\) with \(D\), \(X\), and \(\widehat R\) as predictors.
4
Interpret and check.
Translate the log-mean coefficients to the desired count scale, assess instrument and model adequacy, and use inference that reflects estimation of the first stage.

Worked Example: A Binary Exposure and a Poisson Count Model

Suppose a hypothetical analysis studies whether receiving a preventive service (\(D=1\)) changes the number of acute-care visits over one year. An assigned encouragement \(Z\) is proposed as an instrument, and \(X\) is a measured baseline risk score. Assume for this illustration that the instrument is relevant, independent of unmeasured outcome causes conditional on \(X\), and excluded from the outcome except through service receipt. Also assume the specified control-function mean model is adequate.

The first-stage linear probability model gives \(\widehat D=0.20+0.15Z+0.10X\). For an individual with \(Z=1\), \(X=1\), and observed \(D=1\),

$$ \widehat D=0.20+0.15(1)+0.10(1)=0.45,\qquad \widehat R=1-0.45=0.55. $$

Suppose the fitted Poisson log-mean model is \(\log(\widehat\mu)=0.40+0.50D+0.20X+0.60\widehat R\). For an illustrative conditional contrast, hold \(X=1\) and \(\widehat R=0.55\) fixed, and compare exposure values \(D=1\) and \(D=0\).

$$ \begin{aligned} \widehat\mu(D=1)&=\exp\{0.40+0.50+0.20+0.60(0.55)\} =\exp(1.43)\approx4.179,\\ \widehat\mu(D=0)&=\exp\{0.40+0.20+0.60(0.55)\} =\exp(0.93)\approx2.534. \end{aligned} $$

The conditional incidence-rate ratio is \(\exp(0.50)\approx1.649\): at the same \(X\) and residual value, the modeled mean count is about 1.649 times as large under exposure. The mean difference is calculated from the unrounded predictions: \(\exp(1.43)-\exp(0.93)\approx4.17865-2.53448=1.64417\), or about 1.644 visits over the modeled year. Subtracting the displayed rounded means can differ slightly because of rounding. This is a model-based conditional contrast; interpreting it causally requires the assumptions stated above.

Interpreting Coefficients and Choosing a Count Model

In the log-link model, \(\beta_D\) is a conditional log mean ratio. Holding \(X\) and the control function fixed, a one-unit increase in \(D\) multiplies the conditional mean by \(\exp(\beta_D)\). Because \(D\) is binary, this compares exposure with no exposure. The coefficient does not directly give a difference in the number of events; the difference depends on the baseline covariates and residual value.

Poisson and negative-binomial models differ in their variance assumptions, not in the basic log-mean interpretation. Under Poisson, the conditional variance equals \(\mu_i\). Under NB2, it equals \(\mu_i+\alpha\mu_i^2\), which allows variance to exceed the mean. Choosing NB2 because the data are overdispersed can improve the variance model, but it does not fix a bad exclusion restriction, weak relevance, an incorrect control function, or an incorrect log-mean specification.

Worked Example: Interpreting a Poisson Treatment Coefficient

Suppose a hypothetical fitted residual-inclusion Poisson model has \(\widehat\beta_D=0.35\). At fixed covariates and residual, the incidence-rate ratio is

$$ \exp(0.35)\approx1.419. $$

Thus, the model estimates a conditional mean count about 41.9% higher for \(D=1\) than for \(D=0\), under the model and its control-function assumptions. For a particular covariate-residual profile whose predicted mean without exposure is \(\exp(0.80)\), the exposed mean is \(\exp(0.80+0.35)=\exp(1.15)\). The conditional difference is calculated before rounding:

$$ \exp(1.15)-\exp(0.80) =3.1581929-2.2255409 \approx0.933\text{ events}. $$

The model therefore gives about 0.933 additional events over the modeled period for that profile. The interval and period are essential parts of the count interpretation; without them, “events” has no complete unit.

Worked Example: Negative-Binomial Uncertainty and Overdispersion

In a hypothetical NB2 residual-inclusion fit, suppose the exposure estimate is \(\widehat\beta_D=0.28\), its standard error is \(SE=0.12\), and the estimated dispersion parameter is \(\widehat\alpha=0.40\). The estimated conditional incidence-rate ratio is \(\exp(0.28)\approx1.323\). An approximate 95% confidence interval for the log coefficient is

$$ 0.28\pm1.96(0.12)=[0.0448,\;0.5152]. $$

Exponentiating the endpoints gives an approximate interval \([\exp(0.0448),\exp(0.5152)]=[1.046,\;1.674]\) for the conditional incidence-rate ratio. Under the model and the assumptions needed for causal interpretation, the interval is compatible with a conditional mean count about 4.6% to 67.4% higher under exposure. The interval’s repeated-sampling interpretation is not a probability statement about this particular interval containing the parameter.

For a profile with fitted mean \(\widehat\mu=3.32\), the NB2 variance estimate is \(\widehat\mu+\widehat\alpha\widehat\mu^2 =3.32+0.40(3.32^2)\approx7.73\), larger than the mean. This illustrates the role of \(\alpha\): it describes extra conditional variation, not the correction for endogeneity.

Diagnostics, Inference, and Common Pitfalls

Diagnostics should examine each part of the procedure. Check whether the instrument predicts exposure conditional on covariates, and report an appropriate instrument-strength assessment rather than relying only on a coefficient’s p-value. Inspect the first-stage fit and residual behavior, including whether the linear probability model is a plausible approximation for the exposure conditional mean. In the outcome model, assess whether the log-mean specification is credible and whether the Poisson variance assumption is plausible; substantial overdispersion may favor a negative-binomial variance model. These checks can reveal problems, but no diagnostic test can establish instrument independence or exclusion from the observed data alone.

The standard error from a second-stage model that treats \(\widehat R\) as fixed generally ignores first-stage estimation. Use a procedure that accounts for both stages, such as a bootstrap that resamples observations and repeats the first-stage and outcome fits in every replicate, or an appropriate joint variance estimator. The resampling or variance method must reflect the sampling design, including clustering when relevant.

  • Confusing residual inclusion with fitted-value substitution. Replacing \(D\) by \(\widehat D\) in the nonlinear outcome model is predictor substitution, not this procedure. Residual inclusion keeps observed \(D\) and adds \(\widehat R\).
  • Treating a significant residual coefficient as proof of endogeneity correction. A nonzero \(\rho\) can indicate dependence captured by the specified control function, but it does not validate the instrument or prove that the residual specification is correct.
  • Reading \(\beta_D\) as a count difference. It is a log mean ratio. Exponentiate it for the conditional rate ratio; calculate predicted means and subtract them for a conditional mean difference.
  • Assuming a negative-binomial model solves every problem. Its variance flexibility addresses overdispersion; it does not repair weak instruments, violations of exclusion, or misspecified control functions.

Residual inclusion is useful when the outcome is a count and a credible instrument is available, but its causal conclusions are only as credible as the instrument and control-function assumptions. It is not a substitute for randomization, and a well-fitting count distribution cannot compensate for a questionable identification strategy. Compared with ordinary outcome regression, residual inclusion explicitly models the endogeneity channel under its assumptions. Compared with predictor substitution, it preserves the observed exposure and adds the estimated control function required by this nonlinear approach.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. In a residual-inclusion Poisson model, what does \(\exp(\beta_D)\) represent, and what does it not represent directly?
  2. A first-stage model predicts \(\widehat D=0.62\) for an individual with observed \(D=0\). Find the residual using \(D-\widehat D\).
  3. Why does choosing a negative-binomial model not by itself solve endogeneity?
  4. For a treatment coefficient of \(0.20\), calculate the conditional incidence-rate ratio to three significant figures.
  5. Why should uncertainty estimation account for the first-stage fit?

Solutions. (1) \(\exp(\beta_D)\) is the conditional mean count ratio comparing \(D=1\) with \(D=0\) at fixed covariates and residual. It is not a count difference; that requires predicted means on the count scale. (2) \(R=0-0.62=-0.62\). (3) Negative binomial permits variance greater than the mean, but endogeneity is addressed only if the instrument and control-function assumptions are credible. (4) \(\exp(0.20)\approx1.22\), a conditional mean count about 1.22 times as large under exposure. (5) The residual is estimated from the first stage. Treating it as fixed omits uncertainty from that estimation and can misstate the second-stage standard error.

Clinical Biostats