Longitudinal and Panel Causal Inference
If you arrived here looking for cross-sectional comparison group methods (formerly grouped under non-experimental methods), see Matching in the preceding part on randomized experiments and observational comparisons.
Many of the most important decisions in business cannot be evaluated with a simple before-and-after contrast or a static A/B test. Marketing organizations launch regional ad campaigns across designated market areas; operations teams roll out warehouse upgrades across fulfillment centers; product teams deploy new features gradually across seller cohorts. In each case, time is an active dimension of the causal question.
When analyzing dynamic interventions, two distinct time scales must be separated:
- Calendar time (\(t\)): Shared by all units simultaneously. Calendar time carries market-wide macroeconomic shocks, seasonal demand swings, platform outages, and competitor actions.
- Time since adoption (\(S\) or exposure time): Unit-specific elapsed duration since treatment began. Exposure time governs how treatment responses evolve: novelty bumps that fade, cumulative improvements that compound, or operational disruptions that resolve.
In a simultaneous intervention (like a regional ad blitz), calendar time and exposure time move in lockstep. In a staggered rollout, different units adopt at different calendar dates, disentangling shared calendar seasonality from unit-level duration effects.
History, Confounding, and Serial Dependence
A common misconception in panel analysis is that having a rich pre-treatment history automatically eliminates confounding. Pre-treatment observations are invaluable: they allow us to model unit-specific baselines, estimate pre-intervention trends, and explain away enormous amounts of idiosyncratic variation.
However, pretreatment history does not automatically remove unobserved or time-varying confounding. If units adopt earlier because of an unmeasured variable that also changes their future trajectory (such as manager enthusiasm or unrecorded customer momentum), conditioning on historical revenue cannot eliminate the resulting selection bias.
It is equally vital to distinguish serial dependence from confounding:
- Serial dependence is an error structure and uncertainty problem: observations from the same unit across consecutive weeks share autocorrelated innovations. Failing to account for serial correlation leads to understated standard errors and overconfident intervals.
- Confounding is an identification problem: systematic differences in potential outcomes between adoption cohorts. A model can have perfectly modeled AR(1) errors and remain hopelessly confounded, or be cleanly identified by randomization while requiring careful serial correlation diagnostics.
Furthermore, Bayesian posterior intervals in these chapters are conditional on the stated structural priors, likelihoods, and identifying assumptions. They provide coherent Bayesian uncertainty under those modeling assumptions, but do not promise automatically calibrated repeated-sampling coverage if the error or assignment model is misspecified.
Roadmap for this Part
The chapters in this part form a structured progression from aggregate macro-interventions to granular, decision-focused panel modeling:
- CausalImpact: Bayesian structural time-series (BSTS) models for aggregate interventions, using contemporaneous control markets and state-space decomposition.
- Bayesian Synthetic Control: Panel-based synthetic control with donor weights, shrinkage, and posterior predictive intervals for comparative case studies.
- LongBet: Dynamic Treatment Effects in Staggered Rollouts: The core LongBet framework, introducing Bayesian causal trees on panel data. A randomized, capacity-constrained rollout, checked against a design-based benchmark, with the effect read three ways: the average, the segments, and every individual seller. (Readers already familiar with Bayesian Causal Forests can jump straight in.)
- LongBet: From Effects to Decisions: Annual dollar valuations, a ranked rollout under a capacity constraint, targeting when effects vary across units, and a joint screen over three outcomes at once through triangular SUR coupling.
- LongBet and Modern Difference-in-Differences: The comparison a reviewer will ask for: two-way fixed effects and its Goodman-Bacon decomposition, Callaway and Sant’Anna, Sun and Abraham, Borusyak-Jaravel-Spiess and interactive fixed effects, run on the same panels as LongBet. Where they agree, where a cohort-by-period average cannot go, what happens when untreated trends diverge with the covariates, and what the difference is worth in a targeting decision.
- LongBet: Forecasting and Observational Panels: Projecting the trajectory past the study window, what the model assumes when adoption was chosen rather than randomized and how much a unit’s level costs to estimate, and covariates that move within a unit over time.
- LongBet: Ordinal Outcomes and Customer Experience: Dynamic effects on ordered ratings, category-probability effects, and the posterior probability of hitting a customer-experience target.
- LongBet: Randomized Encouragement and Adoption Timing: When you can only invite units to adopt, the effect of the offer composes an outcome equation on the adoption clock with an adoption hazard on the offer clock, and the decision is whom to invite.
Reproducing the LongBet chapters
The LongBet chapters fit their models while the book renders, and cache each fit under cache/longbet/ keyed on the engine source, the sampler settings and a digest of the data, so a chapter that reuses an earlier chapter’s panel reuses its fit rather than repeating it:
./render.sh longbet.qmd # one chapter
LONGBET_QUICK=1 ./render.sh # smoke test, tiny sampling budgetsThe engine comes from the image, pinned in the Dockerfile to the longbet commit these chapters were written against: the revision with the conjugate calendar-time block, collapsed unit intercepts and the half-space sign convention described in Wang et al. (2026). To render against a different revision without rebuilding, point LONGBET_REPO at a checkout and the render installs that tree instead. LONGBET_WORKERS controls how many fits run at once; the default of one keeps memory flat on a laptop.
Neighboring Methods and Scope
This part focuses on a selected Bayesian and machine learning toolkit for business decisions. It does not attempt comprehensive coverage of the entire econometric longitudinal literature. Classic two-way fixed effects (TWFE), modern staggered difference-in-differences estimators (Callaway and Sant’Anna 2021; Roth et al. 2023), and event-study regressions provide indispensable benchmarks, and one chapter of this part is devoted to running them side by side with LongBet on the same simulated panels.
Finally, a cautionary note on dynamic complexity: simply adding time-varying covariates to a regression or tree model does not solve treatment-confounder feedback (where past treatments affect future confounders, which in turn affect future treatments). Addressing dynamic feedback requires specialized longitudinal g-methods or structural marginal models, which remain outside the single-adoption framework treated here.