Tutorials › Econometrics (Graduate) › Selection Bias as a Conditional-Mean Decomposition

Sample Selection Models · Tutorial 547 of 952

Selection Bias as a Conditional-Mean Decomposition

See how conditioning on being observed changes regression coefficients when selection is related to unobserved outcome determinants.

Advanced 9 min read

What You'll Learn

  • Define the population and selected-sample regression targets under an outcome model with a mean-zero error conditional on covariates.
  • Derive the selected-sample coefficient shift from the conditional mean of the error among selected observations.
  • Interpret the scalar slope shift as a covariance between covariates and the selected conditional error mean.
  • Distinguish selection on unobservables from selection that changes covariate composition but leaves the conditional error mean at zero.
  • Identify when selection changes an intercept, a slope, or neither.

Why Conditioning on Observation Can Change a Regression

A regression fitted to observed outcomes describes the population whose outcomes are observed. If observation depends on unobserved determinants of the outcome, that selected population can have a different relationship between outcomes and covariates from the population of interest. The source of the difference can be expressed directly: among selected observations, the outcome error may have a nonzero mean conditional on the covariates.

This decomposition separates two ideas that are easy to conflate. Selection can change the distribution of observed covariates without biasing regression coefficients, provided the outcome error still has conditional mean zero. Conversely, selection related to unobservables can change coefficients when the selected conditional error mean varies systematically with the covariates.

Definition: Let \(S\) be an indicator for whether an outcome is observed, with \(S=1\) denoting selection into the observed sample. Suppose the population outcome model is $$ Y=X'\beta+u,\qquad E[u\mid X]=0. $$ Here \(X\) is a vector of regressors that includes a constant, \(\beta\) is the population regression coefficient vector, and \(u\) is the outcome error. Define $$ m(X)=E[u\mid X,S=1]. $$ The function \(m(X)\) is the selected-sample conditional mean of the outcome error. It need not be zero, even when \(E[u\mid X]=0\) in the population.

Assume the relevant expectations exist, and that the selected regressors have a nonsingular second-moment matrix. The selected-sample population regression coefficient is the coefficient vector from the linear projection of \(Y\) on \(X\), conditional on \(S=1\). It is the population target of ordinary least squares applied to a large sample of selected observations; it is not automatically the coefficient for the full population.

The Conditional-Mean Decomposition

Condition on both the covariates and selection. The outcome model gives

$$ E[Y\mid X,S=1]=X'\beta+E[u\mid X,S=1]=X'\beta+m(X). $$

Thus the selected conditional mean consists of the population regression component plus a selection-related term. If \(m(X)\) varies with \(X\), that term can be attributed partly to the regressors when a regression is fitted to selected observations.

To obtain the coefficient shift, let \(Q_S=E[XX'\mid S=1]\), and denote the selected-sample population coefficient by \(\beta_S\). The normal equations for the linear projection give \(\beta_S=Q_S^{-1}E[XY\mid S=1]\). Substituting the outcome model and conditioning the error on selection yields the result below.

Result: If \(Q_S\) is nonsingular, then $$ \beta_S =\beta+Q_S^{-1}E[Xm(X)\mid S=1]. $$ This identity describes the difference between the selected-sample regression coefficient and the population coefficient. The shift depends on the selected covariate distribution and on how the selected conditional error mean \(m(X)\) co-varies with the regressors.

The identity follows by expanding the selected normal equations:

$$ \begin{aligned} \beta_S &=Q_S^{-1}E[XY\mid S=1]\\ &=Q_S^{-1}E[X(X'\beta+u)\mid S=1]\\ &=Q_S^{-1}\{Q_S\beta+E[Xu\mid S=1]\}\\ &=\beta+Q_S^{-1}E[Xm(X)\mid S=1]. \end{aligned} $$

For the last equality, iterated expectations give \(E[Xu\mid S=1]=E[XE[u\mid X,S=1]\mid S=1]=E[Xm(X)\mid S=1]\). This is a decomposition, not a distributional assumption: it does not require normally distributed errors or a particular functional form for the selection rule.

What the Decomposition Says About Slopes

For a single regressor \(X\) and an intercept, the selected-sample slope has a particularly clear form. Writing \(\operatorname{Cov}_S\) and \(\operatorname{Var}_S\) for covariance and variance conditional on \(S=1\), the slope is

$$ \beta_{1,S} =\beta_1+ \frac{\operatorname{Cov}_S(X,m(X))} {\operatorname{Var}_S(X)}. $$

To see why, the slope in a regression with an intercept is \(\operatorname{Cov}_S(X,Y)/\operatorname{Var}_S(X)\). Since \(E[Y\mid X,S=1]=\beta_0+\beta_1X+m(X)\), its selected covariance with \(X\) is \(\beta_1\operatorname{Var}_S(X)+\operatorname{Cov}_S(X,m(X))\). Dividing by the selected variance gives the expression above. With multiple regressors, the analogous slope shift is the selected covariance matrix of the regressors inverted and multiplied by their selected covariance with \(m(X)\), after accounting for the intercept.

The formula highlights three distinct possibilities. If \(m(X)=0\), selected and population coefficients agree when the conditional mean model is correctly specified. If \(m(X)\) is a nonzero constant, the intercept shifts but the slope does not. If \(m(X)\) systematically varies with \(X\), the slopes can shift as well.

Worked Example: Selection Raises the Slope

Suppose a hypothetical population has a binary covariate \(X\), with \(P(X=0)=P(X=1)=0.5\), and outcome model \(Y=2+3X+u\). For each value of \(X\), let half the population be selected. Among selected individuals, let the error be \(-2\) when \(X=0\) and \(+2\) when \(X=1\); among unselected individuals, let it be \(+2\) when \(X=0\) and \(-2\) when \(X=1\). Find the population and selected-sample slopes.

Check the population error assumption. At \(X=0\), \(E[u\mid X=0]=0.5(-2)+0.5(2)=0\). At \(X=1\), \(E[u\mid X=1]=0.5(2)+0.5(-2)=0\). Therefore the population conditional mean is \(E[Y\mid X]=2+3X\), with slope \(3\).

Find the selected conditional means. Here \(m(0)=-2\) and \(m(1)=2\). The selected mean outcome at \(X=0\) is \(2-2=0\), while at \(X=1\) it is \(2+3+2=7\). Because both covariate values are equally common among selected individuals, the selected slope is \(7-0=7\).

Verify the decomposition. In the selected group, \(E_S[X]=0.5\), \(\operatorname{Var}_S(X)=0.25\), and \(\operatorname{Cov}_S(X,m(X))=1\). Thus the slope shift is \(1/0.25=4\), and \(\beta_{1,S}=3+4=7\). Selection has not changed the population regression model; it has changed the selected conditional error mean in a way that is positively related to \(X\).

Worked Example: A Nonlinear Selection Term and a Linear Projection

Consider a hypothetical population with \(X\) taking values \(-1,0,1\), each with probability \(1/3\), and outcome model \(Y=1+2X+u\). At each \(X\), suppose selection probability is \(0.5\). The selected conditional error means at \(X=-1,0,1\) are \(-2,0,2\), respectively, and the unselected conditional error means are \(2,0,-2\). Find the selected-sample linear regression.

Check the population model. At every covariate value, the selected and unselected error means average to zero with equal weights. For example, at \(X=-1\), \(E[u\mid X=-1]=0.5(-2)+0.5(2)=0\). The same calculation gives zero at \(X=0\) and \(X=1\). Hence the population conditional mean is \(1+2X\).

Calculate the selected slope shift. The selected values of \(X\) remain equally likely, so \(E_S[X]=0\) and \(\operatorname{Var}_S(X)=((-1)^2+0^2+1^2)/3=2/3\). Also \(E_S[m(X)]=0\), and \(\operatorname{Cov}_S(X,m(X))=((-1)(-2)+0(0)+(1)(2))/3=4/3\). Therefore the selected slope is

$$ \beta_{1,S}=2+\frac{4/3}{2/3}=4. $$

Calculate the intercept and check the fitted means. The selected mean of \(Y\) is \(((-3)+1+5)/3=1\), so the selected intercept is \(1-4(0)=1\). The selected conditional means are \(-3,1,5\) at \(X=-1,0,1\); the fitted line \(1+4X\) passes through the first and last values and has value \(1\) at zero. The selected linear projection therefore has intercept \(1\) and slope \(4\), although the population slope is \(2\).

Selection on Covariates Is Not the Same as Selection on Unobservables

A change in the distribution of \(X\) among observed cases does not by itself imply a coefficient shift. If selection depends on \(X\) but is conditionally independent of \(u\), then \(E[u\mid X,S=1]=E[u\mid X]=0\). In that case \(m(X)=0\), and the decomposition gives \(\beta_S=\beta\), provided the population conditional mean is correctly specified as linear and the selected covariates retain enough variation to estimate the coefficients.

Worked Example: A Changed Covariate Mix With No Slope Bias

Suppose a hypothetical population has \(P(X=0)=P(X=1)=0.5\) and \(Y=4+1.5X+u\), with \(E[u\mid X]=0\). Let selection be independent of \(u\) conditional on \(X\), with \(P(S=1\mid X=0)=0.8\) and \(P(S=1\mid X=1)=0.2\). Compare the population and selected slopes.

The probability of selection is \(P(S=1)=0.5(0.8)+0.5(0.2)=0.5\). Among selected cases, the proportion with \(X=1\) is \(P(X=1\mid S=1)=0.5(0.2)/0.5=0.2\); thus the selected covariate distribution differs substantially from the population distribution.

Nevertheless, conditional independence gives \(m(0)=m(1)=0\). The mean outcome at each covariate value is still \(4\) when \(X=0\) and \(5.5\) when \(X=1\). The population slope is \(5.5-4=1.5\), and the selected slope is also \(5.5-4=1.5\). The selected variance of \(X\) is \(0.2(0.8)=0.16\), which is positive, so both covariate values remain represented and the slope is identified in this example. The changed composition affects precision and the intercept’s relationship to the selected distribution, but not the correctly specified conditional-mean slope.

Why a Nonzero Selected Error Mean Is Not the Whole Story

Finding \(E[u\mid S=1]\ne 0\) is not enough to conclude that slopes are biased. A nonzero selected error mean that is constant across covariate values shifts the selected intercept. For example, if \(m(X)=c\), then the selected conditional mean is \(X'\beta+c\); the constant is absorbed by the intercept, leaving the slopes unchanged. For a slope shift, the relevant quantity is the selected association between the regressors and \(m(X)\), not merely the overall mean of \(m(X)\).

The reverse caution also matters: the formula compares regression coefficients under a correctly specified population conditional mean. If the true conditional mean is nonlinear but a linear regression is used as an approximation, changing the covariate distribution can change the best linear projection even when selection does not depend on \(u\) conditional on \(X\). In that setting, the difference may reflect reweighting of the approximation rather than a nonzero selected conditional error mean under a correctly specified linear model.

Common Mistake: Treating Selection as a Mere Change in Sample Size

A tempting but incorrect argument is: “Selection only removes some observations, so it can reduce precision but cannot change the regression coefficient.” This is wrong when the removed and retained observations differ in their outcome errors conditional on the regressors. Conditioning on \(S=1\) can make \(m(X)\) nonzero; if that term co-varies with the regressors, the selected regression absorbs part of it into its coefficients.

The correction is to ask two questions separately: does selection change the covariate distribution, and does it change the conditional mean of the outcome error among observations with each covariate value? The first affects the selected design and may affect precision. The second, together with its relationship to the regressors, determines the coefficient shift in the decomposition. A selected-sample coefficient describes the selected population unless additional assumptions or methods justify interpreting it as a population coefficient.

Key takeaway: Under a correctly specified population conditional mean \(E[Y\mid X]=X'\beta\), the selected regression coefficient differs from \(\beta\) by the linear projection of \(m(X)=E[u\mid X,S=1]\) onto the selected regressors. Selection changes slopes when the selected conditional error mean is associated with the regressors after accounting for the intercept.

Check Your Understanding

Use the conditional-mean decomposition to answer the following questions.

  1. In the selected coefficient formula, what does \(m(X)\) represent, and why can it be nonzero even when \(E[u\mid X]=0\)?
  2. If \(m(X)=0\) and the selected regressor second-moment matrix is nonsingular, what does the decomposition imply about \(\beta_S\) and \(\beta\)?
  3. In a single-regressor model with an intercept, what feature of \(m(X)\) determines whether the selected slope differs from the population slope?
  4. If \(m(X)\) is a nonzero constant, which regression coefficient changes, and why?
  5. Can a changed distribution of \(X\) among selected observations alone establish that the slope is biased? Explain under the correctly specified linear conditional-mean model.
Clinical Biostats