What a Fixed-Time Risk Measures
A regime-specific risk answers a focused question: under a specified treatment regime, what proportion of the target population would experience the event by a chosen follow-up time? The time point matters. A risk by the end of year one and a risk by the end of year three are different estimands, even when they are calculated from the same longitudinal model.
Here, \(A_k\) is treatment at time \(k\), \(L_k\) is the covariate history available for treatment decisions, and \(D_{k+1}\) indicates an event in the interval after time \(k\). Let \(g\) denote a treatment regime that specifies treatment at each time as a function of the history. The event is absorbing: after it occurs, the individual is no longer at risk of a first event. For a fixed horizon \(t\), define \(Y_t^g\) to indicate whether the event has occurred by that horizon under regime \(g\).
The parametric g-formula estimates this risk by simulating covariate and event histories under \(g\), then averaging the resulting event indicators. The earlier material on the longitudinal g-formula gives the identification argument and the factorization that support this calculation. In brief, interpretation as a causal risk relies on consistency, sequential exchangeability, positivity for the histories generated under the regime, and correctly specified conditional models (or suitable alternatives that yield valid estimates). Simulation itself does not establish these assumptions.
From a Regime to an Estimated Risk
Suppose the follow-up consists of \(K\) intervals, and the requested horizon \(t\) is no later than \(K\). A fitted parametric g-formula uses models for covariate evolution and the event process. For each target individual, it preserves the observed baseline covariates, assigns treatment according to \(g\), and generates later covariates and event outcomes in their time order. It records \(Y_t^g\), not merely the event status in the final interval.
Let \(X_i\) be the baseline covariates for target individual \(i\), and let \(\hat\theta\) collect the fitted model parameters. With \(M\) simulated histories per individual, the direct estimator is
The simulated event indicator is one if any event occurred by \(t\), and zero otherwise. Thus a participant who has an event in an early interval contributes one at every later horizon in that same simulated history. Participants without an event by \(t\) contribute zero. The averaging is over both target individuals and simulated histories; it does not mean that each simulated history is a new study participant.
Use the baseline covariates of the target sample and specify the follow-up time \(t\) at which risk is wanted.
At each treatment time, set treatment to the value specified by \(g\), using the relevant simulated history if the regime is dynamic.
Use the fitted conditional models in temporal order, stopping event generation after a first event when the outcome is first-event incidence.
For each history, record whether an event has occurred by \(t\); average the indicators over simulations and target individuals.
Why Averaging the Indicators Targets Risk
The key operation is marginalization over the histories that would arise under the regime. Let \(H_t^g\) denote the covariate history generated under \(g\) up to the fixed horizon. Conditional on that history, the event indicator has a conditional probability \(P(Y_t^g=1\mid H_t^g)\). The law of total expectation gives the following identity.
To verify the identity, write the indicator as a random variable and condition on the history. Since \(Y_t^g\) is binary, its conditional expectation is its conditional probability of equaling one. Therefore
The outer expectation averages over the regime-specific distribution of histories. Averaging event probabilities over the observed histories instead would generally use the wrong distribution when treatment changes covariate evolution. This is why the simulation must generate covariates under the regime, rather than simply predict outcomes for each person's observed covariates.
For a finite target sample, a second useful fact concerns simulation error. Hold the baseline covariates and fitted parameters fixed, and suppose the \(M\) histories generated for each individual are independent draws from the fitted model under \(g\). Then the simulation average converges to the fitted model's empirical-target risk as \(M\) grows. In detail, define \(q_i=P_{\hat\theta}(Y_{it}^g=1\mid X_i)\). Each \(Y_{it}^{g,(m)}\) is a Bernoulli variable with mean \(q_i\), so the strong law of large numbers gives \(M^{-1}\sum_m Y_{it}^{g,(m)}\xrightarrow{a.s.}q_i\). Since \(n\) is fixed and finite, averaging those \(n\) convergent quantities gives
This is a statement about Monte Carlo approximation conditional on the fitted models and target sample. It does not establish that the fitted empirical-target risk equals the true population causal risk.
Worked Calculations
Worked Example: A One-Interval Risk in a Target Population
Suppose the target population has two baseline groups, \(X=0\) for 60% of individuals and \(X=1\) for 40%. Under regime \(g\), the fitted probability of an event by the one-interval horizon is 0.10 for \(X=0\) and 0.25 for \(X=1\). Find the model-implied risk.
For a randomly selected target individual, the group is \(X=0\) with probability 0.60 and \(X=1\) with probability 0.40. By conditioning on the baseline group,
The estimated risk is 0.16, or 16%. This is a marginal risk: neither subgroup's conditional event probability alone equals the target-population risk. The answer also depends on the target population's 60%/40% composition.
Worked Example: Combining Event Risk Across Two Intervals
Under a fixed regime, suppose the probability of an event in the first interval is 0.10. If no first-interval event occurs, the regime generates \(L_1=1\) with probability 0.30. In the second interval, the event probability is 0.20 when \(L_1=0\) and 0.50 when \(L_1=1\). Find the risk by the end of the second interval.
First calculate the second-interval event probability among those with no first-interval event. Averaging over the regime-specific distribution of \(L_1\) gives
The event can occur in the first interval, or it can occur in the second interval after no first-interval event. These cases are disjoint, so
The risk by the end of interval two is 0.361, or 36.1%. The calculation uses the distribution of \(L_1\) among those who had no first-interval event, as specified in the example. In a full longitudinal simulation, event and covariate histories are generated jointly in the appropriate order.
Worked Example: Averaging Simulated Event Indicators
For four target individuals, suppose one simulated history per individual under the same regime gives event-by-horizon indicators \(0,1,0,1\). Compute the direct simulation estimate and interpret it.
The four indicators sum to \(0+1+0+1=2\). With \(n=4\) and \(M=1\),
This simulation estimate is 50%. It is not necessarily the fitted model's exact empirical-target risk: it is one Monte Carlo realization. Suppose the fitted probabilities for these same four baseline individuals, averaged over all possible histories, are \(0.20, 0.40, 0.30, 0.50\). Their mean is
Thus the model-implied empirical-target risk is 0.35, while the one-draw simulation estimate is 0.50. These values need not match because a small number of Bernoulli draws can vary substantially. Increasing the number of simulations makes the indicator average approach 0.35, conditional on the fitted models and these four target individuals.
Conditional Probabilities, Diagnostics, and Limitations
When available, the conditional-probability version of the estimator replaces a final Bernoulli event draw with its fitted probability, while still averaging over simulated covariate histories. For a generated history \(H_{it}^{g,(m)}\), let \(q_{it}^{(m)}=P_{\hat\theta}(Y_t^g=1\mid H_{it}^{g,(m)},X_i)\). Averaging \(q_{it}^{(m)}\) instead of \(Y_{it}^{g,(m)}\) has the same conditional expectation, by the identity proved above, but removes variation from the final event draw. It does not remove variation from simulated covariate histories, model fitting, or a mismatch between the model and the data-generating process.
A fixed-time risk is often easier to interpret than a collection of interval-specific conditional probabilities: it answers directly how many people out of a target population would have experienced an event by a stated time under the regime. But the estimate can be unreliable if the fitted event or covariate models are poor, if the regime leads to histories with little data support, or if the simulation implementation fails to follow the intended time ordering.
Useful checks include confirming that the requested horizon is measured from the correct time origin; checking that event indicators are absorbing after a first event; and comparing simulated covariate and event frequencies with predictions from the fitted models. Inspect whether simulated histories under the regime contain implausible values or combinations. A simulated estimate outside \([0,1]\) is impossible for a risk and signals a calculation error. Large changes across independent simulation runs may indicate that \(M\) is too small, while stability across runs does not rule out model misspecification or violations of causal assumptions.
When analytic integration is manageable, integrating the fitted conditional probabilities can avoid some simulation noise. Forward simulation is useful when the longitudinal history is too complex for convenient integration, and it naturally accommodates treatment-confounder feedback. Neither approach automatically fixes incorrect models or unsupported regimes. Also, a risk at one fixed time is only one summary: it does not display how risk evolves at other times. The interpretation must name the horizon and regime, and should not be generalized to unreported follow-up times without further calculation.
Common Mistake
Wrong reasoning: “The event probability in the last interval is 0.20, so the risk by the end of follow-up is 20%.” This ignores events that occurred in earlier intervals and can also ignore that only those still event-free can experience a first event later.
Correction: Construct the indicator of any event by the specified horizon for each simulated history, then average those indicators. In the two-interval example above, the second-interval conditional probability was 0.29, but the risk by the end of interval two was 0.361 because 10% had already experienced an event in the first interval.
Check Your Understanding
Answer each question, then compare with the short solutions below.
- In one sentence, define \(\psi_g(t)\).
- Under a regime, two baseline groups have proportions 0.25 and 0.75, with event-by-horizon probabilities 0.40 and 0.12. What is the marginal risk?
- Why does averaging event probabilities over observed covariate histories generally fail to estimate the risk under a regime?
- For a first-event outcome, what should the simulated event-by-horizon indicator be if an event occurs in the first interval?
- What does increasing the number of simulations establish, and what does it not establish?
Solutions. (1) \(\psi_g(t)\) is the probability of having experienced the event by time \(t\) under regime \(g\). (2) \(0.25(0.40)+0.75(0.12)=0.10+0.09=0.19\), or 19%. (3) The observed histories may follow a different covariate distribution than histories generated under the regime. (4) It is one at that horizon and remains one at later horizons in the same history. (5) It reduces Monte Carlo error toward the fitted model's empirical-target risk; it does not establish correct models, causal assumptions, or population-level validity.