Make the inference visible before trusting it
The parametric g-formula simulates outcomes under sustained treatment rules, but its apparent flexibility rests on explicit time order, measured confounding, positivity and a chain of correctly useful models.
Longitudinal data contain evolving treatments, covariates and outcomes. The parametric g-formula models how those variables change, then uses Monte Carlo standardisation to simulate what the study population might experience under specified interventions. It can compare dynamic rules even when confounders are affected by prior treatment, but it does not remove the need for identification assumptions or careful diagnostics.
Frame the claimROUTE 02 · CHAPTERS 4–6
Work the evidenceROUTE 03 · CHAPTERS 7–9
Test transferROUTE 04 · CHAPTERS 10–12
Audit and continue
Open the chapter contents · Visit the Experimental Design root
Chapter contents
01 · Frame the claim
02 · Work the evidence
03 · Test transfer
1. Specify time zero, order and the target population
Align eligibility, treatment opportunities, covariate measurement, censoring and outcome assessment. Within each interval, state whether covariates are measured before treatment. The simulation will reproduce the order encoded by the analyst, so ambiguous same-visit timing can create impossible histories. Define the population over which risks or means will be standardised.
A static strategy may set treatment to one value at every time. A dynamic strategy may assign treatment from current measured history, such as treating when a biomarker crosses a threshold. State thresholds, grace periods, competing events and what happens when a variable is missing. “Treat as needed” is not a reproducible intervention.
Contents · Previous chapter · Experimental Design root · Next chapter
3. Understand the g-formula as longitudinal standardisation
Factor the observed data into models for time-varying covariates, treatment-related processes and outcomes in their temporal order. Under consistency, sequential exchangeability, positivity and suitable model specification, replace the observed treatment mechanism with the chosen intervention and average predicted outcomes over the covariate histories that follow from it.
| Assumption | Needed meaning | Failure signal |
|---|---|---|
| Consistency | Observed treatment matches defined version | Many hidden versions |
| Sequential exchangeability | Measured history controls confounding | Unrecorded decision driver |
| Positivity | Each strategy supported in histories | Rule assigns unseen choices |
Contents · Previous chapter · Experimental Design root · Next chapter
4. Fit models that respect variable type and history
Use appropriate models for binary, continuous, count, categorical and survival variables, including relevant lags, interactions and nonlinearities. The goal is not merely good one-step prediction; small errors can compound across simulated periods. Avoid conditioning on future information. Preserve deterministic relations and structural zeros rather than asking a generic regression to generate impossible values.
Contents · Previous chapter · Experimental Design root · Next chapter
5. Simulate many intervention-specific trajectories
Start from observed baseline covariates, then repeatedly draw each next covariate and outcome from fitted models while setting treatment according to the intervention. A large Monte Carlo sample reduces simulation noise but not model bias. Use reproducible seeds and enough draws that risk contrasts are stable. Keep Monte Carlo error separate from sampling uncertainty, commonly estimated by bootstrap.
| Simulation step | Action | Check |
|---|---|---|
| Baseline | Resample observed covariates | Target population preserved |
| Follow-up | Draw covariates in order | Values remain plausible |
| Intervention | Set treatment by rule | Rule is executable |
Contents · Previous chapter · Experimental Design root · Next chapter
A cohort records monthly blood pressure, medication and renal function. Prior medication changes both later pressure and renal function, which influence future treatment and cardiovascular risk. The team compares always treating, never treating and treating when systolic pressure exceeds 140 mmHg. They fit ordered history models, simulate each rule and estimate five-year risk. The dynamic rule looks best, but simulated natural-course renal values drift above the observed range. Revising nonlinear terms improves reproduction and changes the contrast. The intervention estimate becomes credible only after the natural course is repaired.
Contents · Previous chapter · Experimental Design root · Next chapter
7. Use the natural course as a diagnostic, not a guarantee
Simulate the observed treatment process or an equivalent natural-course scenario and compare predicted outcome, covariate and event distributions with the data over time. Large divergence signals misspecification, coding errors or unsupported extrapolation. Close agreement is reassuring but cannot prove counterfactual models correct; errors may cancel or appear only under the intervention.
| Natural-course check | Compare | Warning |
|---|---|---|
| Outcome risk | Observed versus simulated by time | Growing divergence |
| Covariate distribution | Means, tails and transitions | Impossible drift |
| Treatment pattern | Observed history reproduction | Timing mismatch |
Contents · Previous chapter · Experimental Design root · Next chapter
8. Changed-context transfer check: adaptive school support
A school offers tutoring when recent scores fall below a threshold. Earlier tutoring changes later scores, while scores guide future tutoring and final attainment. The transferable method is to encode the dynamic rule and simulate evolving scores. The changed context adds teacher discretion, peer spillover and term schedules. Those mechanisms must be measured or modelled; a clinical implementation cannot simply be renamed.
Contents · Previous chapter · Experimental Design root · Next chapter
The method does not solve unmeasured confounding, interference, poorly defined treatment or lack of positivity. Dynamic rules may request treatment choices rarely observed for certain histories, forcing extrapolation. Flexible models reduce but do not abolish misspecification. Monte Carlo simulation is computation, not randomisation, and thousands of simulated people do not increase the original information.
Contents · Previous chapter · Experimental Design root · Next chapter
10. Audit interventions, models and simulations together
Publish the target trial, temporal diagram, variable definitions, intervention code, model formulas, diagnostics, random seeds, Monte Carlo size, bootstrap procedure and censoring or competing-event handling. Report natural-course checks and support by relevant history. Repeat analyses with alternative functional forms, thresholds and truncation or restriction to supported strategies.
| Audit layer | Retain | Failure signal |
|---|---|---|
| Intervention | Executable code and thresholds | Narrative only |
| Models | Formulas and diagnostics | Black-box output |
| Simulation | Seed, size and bootstrap | Precision unexplained |
Contents · Previous chapter · Experimental Design root · Next chapter
How does this differ from weighting? It models the full longitudinal data process and standardises simulated outcomes rather than constructing a weighted pseudo-population. Can it estimate dynamic rules? Yes, when rules and support are explicit. Does natural-course fit validate the result? No, but failure is a warning. Why use Monte Carlo? High-dimensional sums or integrals are approximated by simulated trajectories.
Contents · Previous chapter · Experimental Design root · Next chapter
12. The gold standard makes the simulated world inspectable
A credible parametric g-formula analysis defines interventions that could be executed, models variables in their real time order, checks the simulated natural course and exposes where strategies rely on sparse data. The gold standard reports Monte Carlo and sampling uncertainty without mistaking either for identification. Its result is a transparent population-standardised contrast under stated assumptions, not a synthetic trial created from nothing.
Contents · Previous chapter · Experimental Design root · Return to Experimental Design
Continue through verified routes
Core route
- Experimental Design: subject root and specialist index
- The Gold Standard of Education: learning transfers into life
- The Gold Standard: eduKate Singapore
- How X Works: systems and first-principles hub
Specialist route
- Marginal structural models, time-varying confounding and treatment–confounder feedback
- Cloning–censoring–weighting, dynamic adherence strategies and per-protocol effects
- Sequential multiple-assignment trials, embedded regimes and dynamic treatment rules
- Micro-randomised trials, proximal outcomes and time-varying treatment effects
- Treatment switching, inverse-probability weighting and hypothetical estimands
