Tutorials › Propensity Score Matching and Instrumental Variables › Conditional Outcome Means With Continuous Covariates

Causal Effects, Ignorability and Positivity · Tutorial 22 of 699

Conditional Outcome Means With Continuous Covariates

Learn to average conditional outcome means over the covariate distribution to identify mean potential outcomes and causal effects.

Beginner 10 min read

What You'll Learn

  • Define a conditional outcome mean for each treatment level as a function of continuous covariates.
  • State the assumptions and finite-mean condition needed to identify a mean potential outcome.
  • Derive the integration formula using conditional expectation, exchangeability, and consistency.
  • Standardize conditional mean functions over a target covariate distribution in worked examples.
  • Distinguish a standardized causal contrast from an unadjusted observed outcome difference.
  • Recognize how model misspecification, limited overlap, and a changed target population affect conclusions.

From Covariate Strata to Conditional Mean Functions

When covariates are discrete, adjustment can be described by comparing outcomes within each covariate stratum and averaging those comparisons. A continuous covariate, such as age or a laboratory measurement, can take many values. Rather than forming a separate stratum for every possible value, we describe the mean outcome at each covariate value with a conditional outcome mean function, then average that function over the covariate distribution of the population of interest.

Let \(A\in\{0,1\}\) denote treatment, \(Y\) the observed outcome, \(Y(1)\) and \(Y(0)\) the potential outcomes under treatment and control, and \(X\) a pretreatment covariate. The same argument applies when \(X\) is a vector of continuous covariates. The key distinction is between a conditional mean, which describes outcomes at a given covariate value, and a marginal mean, which averages across covariate values.

Definition: For treatment level \(a\in\{0,1\}\), the conditional outcome mean is \(m_a(x)=E[Y\mid A=a,X=x]\), wherever this conditional mean is defined. It describes the mean observed outcome among units with treatment \(a\) and covariate value \(x\). Under suitable identification assumptions, it also equals the conditional mean potential outcome \(E[Y(a)\mid X=x]\).

For causal interpretation, define the population mean potential outcome as \(E[Y(a)]\). Its value depends on the target population: the distribution of \(X\) over which the conditional means are averaged must be the distribution for that population. This tutorial uses \(F_X\) for that distribution. If \(X\) has a density \(f_X\), averaging can be written as an integral against the density. A density is not required, however; integration with respect to \(F_X\) also covers discrete, mixed, or empirical covariate distributions.

Identification by Averaging

The identification result connects the potential outcome mean to observed conditional means. It needs consistency, conditional exchangeability, positivity, and a condition ensuring the means actually exist. For the treatment levels being considered, assume \(E[|Y(a)|]<\infty\). This absolute-integrability condition ensures that \(E[Y(a)]\) is finite and supports the conditional-expectation averaging used below. The conditional means must likewise be integrable over the target covariate distribution; under the stated assumptions, this follows for the identified potential-outcome mean.

Theorem: Suppose, for a treatment level \(a\), (1) consistency holds, so \(Y=Y(a)\) when \(A=a\); (2) conditional exchangeability holds, \(Y(a)\perp A\mid X\); (3) positivity holds, \(P(A=a\mid X=x)>0\) for \(F_X\)-almost every \(x\) in the target population; and (4) \(E[|Y(a)|]<\infty\). Then $$ E[Y(a)] = \int E[Y(a)\mid X=x]\,dF_X(x) = \int E[Y\mid A=a,X=x]\,dF_X(x) = \int m_a(x)\,dF_X(x). $$ If \(X\) has density \(f_X\), the last expression is \(\int m_a(x)f_X(x)\,dx\).

The logic is short but each assumption has a distinct role. First, the law of iterated expectations gives \(E[Y(a)]=\int E[Y(a)\mid X=x]\,dF_X(x)\). Conditional exchangeability makes the conditional distribution of \(Y(a)\), and hence its conditional mean, the same among units with \(A=a\) as in the full covariate group: \(E[Y(a)\mid X=x]=E[Y(a)\mid A=a,X=x]\). Consistency then replaces \(Y(a)\) by the observed \(Y\) within that treatment group, yielding \(E[Y(a)\mid A=a,X=x]=E[Y\mid A=a,X=x]\). Positivity ensures that this observed conditional mean is available on the target population's covariate support. Absolute integrability makes the expectations and averaging operation well-defined.

Applying the result to both treatment levels identifies the average treatment effect (ATE), defined as \(E[Y(1)-Y(0)]\). When both potential outcomes have finite absolute means, linearity of expectation gives $$ \operatorname{ATE} = E[Y(1)]-E[Y(0)] = \int \{m_1(x)-m_0(x)\}\,dF_X(x). $$ The conditional difference \(m_1(x)-m_0(x)\) may vary with \(x\). The formula does not require a constant treatment effect; it averages the conditional mean differences over the target covariate distribution.

Worked Example: Integrating Over a Uniform Covariate

Suppose a hypothetical target population has a continuous covariate \(X\), measured in units on a scale from 0 to 4, with \(X\sim\text{Uniform}(0,4)\). Assume the identification conditions above hold, the potential outcomes have finite absolute means, and the conditional outcome means (in outcome units) are \(m_0(x)=10+2x\) and \(m_1(x)=14+3x\). Find each mean potential outcome and the ATE.

A uniform distribution on 0 to 4 has density \(f_X(x)=1/4\). Thus $$ E[Y(0)]=\int_0^4(10+2x)\frac14\,dx =\frac14[10x+x^2]_0^4 =\frac14(40+16)=14. $$ The mean potential outcome under control is 14 outcome units.

Similarly, $$ E[Y(1)]=\int_0^4(14+3x)\frac14\,dx =\frac14[14x+\tfrac32x^2]_0^4 =\frac14(56+24)=20. $$ Therefore, \(\operatorname{ATE}=20-14=6\) outcome units. Equivalently, the conditional difference is \(m_1(x)-m_0(x)=4+x\), whose uniform-population average is \(4+E[X]=4+2=6\). Both calculations average over the same target distribution.

Standardizing to a Specific Target Population

The distribution used for averaging is part of the estimand, not a minor computational choice. A conditional outcome function can be averaged over the covariate distribution of a study sample, a broader eligible population, or another explicitly defined target group. If those groups have different covariate distributions, their mean potential outcomes and ATEs can differ even when the conditional outcome functions are unchanged.

In practice, a target population is often represented by its observed covariate values. The empirical distribution gives each target unit equal weight, so integrating a fitted conditional mean over that distribution amounts to averaging its predictions. This is sometimes called standardization or the g-computation formula. The identification formula itself does not prescribe how to estimate the conditional mean function; a model or other estimation method is needed when it is not known.

Worked Example: Empirical Standardization

Consider a hypothetical target sample of four people with baseline severity scores \(x=1,2,3,4\). Suppose conditional outcome means, in score points, are \(m_0(x)=50+2x\) and \(m_1(x)=62+3x\). Assume consistency, conditional exchangeability, positivity at the target covariate values, and finite absolute means. Standardize to these four people.

Under control, the predicted conditional means are \(52,54,56,58\), so $$ \widehat{E[Y(0)]}_{\text{target}} =\frac{52+54+56+58}{4} =\frac{220}{4}=55\text{ points}. $$ Under treatment, they are \(65,68,71,74\), giving $$ \widehat{E[Y(1)]}_{\text{target}} =\frac{65+68+71+74}{4} =\frac{278}{4}=69.5\text{ points}. $$ The standardized contrast is \(69.5-55=14.5\) points. The conditional differences at the four scores are \(13,14,15,16\) points; their average is also \(14.5\) points. These calculations illustrate standardization using specified conditional means. In an applied analysis, predictions from estimated functions would add estimation uncertainty that these arithmetic averages do not show.

Worked Example: Why the Unadjusted Difference Can Differ

In a hypothetical population, let \(X\) be uniformly distributed from 0 to 1 and let \(P(A=1\mid X=x)=0.2+0.6x\). This probability ranges from 0.2 to 0.8, so both treatment levels occur throughout the covariate support. Assume consistency, conditional exchangeability, and finite absolute outcome means. Suppose the conditional means, in days, are \(m_0(x)=10+10x\) and \(m_1(x)=14+10x\).

The target population's mean \(X\) is \(0.5\). Standardization therefore gives \(E[Y(0)]=10+10(0.5)=15\) days and \(E[Y(1)]=14+10(0.5)=19\) days. The ATE is 4 days.

But treated and untreated people have different mean \(X\). Since \(X\) is uniform, \(E[A]=\int_0^1(0.2+0.6x)\,dx=0.5\), and $$ E[X\mid A=1] =\frac{E[X P(A=1\mid X)]}{P(A=1)} =\frac{\int_0^1 x(0.2+0.6x)\,dx}{0.5} =\frac{0.1+0.2}{0.5}=0.6. $$ Likewise, \(P(A=0\mid X=x)=0.8-0.6x\), so $$ E[X\mid A=0] =\frac{\int_0^1 x(0.8-0.6x)\,dx}{0.5} =\frac{0.4-0.2}{0.5}=0.4. $$ The observed treated mean is \(14+10(0.6)=20\) days, while the observed untreated mean is \(10+10(0.4)=14\) days. Their crude difference is 6 days, not the 4-day ATE. The difference arises because the treatment groups have different covariate distributions; standardization averages both conditional means over the same target population.

Choosing and Checking a Conditional Mean Function

The integral identifies a causal mean under its assumptions, but it does not guarantee that an estimated \(m_a(x)\) is accurate. With continuous covariates, estimating a function requires choices about its shape and flexibility. A straight-line model, for example, imposes a particular relationship between \(X\) and the conditional outcome mean. Curvature, thresholds, or treatment-effect variation can make a simple model inadequate. Flexible models can reduce some shape restrictions but may be unstable where data are sparse.

Useful checks include plotting observed outcomes and fitted conditional means against \(X\) separately by treatment, looking for systematic patterns in residuals, and checking whether both treatment groups have observations across the target covariate range. These checks can reveal poor fit or sparse support, but no diagnostic can establish conditional exchangeability: unmeasured confounding is not ruled out merely because a model fits well.

Positivity is especially important at the integration stage. If the target population includes covariate values where one treatment level is never observed, the corresponding conditional mean cannot be learned directly from observed outcomes there. A model may still produce a prediction, but that prediction relies on extrapolation rather than observed comparisons. Restricting the target population to a region with support changes the population to which the result applies; it does not identify the original target mean without further assumptions.

Common Pitfalls and Alternatives

  • Using the crude difference as the adjusted effect. The wrong reasoning is that the treated and untreated outcome averages compare treatment levels directly. When covariate distributions differ, those averages also reflect differences in \(X\). The correction is to compare conditional means at covariate values and average both over the same target distribution.
  • Confusing conditional means with causal effects. \(m_a(x)\) is an observed conditional mean by definition. It represents \(E[Y(a)\mid X=x]\) only under the identification assumptions. A fitted relationship alone does not make that equality true.
  • Assuming positivity means at least one observation in every imaginable covariate value. The condition is about almost every value in the target distribution, not points outside its support. In finite data, however, very sparse treatment groups can still make estimates unstable.
  • Ignoring whether the mean exists. Exchangeability, consistency, and positivity do not by themselves guarantee finite expectations. A mean identification statement requires an existence condition such as \(E[|Y(a)|]<\infty\) for the levels under study.
  • Changing the averaging distribution without noticing. Averaging over the treated group's covariate distribution, rather than the target population's distribution, generally targets a different quantity.

Compared with discrete stratification, conditional mean functions handle a continuum of covariate values without requiring a separate estimable stratum at each value. Regression adjustment can estimate these functions, but its validity depends on suitable modeling and the identification assumptions. Weighting is another way to adjust for covariate distributions; it uses treatment probabilities rather than directly averaging outcome predictions. These approaches have different practical behavior, but none removes the need for a clearly defined target population, adequate support, and credible assumptions.

The central limitation is that the formula is an identification result, not proof that the assumptions hold or a guarantee that an estimate is precise. It says what observed conditional means identify if the assumptions and finite-mean condition are satisfied. It does not determine which covariates are sufficient, repair a lack of overlap, or account automatically for uncertainty from estimating the functions.

Key takeaway: For each treatment level, identify its conditional mean outcome function, then average that function over the covariate distribution of the target population. The resulting mean has a causal interpretation only under consistency, conditional exchangeability, positivity on the target support, and finite absolute potential-outcome means.

Check Your Understanding

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

  1. If \(X\sim\text{Uniform}(0,2)\), \(m_0(x)=5+x\), and \(m_1(x)=8+2x\), what are the standardized mean potential outcomes and the ATE?
  2. Why is positivity needed to use \(E[Y\mid A=a,X=x]\) for every covariate value in a target population?
  3. Suppose conditional exchangeability and positivity hold, but \(E[|Y(1)|]\) is infinite. Why should the mean-identification equality not be reported as a defined equality of finite means?
  4. Why can an unadjusted treated-minus-untreated mean differ from the standardized ATE?

Solutions. (1) The density is \(1/2\) on \([0,2]\), and \(E[X]=1\). Thus \(E[Y(0)]=5+1=6\), \(E[Y(1)]=8+2(1)=10\), and the ATE is \(10-6=4\) outcome units. (2) Without positive probability of treatment \(a\) at a target covariate value, the observed data contain no outcomes at that treatment level there, so its conditional mean cannot be obtained directly from those data. (3) An infinite absolute mean means the ordinary finite expectation and the iterated-expectation equality used for a mean are not justified as finite quantities; the assumptions listed do not supply the missing existence condition. (4) The treatment groups may have different covariate distributions. The crude difference then combines conditional outcome differences with covariate-composition differences, while standardization averages both treatment-specific conditional means over the same target distribution.

Clinical Biostats