Tutorials › Marginal Structural Models › Baseline Averaging and the Target Population

The Parametric g-Formula · Tutorial 306 of 501

Baseline Averaging and the Target Population

Learn to average regime-specific predictions over the right baseline distribution, and see how empirical and weighted standardization target different populations.

Advanced 11 min read

What You'll Learn

  • Express a regime-specific mean as an integral over the target baseline distribution.
  • Distinguish conditional simulated outcomes from the marginal mean being estimated.
  • Calculate empirical standardization for a target sample.
  • Standardize to a weighted target population using normalized weights.
  • Identify assumptions and diagnostics relevant to baseline averaging.
  • Recognize how averaging over the wrong baseline distribution changes the estimand.

Why the Baseline Distribution Matters

A simulated counterfactual trajectory starts from a person’s baseline covariates and then evolves under a specified treatment regime. The resulting outcome prediction is conditional on that starting point. A regime-specific mean for a population, however, is not the prediction for one person: it averages those conditional outcomes over the baseline covariate distribution of the population named by the estimand.

This distinction is central to the parametric g-formula. The earlier material on regime-specific counterfactual means defines the target quantity, and the earlier material on simulating counterfactual longitudinal trajectories describes how to obtain predictions under a regime. Here the focus is the final averaging step: which baseline values are averaged over, and why that step gives the population mean.

Definition: Let \(L_0\) denote baseline covariates, let \(d\) be a treatment regime, and let \(Y^d\) be the outcome that would be observed under that regime. For a target population with baseline distribution \(F_0^*\), its regime-specific mean is $$ \psi_d^* = E_{F_0^*}[Y^d] = \int E[Y^d\mid L_0=l]\,dF_0^*(l). $$ The conditional counterfactual mean \(m_d(l)=E[Y^d\mid L_0=l]\) is averaged over the target distribution of baseline covariates, not automatically over the distribution in the sample used to fit the models.

The superscript \(*\) marks the target population. When the target is the population represented by the study sample, the asterisk can be omitted. The integral notation covers both continuous and discrete baseline covariates: for discrete \(L_0\), it is a sum over possible baseline values. In longitudinal problems, \(m_d(l)\) is obtained by integrating over the counterfactual covariate and outcome processes under \(d\), or by simulating those processes and averaging their outcomes conditional on the starting value \(l\).

From Conditional Predictions to a Population Mean

The identity above follows from the law of total expectation. It does not require that the outcome be independent of baseline covariates. On the contrary, the conditional mean \(m_d(l)\) can vary substantially with \(l\). The averaging step accounts for how common each baseline profile is in the target population.

Result: If \(Y^d\) is integrable, \(L_0\) is measurable, and the conditional expectation \(E[Y^d\mid L_0]\) is defined, then $$ E[Y^d]=E\{E[Y^d\mid L_0]\}. $$ Consequently, if the target population’s distribution of \(L_0\) is \(F_0^*\), its regime-specific mean is \(\int m_d(l)\,dF_0^*(l)\).

To see the identity, let \(g(L_0)=E[Y^d\mid L_0]\). By the defining property of conditional expectation, for every measurable set \(B\) of baseline values, $$ E\bigl[Y^d\,\mathbf{1}(L_0\in B)\bigr] =E\bigl[g(L_0)\,\mathbf{1}(L_0\in B)\bigr]. $$ Taking \(B\) to be the entire baseline space gives \(E[Y^d]=E[g(L_0)]\), since \(\mathbf{1}(L_0\in B)=1\) almost surely. The expectation of \(g(L_0)\) is its integral with respect to the distribution of \(L_0\). If that distribution is the target distribution \(F_0^*\), the integral is the stated target mean. Integrability ensures these expectations exist. \(\square\)

In practice, \(m_d(l)\) is generally unknown. A fitted parametric g-formula supplies an estimate \(\hat m_d(l)\), often obtained by simulating trajectories under \(d\) from baseline value \(l\). If the target consists of \(N\) observed baseline profiles \(L_{0,1}^*,\ldots,L_{0,N}^*\), the standardization estimate is

$$ \hat\psi_d^* = \frac{1}{N}\sum_{i=1}^{N}\hat m_d(L_{0,i}^*). $$

This is an empirical integral: it replaces \(F_0^*\) by the empirical distribution that places mass \(1/N\) on each target profile. It can be used with the study participants’ baseline values or with a separate sample describing the target population. The choice determines the population to which the estimate refers.

Worked Example: Empirical Averaging Across Baseline Profiles

Suppose baseline risk group \(L_0\) is low or high. Under regime \(d\), fitted trajectory simulations give conditional mean outcomes of 2 for low-risk individuals and 8 for high-risk individuals. A target sample of five people has baseline groups low, low, low, high, and high.

The target sample contains three low-risk profiles and two high-risk profiles, so empirical standardization gives $$ \hat\psi_d^* = \frac{2+2+2+8+8}{5} = \frac{22}{5} = 4.4. $$ Equivalently, the empirical target distribution assigns probability \(3/5\) to low risk and \(2/5\) to high risk, yielding \((3/5)(2)+(2/5)(8)=4.4\).

The value 4.4 is not the conditional prediction for either group. It is the average for this target composition. If the target instead had one low-risk and four high-risk people, the same conditional predictions would give \((1/5)(2)+(4/5)(8)=6.8\). The change is due solely to the baseline distribution being averaged over.

Using a Weighted Target Distribution

Sometimes the available baseline sample does not have the target population’s composition. A target distribution can then be represented by nonnegative weights. For observed profiles \(L_{0,i}\), let \(w_i\) be weights that assign greater influence to profiles more representative of the target. The normalized weighted estimate is

$$ \hat\psi_{d,w} = \frac{\sum_{i=1}^{n}w_i\hat m_d(L_{0,i})} {\sum_{i=1}^{n}w_i}, \qquad \sum_{i=1}^{n}w_i>0. $$

For example, if the source baseline distribution is \(F_0\) and the target distribution is absolutely continuous with respect to it, a density ratio \(r(l)=dF_0^*/dF_0(l)\) satisfies $$ \int h(l)\,dF_0^*(l)=\int h(l)r(l)\,dF_0(l) $$ for integrable \(h\). Thus weights proportional to \(r(L_{0,i})\) reweight source profiles toward the target distribution. In finite samples, normalizing the weights makes their sum one. This is sometimes called a Hájek-style normalized average; it is distinct from using weights to correct treatment assignment.

Result: Suppose \(L_{0,1},\ldots,L_{0,n}\) are independent and identically distributed from \(F_0\), \(r(L_0)\geq 0\), \(0<E_{F_0}[r(L_0)]<\infty\), and \(E_{F_0}[r(L_0)|m_d(L_0)|]<\infty\). If \(r=dF_0^*/dF_0\), then $$ \frac{\sum_{i=1}^n r(L_{0,i})m_d(L_{0,i})} {\sum_{i=1}^n r(L_{0,i})} \xrightarrow{a.s.}\psi_d^*. $$

For the proof, apply the strong law of large numbers to numerator and denominator separately. The stated integrability conditions ensure that both sequences have finite expectations. Therefore, $$ \frac{1}{n}\sum_{i=1}^n r(L_{0,i})m_d(L_{0,i}) \xrightarrow{a.s.} E_{F_0}[r(L_0)m_d(L_0)] $$ and $$ \frac{1}{n}\sum_{i=1}^n r(L_{0,i}) \xrightarrow{a.s.} E_{F_0}[r(L_0)]. $$ Because \(r\) is a density ratio, \(E_{F_0}[r(L_0)]=1\), and the numerator limit is \(\int m_d(l)\,dF_0^*(l)=\psi_d^*\). The denominator limit is nonzero, so the ratio converges almost surely to the ratio of these limits, which is \(\psi_d^*\). \(\square\)

This result concerns averaging the true conditional mean. In an application, \(\hat m_d\) replaces \(m_d\), and the weights may also be estimated. Consistency then additionally requires suitable conditions on estimation of the outcome models and weights. The result does not make a misspecified conditional model correct merely because the baseline weights are appropriate.

Worked Example: Reweighting to a Different Target Mix

Use the conditional means 2 for low risk and 8 for high risk. A source sample has four low-risk and six high-risk people, but the target population is half low risk and half high risk. The source proportions are \(0.4\) and \(0.6\); the target proportions are \(0.5\) and \(0.5\).

The density-ratio weights for the two groups are target proportion divided by source proportion: $$ w_{\text{low}}=\frac{0.5}{0.4}=1.25, \qquad w_{\text{high}}=\frac{0.5}{0.6}=\frac{5}{6}. $$ The weighted source mass in the low group is \(4(1.25)=5\); in the high group it is \(6(5/6)=5\). The total weight is 10, so the normalized target masses are \(5/10=0.5\) in each group.

The weighted estimate is therefore $$ \hat\psi_{d,w} = \frac{4(1.25)(2)+6(5/6)(8)} {4(1.25)+6(5/6)} = \frac{10+40}{10} = 5. $$ Direct standardization to the target proportions gives the same answer: \((0.5)(2)+(0.5)(8)=5\). By contrast, the unweighted source average is \((4(2)+6(8))/10=5.6\), which reflects the source mix rather than the target mix.

Worked Example: Averaging Simulated Outcomes Within Each Baseline Group

Suppose a target population is 70% low risk and 30% high risk. For each of two representative baseline profiles, a simulation procedure generates four outcomes under regime \(d\). The low-risk simulated outcomes are 1, 3, 2, and 2; the high-risk outcomes are 6, 10, 8, and 8.

First average within each baseline group to estimate the conditional means: $$ \hat m_d(\text{low})=\frac{1+3+2+2}{4}=2, \qquad \hat m_d(\text{high})=\frac{6+10+8+8}{4}=8. $$ Then average those conditional estimates using the target proportions: $$ \hat\psi_d^*=(0.70)(2)+(0.30)(8)=1.4+2.4=3.8. $$ Pooling all eight simulated outcomes with equal weight would give \((1+3+2+2+6+10+8+8)/8=5\), which does not estimate the target mean unless the simulation allocation across groups matches the target proportions. The first-stage simulation count within each group is a computational choice; the second-stage baseline weights represent the target population.

Assumptions, Diagnostics, and Alternatives

The averaging identity is a probability identity, but interpreting its estimate causally requires the assumptions that identify the counterfactual mean and the conditions needed for the fitted g-formula. In particular, the treatment regime must be well-defined; consistency and sequential exchangeability must hold for identification; and positivity must support the regime for the relevant histories. The conditional transition and outcome models used to construct \(\hat m_d\) must also be sufficiently well specified, or otherwise consistently estimated. For a target different from the study population, the target baseline distribution must be available or estimable, and the source data must support it: a density ratio cannot recover target profiles that have zero probability in the source population.

Useful checks include comparing target and source baseline summaries before and after weighting, verifying that normalized weights sum to one, and inspecting whether a few profiles dominate the weighted average. Large or highly variable weights can signal poor overlap or an unstable target representation. It is also useful to tabulate the number of target profiles in important baseline strata and to compare fitted predictions across plausible baseline profiles. These checks diagnose aspects of the averaging and support problem; they do not establish sequential exchangeability or verify the conditional models.

Baseline standardization and weighting are two ways to express the same target average when the weighting distribution correctly represents \(F_0^*\). Direct standardization predicts outcomes at target profiles and averages them; baseline reweighting averages source predictions with weights that reconstruct the target mix. Neither should be confused with inverse-probability weighting of treatment histories, which is a different g-method. A further limitation is that baseline averaging changes the population composition, not the definition of the regime or the conditional prediction model. It cannot repair extrapolation in unsupported covariate regions or remove bias from an incorrect outcome model.

Common Mistakes

  • Averaging over the wrong population. Using the estimation sample’s baseline distribution when the estimand names another population changes the target mean. Use target profiles or weights that represent the stated target.
  • Confusing conditional and marginal means. A prediction \(\hat m_d(l)\) is conditional on \(L_0=l\). It becomes a population mean only after averaging over the target distribution.
  • Pooling simulation draws without target weights. The number of draws allocated to each baseline group is not generally its target population share. Average within profiles or strata, then apply target proportions.
  • Assuming weighting fixes every modeling problem. Baseline reweighting addresses the baseline distribution. It does not by itself correct misspecified longitudinal transition or outcome models.
Key takeaway: A regime-specific population mean is the conditional counterfactual mean averaged over the target population’s baseline distribution. The target distribution is part of the estimand, not a cosmetic choice made after simulation.

Check Your Understanding

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

  1. For a binary baseline covariate, the conditional regime-specific means are 3 when \(L_0=0\) and 9 when \(L_0=1\). What is the target mean if the target population has \(P(L_0=1)=0.25\)?
  2. A source sample is 80% in group A and 20% in group B. The target is 50% in each group. What normalized target mass should each group receive after reweighting?
  3. Why can pooling equal numbers of simulated trajectories from two baseline strata give the wrong target mean?
  4. What does a very large baseline density-ratio weight suggest, and what can it not establish?

Solutions. (1) The target mean is \((0.75)(3)+(0.25)(9)=2.25+2.25=4.5\). (2) Each group must receive normalized mass 0.5; weights proportional to target share divided by source share are \(0.5/0.8=0.625\) for A and \(0.5/0.2=2.5\) for B. (3) Equal pooling assigns each stratum mass one-half, regardless of its target prevalence. It is correct only when the target proportions are equal or when the group predictions happen to make the difference irrelevant. (4) It suggests that some source profiles are underrepresented relative to the target and may indicate weak overlap or unstable reweighting. It does not prove causal identification, sequential exchangeability, or correct outcome-model specification.

Clinical Biostats