Why Continuous Covariates Require Integration
A longitudinal treatment regime fixes treatment choices over time, but it does not generally fix the covariates that evolve between those choices. Under a regime, a person’s intermediate covariate history can still vary across the population. To find the regime-specific mean outcome, we must average conditional outcome predictions over the covariate histories that would arise under that regime.
When covariates are discrete, this averaging is a sum over possible histories. With continuous covariates, it is an integral weighted by their probability densities. The weights matter: a history that is common under the regime contributes more to the mean than a history that is rare. In particular, evaluating an outcome model at the mean covariate history is generally not equivalent to integrating it.
The Integral for Two Treatment Waves
Let \(L_0\) denote baseline covariates, \(A_0\) the first treatment, \(L_1\) the covariates measured after \(A_0\) and before \(A_1\), and \(A_1\) the second treatment. Let \(Y\) be the final outcome. Consider a static regime that sets \(A_0=a_0\) and \(A_1=a_1\). Define the conditional outcome mean \( \mu(l_0,l_1,a_0,a_1)=E[Y\mid L_0=l_0,L_1=l_1,A_0=a_0,A_1=a_1] \).
The regime-specific mean is obtained by integrating that conditional mean over the baseline distribution and the distribution of \(L_1\) under the first treatment in the regime:
For longer histories, each additional time-varying covariate contributes another conditional density factor and another integral. For example, if \(L_2\) is measured after \(A_1\) and before a final treatment \(A_2\), the integrand includes \(f(l_2\mid l_0,l_1,a_0,a_1)\), and the outcome mean conditions on \(l_2\) and \(a_2\) as well. The treatment values in these factors are the values specified by the regime, not values averaged over the observed treatment assignment process.
This expression uses observed conditional distributions to represent the covariate distributions under intervention. Its causal interpretation requires consistency, sequential exchangeability, and positivity for the regime, along with appropriate specification of the outcome and covariate-distribution models when they are estimated parametrically. Without the causal assumptions, the integral is still a model-based standardization, but it need not equal the mean of the counterfactual outcome under the intervention.
Why the Formula Has This Form
The central step is the law of iterated expectation. Under the regime, first condition on the covariate history, then average the conditional outcome mean over the distribution of that history. In the two-wave setup, this gives \(E[Y^{a_0,a_1}]=E\{E[Y^{a_0,a_1}\mid L_0,L_1^{a_0}]\}\). Under consistency and sequential exchangeability, the inner conditional mean is represented by the observed conditional outcome model at \(A_0=a_0,A_1=a_1\), and the distribution of \(L_1^{a_0}\) is represented by \(f(l_1\mid l_0,a_0)\). Writing the outer expectation as an integral yields the formula above.
The same reasoning shows why the density factors must correspond to the intervention. The first covariate distribution is generated after setting \(A_0=a_0\); later covariate distributions are generated after the treatment history specified up to that point. Replacing them with a pooled or differently conditioned distribution changes the histories being averaged over.
Worked Example: A Nonlinear Outcome Model With One Continuous Covariate
Suppose a hypothetical population is assigned \(A_0=1\), and the resulting continuous covariate \(L\) has distribution \(N(2,1)\), where the second parameter is the variance. Suppose the conditional outcome mean is \(E[Y\mid A_0,L]=10+3A_0+2L+0.5L^2\). Find the regime-specific mean. Assume the distribution and outcome model are correctly specified, and that the causal assumptions needed to identify the regime mean hold.
Under the regime, \(A_0\) is fixed at 1, so the required integral is \(E[10+3+2L+0.5L^2]\), where \(L\sim N(2,1)\). For this normal distribution, \(E[L]=2\) and \(E[L^2]=\operatorname{Var}(L)+\{E[L]\}^2=1+2^2=5\).
The regime-specific mean is 19.5 outcome units. Evaluating the model only at \(L=E[L]=2\) would give \(10+3+2(2)+0.5(2^2)=19\), which is different. The difference arises because the outcome model is nonlinear in \(L\), so its average depends on the second moment as well as the mean.
Integrating Sequential Covariate Distributions
With multiple treatment waves, integration can often be organized using iterated expectation: integrate the last covariate first, conditional on earlier history, and then average over earlier covariates. This is the continuous counterpart of summing over histories in a discrete-time g-formula. It also makes clear which moments or conditional expectations are needed for a particular outcome model.
Worked Example: Two Sequential Continuous Covariates
Consider a hypothetical two-treatment regime \(A_0=1,A_1=0\). Under this regime, suppose \(L_1\sim N(2,1)\), and \(L_2\mid L_1=l_1,A_0=1,A_1=0\sim N(1+0.5l_1,4)\). Suppose the conditional outcome mean is \(5+2A_0-A_1+3L_1+2L_2+0.5L_1L_2\). Assume these conditional models are correctly specified and the identification assumptions hold.
First integrate over \(L_2\) conditional on \(L_1\). Its conditional mean is \(1+0.5L_1\), so \(E[L_2]=1+0.5E[L_1]=1+0.5(2)=2\). For the interaction, condition on \(L_1\): \(E[L_1L_2]=E[L_1E(L_2\mid L_1)]=E[L_1(1+0.5L_1)]\). Since \(E[L_1^2]=1+2^2=5\), this gives \(E[L_1L_2]=2+0.5(5)=4.5\).
The regime-specific mean is 19.25 outcome units. The variance of \(L_2\) is part of its conditional distribution, but it does not enter these particular calculations because the outcome model is linear in \(L_2\) once \(L_1\) is fixed. A model containing \(L_2^2\), for instance, would also require the conditional second moment of \(L_2\).
Joint Distributions and Dependence
When an outcome model contains products or other joint functions of covariates, the dependence between covariates affects the integral. Even if each covariate’s marginal mean is known, those means alone may not determine the expected outcome. Sequential conditional distributions preserve the dependence structure because each later covariate is integrated conditional on the earlier history.
Worked Example: A Covariate Interaction Under a Dependent History
In a separate hypothetical setting, consider the regime \(A_0=0,A_1=1\). Under this regime, suppose \(L_1\sim N(1,1)\) and \(L_2\mid L_1=l_1,A_0=0,A_1=1\sim N(2+l_1,1)\). Let the conditional outcome mean be \(E[Y\mid L_1,L_2,A_0,A_1]=6+4A_1+L_1L_2\). Assume correct models and the causal identification assumptions.
The conditional mean of \(L_2\) is \(2+L_1\). Therefore, \(E[L_2]=2+E[L_1]=3\), while the interaction expectation is \(E[L_1L_2]=E[L_1(2+L_1)]=2E[L_1]+E[L_1^2]\). Here \(E[L_1]=1\) and \(E[L_1^2]=1+1^2=2\), so \(E[L_1L_2]=4\).
The regime-specific mean is 14 outcome units. Multiplying the marginal means would give \(E[L_1]E[L_2]=1(3)=3\), not 4, and would produce the wrong result for the interaction term. The conditional distribution captures the dependence: in this example, \(E[L_1L_2]=E[L_1]E[L_2]+\operatorname{Cov}(L_1,L_2)=3+1=4\).
A Practical Integration Workflow
For a specified regime and a fitted set of conditional models, keep the outcome model and covariate distributions conceptually separate. The outcome model supplies a prediction for each full history; the covariate models determine how those histories are weighted under the regime. A reliable calculation follows the ordering of measurement and treatment:
Identify baseline covariates, each treatment, each subsequent covariate, and the outcome.
Use those choices in both the conditional outcome mean and the covariate distributions that follow treatment.
Multiply the conditional outcome mean by the sequential covariate densities and integrate over every continuous covariate history.
Use analytic expectations where available, or an appropriate deterministic integration method, and report the result in outcome units.
An analytic calculation may be especially convenient when the models are linear or polynomial and the required moments are available. For more complicated models, numerical integration can approximate the same weighted integral. In either case, the target remains the integral over regime-specific histories; a computational method does not change its definition.
Common Mistakes
- Plugging in mean covariates. The incorrect reasoning is that the average prediction must equal the prediction at the average history. This is generally false for nonlinear models or interactions. Integrate the model over the covariate distribution, using the moments the model requires.
- Using the wrong covariate distribution. A pooled distribution, or a distribution observed under a different treatment history, need not be the distribution induced by the regime. Use the sequential conditional distributions evaluated at the regime’s treatment choices.
- Breaking dependence between covariates. Replacing a joint history distribution by separate marginal distributions can give an incorrect expectation for interactions. Preserve dependence through the conditional distributions in the history.
- Calling a model-based integral causal without checking assumptions. The integral is a causal regime mean only when consistency, sequential exchangeability, positivity, and the required model conditions support that interpretation. Otherwise it is a standardized prediction, not necessarily an intervention effect.
Check Your Understanding
Answer each question using the definitions and calculations above.
- For a nonlinear outcome model, why can evaluating the model at the mean covariate value differ from integrating over the covariate distribution?
- In a two-wave regime, which treatment values should be used when evaluating the conditional distribution of the intermediate covariate?
- If an outcome model includes \(L_1L_2\), why might the marginal means of \(L_1\) and \(L_2\) be insufficient to calculate the regime-specific mean?
- In Worked Example 2, what additional moment would be needed if the outcome model included a term proportional to \(L_2^2\)?
- What assumptions are needed to interpret a parametric g-formula integral as a causal regime-specific mean?