From a Longitudinal Trajectory to a Target Quantity
A longitudinal intervention generates a sequence of counterfactual outcomes, not just one endpoint. If the outcome is a repeated health score, a symptom indicator, or a count, a scientific question may concern the total burden over follow-up, the average level across visits, or how the mean outcome changes over time. These are distinct targets: the same simulated trajectories can produce different answers depending on how outcomes and time points are combined.
Let \(t=1,\ldots,K\) index a prespecified set of follow-up times, and let \(g\) denote a treatment regime. Write \(Y_t^g\) for the outcome that would be observed at time \(t\) under regime \(g\). Expectations are over the target population, including baseline characteristics and the covariate and outcome evolution under that regime. Assume the outcomes are integrable, \(E[|Y_t^g|]<\infty\), so their means and the finite sums below are defined.
The vector \((\mu_1(g),\ldots,\mu_K(g))\) is the repeated-time mean profile. It preserves the time pattern, while a cumulative or weighted average compresses that profile to one number. A cumulative sum is meaningful on the outcome's original scale accumulated across visits; the horizon average remains on the scale of one visit. Weights must be chosen for the scientific question, not selected after looking at which contrast appears largest.
Identification and the g-Formula Target
The parametric g-formula estimates these targets by simulating covariate and outcome histories under each regime, then averaging the resulting outcomes. The causal interpretation requires the usual identification conditions: consistency and no interference; sequential exchangeability of treatment assignment given the observed past at each treatment decision; and positivity, meaning that each treatment prescribed by the regime has positive probability for histories in the target population. For estimation with fitted conditional models, those models must also be sufficiently correct for the relevant conditional distributions, and the target-population averaging must represent the desired population.
Under these conditions, the g-formula identifies the distribution of the counterfactual trajectory under \(g\) from the observed-data conditional distributions. The earlier material on sequential integration and forward simulation gives the recursion used to generate that distribution. For the estimands here, the final step is to apply the chosen function to the simulated outcomes and average over individuals or draws. No one-time endpoint is required: each simulated trajectory contributes all \(K\) outcomes to the cumulative or average target.
Worked Example: Cumulative and Average Effects From Time-Specific Means
Suppose outcomes are binary at three visits, with regime-specific marginal probabilities as follows. The dependence between visits can be arbitrary; the expectations below require only the displayed marginal means.
| Regime | \(\mu_1(g)\) | \(\mu_2(g)\) | \(\mu_3(g)\) |
|---|---|---|---|
| \(g_A\) | 0.20 | 0.40 | 0.60 |
| \(g_B\) | 0.30 | 0.35 | 0.40 |
For \(g_A\), the expected cumulative number of positive outcomes is \(0.20+0.40+0.60=1.20\). Its expected per-visit average is \(1.20/3=0.40\). For \(g_B\), these quantities are \(0.30+0.35+0.40=1.05\) and \(1.05/3=0.35\), respectively.
Taking \(g_A-g_B\), the time-specific mean differences are \(-0.10,\ 0.05,\ 0.20\). The cumulative difference is their sum, \(-0.10+0.05+0.20=0.15\) positive outcomes over three visits on average. The per-visit average difference is \(0.15/3=0.05\). The first visit favors \(g_B\), but the later differences outweigh it. Neither the cumulative nor average contrast is the effect at any particular visit.
Why the Summaries Equal Sums of Means
Linearity of expectation gives a direct relationship between time-specific means and the cumulative or average target. Importantly, no independence assumption across visits is needed. The outcomes may be highly correlated, because expectation of a sum depends only on the marginal expectations.
Proof. Since the number of visits is finite and each \(Y_t^g\) is integrable, the sum \(S_K^g\) is integrable. By linearity of expectation, \(E[S_K^g]=E[\sum_{t=1}^K Y_t^g]=\sum_{t=1}^K E[Y_t^g]=\sum_{t=1}^K\mu_t(g)\). Multiplying the sum by the constant \(1/K\) gives the average identity. Subtracting the identity for \(g_B\) from the identity for \(g_A\) gives the contrast formulas. \(\square\)
Worked Example: A Distribution of Complete Trajectories
Under one regime \(g\), suppose the entire three-visit binary trajectory has this distribution:
| Trajectory \((Y_1^g,Y_2^g,Y_3^g)\) | Probability | Cumulative sum |
|---|---|---|
| \((0,1,1)\) | 0.50 | 2 |
| \((1,1,0)\) | 0.30 | 2 |
| \((0,0,1)\) | 0.20 | 1 |
The probabilities are nonnegative and sum to \(0.50+0.30+0.20=1\). The cumulative-sum expectation is \(0.50(2)+0.30(2)+0.20(1)=1.00+0.60+0.20=1.80\). Thus the expected horizon average is \(1.80/3=0.60\).
The time-specific means can also be calculated directly. At visit 1, only the second trajectory has value one, so \(\mu_1(g)=0.30\). At visit 2, the first and second trajectories have value one, so \(\mu_2(g)=0.50+0.30=0.80\). At visit 3, the first and third do, so \(\mu_3(g)=0.50+0.20=0.70\). Their sum is \(0.30+0.80+0.70=1.80\), agreeing with the trajectory calculation. The example makes clear that joint trajectory probabilities are needed to describe the trajectory distribution, but not to obtain the expectation of this additive summary once the time-specific means are known.
Repeated-Time Means and Choice of Weights
A repeated-time mean profile reports \(\mu_t(g)\) at each visit, often alongside the regime contrast at each visit. A scalar summary over visits requires an explicit rule. Equal weights give the ordinary average, while other nonnegative weights can emphasize particular visits or represent a prespecified time-averaging convention. The weights should satisfy \(\sum_t w_t=1\) when the result is intended as an average on the original outcome scale. A weighted contrast is \(\sum_t w_t\{\mu_t(g_A)-\mu_t(g_B)\}\).
Worked Example: A Weighted Repeated-Time Contrast
Consider three visit-specific mean outcomes under two regimes:
| Visit | \(\mu_t(g_A)\) | \(\mu_t(g_B)\) | Difference \(g_A-g_B\) | Weight |
|---|---|---|---|---|
| 1 | 2 | 1 | 1 | 0.50 |
| 2 | 4 | 3 | 1 | 0.30 |
| 3 | 5 | 6 | -1 | 0.20 |
The weights sum to \(0.50+0.30+0.20=1\). The weighted mean under \(g_A\) is \(0.50(2)+0.30(4)+0.20(5)=1.00+1.20+1.00=3.20\). Under \(g_B\), it is \(0.50(1)+0.30(3)+0.20(6)=0.50+0.90+1.20=2.60\). The weighted contrast is therefore \(3.20-2.60=0.60\), equivalently \(0.50(1)+0.30(1)+0.20(-1)=0.60\).
The unweighted cumulative contrast is \(1+1-1=1\), and the equal-weight average contrast is \(1/3\). These are not contradictory estimates: they target different combinations of the visit-specific effects. The negative difference at visit 3 is partly offset by the positive differences at visits 1 and 2; the selected weights determine how much it offsets them.
Simulation, Diagnostics, and Alternatives
In a Monte Carlo g-computation analysis, suppose \(B\) independent trajectories are simulated from the fitted regime-specific model. For each simulated trajectory \(b\), compute \(S_{K,b}^g=\sum_tY_{t,b}^g\), \(M_{K,b}^g=S_{K,b}^g/K\), or the weighted quantity \(\sum_tw_tY_{t,b}^g\). Averaging the relevant quantity across the \(B\) draws estimates its mean under the fitted model. If the simulated quantity has finite variance, the sample average converges in probability to that model-implied expectation as \(B\) grows, by the law of large numbers. This controls simulation error; it does not by itself establish that the fitted models identify or estimate the true causal target.
Proof. Independence gives \(\operatorname{Var}(\bar Q_B)=\operatorname{Var}(Q_1)/B\). For every \(\epsilon>0\), Chebyshev's inequality yields \(P(|\bar Q_B-\psi|>\epsilon)\leq \operatorname{Var}(Q_1)/(B\epsilon^2)\), which tends to zero as \(B\) tends to infinity. This is convergence in probability. \(\square\)
A practical check is to compare estimates from independent simulation batches or increase \(B\): a summary that moves appreciably may have substantial Monte Carlo error. Also verify that every simulated trajectory has the intended follow-up times, that the outcome is coded consistently across visits, and that weights sum to one when a weighted average is claimed. A stable Monte Carlo estimate can still be unreliable if the fitted conditional models or causal assumptions are inadequate; simulation size cannot repair those problems.
The main alternative is to report the whole time-specific mean profile rather than compressing it. That retains timing and can reveal patterns hidden by a scalar summary, but it requires readers to interpret multiple estimates. A single-time contrast is simpler and directly addresses an effect at a prespecified visit, but does not summarize burden across follow-up. A cumulative or weighted summary is useful when an overall burden is the target, yet it can conceal opposing time-specific effects. Unlike a risk at one fixed time, a cumulative sum of binary outcomes counts positive visits and can exceed one; it is not automatically a probability of ever having the outcome.
Common Pitfalls and Scope
- Calling a cumulative sum a risk. If \(Y_t\) is a binary status at each visit, \(\sum_tY_t\) counts positive visits; one person can contribute more than one. A risk is a probability of a specified event, not a generic sum.
- Assuming visits are independent. Correlation across outcomes does not change the sum-of-means identity. It does matter for the distribution and variance of a trajectory summary.
- Leaving weights implicit. Equal and unequal weights answer different questions. State the weights, visit schedule, and outcome scale.
- Interpreting a scalar as the whole pattern. Large effects in opposite directions can cancel. Report time-specific means or contrasts when timing matters.
- Confusing Monte Carlo precision with causal validity. Increasing the number of simulated trajectories reduces simulation noise, not bias from violated assumptions or an inadequate fitted model.
These definitions concern additive summaries and repeated-time means for a specified outcome. They do not by themselves define how to handle competing event types, continuous treatment interventions, or uncertainty from estimating the conditional models. Those questions require additional target definitions or inferential tools. The immediate discipline is to state exactly which outcomes, times, and weights produce the reported number.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- If the time-specific means under a regime are \(0.1, 0.3,\) and \(0.5\), what are the expected cumulative sum and expected per-visit average?
- Does the identity \(E[\sum_tY_t^g]=\sum_tE[Y_t^g]\) require independence across visits? State the relevant condition.
- Two regimes have visit-specific mean differences \(0.2,-0.1,0.1\). Find the cumulative contrast and the equal-weight average contrast.
- For a binary outcome measured at four visits, explain why the cumulative sum is not generally the risk of ever having the outcome.
Solutions. (1) The cumulative mean is \(0.1+0.3+0.5=0.9\); the horizon-average mean is \(0.9/3=0.3\). (2) No independence is needed. It is enough that the finite collection of outcomes is integrable, so linearity of expectation applies. (3) The cumulative contrast is \(0.2-0.1+0.1=0.2\); the equal-weight average contrast is \(0.2/3\). (4) The sum counts positive visits, so a person positive at multiple visits contributes multiple units. The risk of ever having the outcome counts each person at most once and is based on the indicator that at least one visit is positive.