- Introduced by
- Frederick N. Kerlinger (ex post facto framework); Bayesian extension draws on Laplace and modern Bayesian statistics
- Year
- 1964 (Kerlinger ex post facto); Bayesian integration from 1990s–2000s onward
- Type
- Quantitative observational research design with Bayesian inference
- Family
- Survey / observational design
What does it do?
Bayesian ex post facto design examines associations among variables that have already occurred, without the researcher manipulating them.
The researcher compares groups that differ on a presumed cause or an outcome as they naturally exist, and quantifies uncertainty with Bayesian inference. Prior knowledge and observed data are combined through Bayes' theorem to estimate effect sizes, group differences, or predictors as posterior distributions. Causal interpretation remains tentative and depends on untestable assumptions about confounding.
The intuition behind the method
Suppose you want to understand why some students leave university while others persist, but you cannot randomly assign students to income or preparation levels. An ex post facto study selects groups after the outcome has occurred and looks backward at candidate causes, such as family income, academic preparation, or institutional support. The Bayesian layer means that prior research is incorporated explicitly and the result is a full posterior distribution over possible effect sizes, rather than only a significance verdict. A conclusion can then take the form of a probability statement, for example that a gap between income groups is very likely to exceed a size that matters in practice, which is more informative than a binary reject or fail-to-reject decision. Such statements describe the model's uncertainty, not the strength of causal evidence, which the non-experimental design still limits.
History
Ex post facto research was systematised by Frederick N. Kerlinger, whose Foundations of Behavioral Research (second edition, 1973) describes investigation in which the researcher examines variables that have already occurred rather than introducing treatments. The design became widely used in education, psychology, and the social sciences for studying naturally occurring group differences. Bayesian reasoning traces to Thomas Bayes' 1763 essay and was formalised by Pierre-Simon Laplace; computation became practical for applied models from the 1990s onward as MCMC methods developed. The combined label, Bayesian ex post facto or Bayesian causal-comparative design, is descriptive and has no single originator.
When to use it
Choose Bayesian ex post facto design when (1) random assignment is impossible or unethical, so the independent variable is a pre-existing characteristic such as gender, socioeconomic status, diagnosis, or educational background; (2) prior research can be incorporated quantitatively and you want that knowledge used rather than ignored; (3) the sample is small or moderate and justified priors can help stabilise estimates where frequentist power is limited; and (4) probability statements and credible intervals about effect sizes will serve stakeholders better than p-values. Do not use it when a randomised experiment is feasible and can isolate the effect, because causal claims from an ex post facto design remain tentative whatever the statistical framework. Nor should it be used when no credible prior information exists and the Bayesian machinery adds complexity without interpretive gain.
Limitations and considerations
- Causal inference is inherently limited because variables were not randomly assigned; unmeasured confounders remain a threat to validity regardless of the Bayesian framework.
- Selection on the outcome and regression to the mean can bias group comparisons, especially when groups are defined by an extreme outcome or prior score; Bayesian priors do not remove these biases.
- Prior specification requires justification; poorly chosen or undisclosed priors can silently bias posterior estimates, especially with small samples.
- MCMC-based Bayesian analysis is computationally demanding and requires familiarity with probabilistic programming tools such as Stan, JAGS, or brms.
- Results such as credible intervals and posterior distributions can be unfamiliar to audiences trained only in frequentist statistics, increasing the communication burden.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Allows prior research to enter the analysis through explicit prior distributions, so earlier findings can inform current estimates rather than being set aside.
- Yields posterior distributions over effect sizes instead of a reject or fail-to-reject decision, so the magnitude of an effect and its uncertainty are reported together.
- Can give more stable estimates than purely data-driven analysis when the sample is small or moderate and the priors are justified; with weak priors this advantage is reduced.
- Credible intervals carry a direct probabilistic reading (given the model and prior, the parameter lies in the interval with the stated probability), which is often easier to communicate than frequentist confidence intervals.
- Sensitivity analyses across priors make hidden assumptions explicit and testable.
Applications
- Comparing academic achievement outcomes between students who attended different types of schools (public vs. private, urban vs. rural) using archival records.
- Investigating the relationship between socioeconomic background and health outcomes in large administrative datasets where assignment to income groups is not experimentally controlled.
- Examining whether prior professional development exposure predicts teacher effectiveness ratings, using existing personnel and evaluation records.
- Studying differences in recidivism rates between offenders who received different sentencing outcomes in historical court records.
- Analyzing whether childhood nutrition status (recorded in pediatric databases) predicts later cognitive performance, with Bayesian credible intervals for effect magnitude.
- Retrospective educational psychology studies comparing motivational profiles of high- and low-achieving students using existing survey instruments.
How it works
How it works
State the research question and the presumed relationship, and decide which variable is the group-defining characteristic (the independent variable, for example parental education level) and which is the outcome (for example academic achievement). Because the variables have already occurred, the researcher cannot manipulate them; existing group membership is the basis of comparison.
Specify prior distributions for the parameters of interest, such as group mean differences, regression coefficients, or odds ratios, using earlier studies, expert knowledge, or weakly informative defaults where prior evidence is thin. Record the priors and their justification, and plan sensitivity analyses with alternative reasonable priors to check how robust the conclusions are.
Formula
p(\theta)
Assemble existing data from archival records, administrative databases, surveys, or secondary datasets. Because assignment was not randomised, potential confounders must be identified before analysis. A causal diagram can guide which covariates to adjust for. Address confounding through design choices such as matching or stratification, or through statistical adjustment such as covariate control or propensity score methods. These approaches only address measured confounders, and propensity-based methods require adequate overlap between the groups on those covariates. Unmeasured confounding remains.
Define the likelihood, which links the observed data to the parameters: for example, a normal likelihood for continuous outcomes, a Bernoulli or binomial likelihood for binary outcomes, or a Poisson likelihood for counts. It expresses how probable the observed data are under different parameter values.
Formula
p(x \mid \theta)
Combine prior and likelihood via Bayes' theorem: p(θ | x) ∝ p(x | θ) p(θ). For most applied models the posterior is approximated with Markov chain Monte Carlo (MCMC) samplers such as JAGS or Stan; conjugate models allow analytic solutions. The posterior summarises the updated uncertainty about the parameters given the data, and sampler convergence should be checked before the results are interpreted.
Formula
p(\theta \mid x) \propto p(x \mid \theta)\, p(\theta)
Summarise the posterior with means or medians and credible intervals (for example 95% highest-density intervals) for effect sizes. Compute the probability that an effect exceeds a practically meaningful threshold. Posterior predictive checks assess how well the model fits the data but do not by themselves rank models. Bayes factors can compare models, but they depend strongly on the prior specification, so report them together with prior sensitivity analyses rather than as the sole basis for model choice. Report the full uncertainty and discuss how the non-experimental design limits what the estimates can support.
Common pitfalls
- Treating posterior probability as proof of causation — Bayesian inference quantifies uncertainty within the model but cannot eliminate confounding from a non-experimental design; causal language should remain hedged.
- Using flat or uninformative priors by default when substantial prior evidence exists, thereby discarding useful information and reducing one of the main advantages of the Bayesian approach.
- Failing to run sensitivity analyses — if substantive conclusions change dramatically under different reasonable priors, the findings are prior-dependent and that fragility must be reported.
- Ignoring convergence diagnostics (R-hat statistics, trace plots) for MCMC samplers; non-converged chains produce unreliable posteriors that can appear numerically plausible.
- Selecting groups post-hoc on both the outcome and the presumed cause without acknowledging survivorship or selection bias in the existing dataset.
Frequently asked questions
Is Bayesian ex post facto design the same as causal-comparative research?
They overlap closely. Causal-comparative research, a term common in education research, and ex post facto design both study pre-existing group differences without manipulation, and the terms are often used interchangeably. The Bayesian label specifies the analytic framework: instead of relying mainly on t-tests, ANOVA, and p-values, the researcher specifies prior distributions and interprets posterior distributions. Bayesian ex post facto design is therefore causal-comparative research analysed with Bayesian methods.
Can I claim causation from a Bayesian ex post facto study?
No. The Bayesian framework improves uncertainty quantification but does not resolve the fundamental limitation of the ex post facto design: because the independent variable was not randomly assigned, unmeasured confounders may explain the observed differences. Strong causal language is not warranted. Instead, language such as 'groups differed' or 'the variable was associated with the outcome' is appropriate, with the posterior probability quantifying uncertainty about that association within the model.
What software is typically used for Bayesian ex post facto analysis?
Examples of commonly used tools include Stan (through the RStan or CmdStan interfaces), JAGS (through rjags), and the brms package in R, which provides a formula interface to Stan. Python users can use PyMC. For simple models with conjugate priors, closed-form posteriors can be computed without MCMC. JASP, a free GUI-based program, also supports Bayesian t-tests and ANOVAs suitable for two-group comparisons. Kruschke's (2015) textbook offers an introduction to Bayesian analysis with R, JAGS, and Stan.
How do I choose priors when I have little prior literature to draw on?
When prior evidence is sparse, weakly informative priors are generally preferred to completely flat (improper) priors. A weakly informative prior encodes broad domain knowledge, such as that extreme standardised effects are implausible, without pulling estimates strongly toward a specific value. Documentation for Stan and brms discusses such defaults. Always report which priors were used and run sensitivity checks with alternative reasonable priors.
How large a sample do I need for Bayesian ex post facto research?
There is no fixed minimum sample size. Bayesian methods can perform better than frequentist approaches with small samples when informative priors are available, because prior information supplements the data. With very small samples and vague priors, estimates will be highly uncertain, and wide credible intervals are the honest result. Posterior predictive checks and prior sensitivity analyses help assess whether the sample is informative enough to update beliefs meaningfully.
Related methods
Sources
Kerlinger, F. N. (1973). Foundations of Behavioral Research (2nd ed.). Holt, Rinehart and Winston.
Open publication referenceKruschke, J. K. (2015). Doing Bayesian Data Analysis: A Tutorial with R, JAGS, and Stan (2nd ed.). Academic Press.
ISBN: 978-0124058880