โ‰ก Contents
Start 0 โ€” Foundations Models I โ€” LM โ†’ GLMM Bayes II โ€” Intuition III โ€” Small Worlds IV โ€” Workflow Decision V โ€” Decision
Interactive Statistics ยท Open Source

Learn Bayesian
thinking,
build models.

Why do new data change my beliefs? What is a prior? How do I specify a hierarchical model in R? This lab answers these questions โ€” interactively, visually, and directly applicable with brms.

ฮผฮฑ ฯƒฮฑ j = 1โ€ฆJ ฮฑj ฮฒ i = 1โ€ฆN ฮผแตข = ฯƒ y
Undergraduate
Graduate / MSc
PhD & Research
Applied Science
Clinical Research

A complete
learning path.

23 interactive tools โ€” from linear models to posterior decision-making. Every tool runs entirely in the browser, with no installation, no data transfer. Copy-ready R code (brms) at every step of the workflow. Integrated glossary to look up unfamiliar terms at any point.

Inspired by McElreath Statistical Rethinking and Kruschke Doing Bayesian Data Analysis. Suitable for undergraduates, graduate students, and researchers alike.

0โ€“I
Statistical Foundations & GLMs
OLS, residuals, maximum likelihood, link functions, conditional distributions, mixed models, ordinal logit, zero-inflation. 7 tools โ€” no Bayesian background required. An ideal entry point and reference for all levels.
II
Bayesian Intuition
What is a prior? How does a posterior emerge? How does MCMC sample? 5 tools build genuine intuition โ€” from the question "why Bayes at all?" through qualitative updating and prior selection to analytical credible interval bands.
III
Small Worlds
"Small Worlds" after McElreath (Statistical Rethinking, Ch. 2): constructing models as simplified, consistent representations of reality. Golem Builder: draw DAGs, identify causal structure (confounders, colliders, d-separation), simulate data, export brms and glmmTMB code โ€” including instrumental variables (multiple IVs), Front Door Criterion (serial & parallel), and effect heterogeneity (moderator W). Data Creator: parametric data generation for all designs and likelihoods, with live model formula preview including random effects and simulation-based power analysis for R.
IV
Bayesian Model Workflow
Kruschke diagrams, brms code generation with prior sliders, prior and posterior predictive checks, and LOO-based model comparison. The full cycle from prior specification to a validated model.
V
Posterior Decision
HDI, ETI, and ROPE: three parallel decision logics. Explore concepts interactively (Decision Lab), then analyze your own draws (Decision Maker). For causal effects: G-Computation Builder generates ready-to-run R code for ATE/ATT/ATU โ€” importable directly from the Golem Builder, with export to the Decision Maker.
How to use this lab
โ‘  Navigate via the color-coded sections in the menu above (0โ€“V) or scroll through the learning path from top to bottom.
โ‘ก Click โ„น Help in each section header for learning objectives, prerequisites, and the recommended order of tools.
โ‘ข Follow the flow arrows โ†’ between sections or jump directly to the tool you need right now.
๐Ÿ“–
Statistical Glossary
165 terms from BTL & MethodsLab โ€” Definition, Formula, Intuition. Category filter (Bayes, Causality, IRT, Reliability โ€ฆ), A-Z navigation & full-text search.
165 Terms 12 Categories Search & A-Z
Look up โ†’
0 โ€” Statistical Foundations
Foundations

Statistical Foundations

Three conceptual entry-point tools โ€” no R, no Bayes. What is regression? How does maximum likelihood work? And why does the linear model not always suffice? An ideal start for anyone building Bayesian intuition from the ground up.
Learning path โ‘  Interactive LM โ†’ โ‘ก Maximum Likelihood โ†’ โ‘ข LM to GLM โ†’ Section I: GLM & GLMM
๐Ÿ“
Regression Residuals OLS no R
Linear Model interactive
Draw data points yourself, fit a line manually โ€” then see the optimal OLS line at the click of a button. What are residuals? Why does OLS minimize RSS? And what does it mean for the scatter around the line to be normally distributed?

Includes conditional normal distributions along the line and a live comparison of your RSS vs. the OLS minimum.
โ›ฐ
Likelihood MLE Log-Likelihood no R
Maximum Likelihood
Likelihood โ‰  probability โ€” this distinction becomes experientially clear here. Slide a distribution over the data and watch when the density at the data point is maximized โ€” that is MLE.

Three stages: one data point โ†’ many data and the likelihood landscape โ†’ three families (Normal, Poisson, Bernoulli) with AIC/BIC comparison.
๐Ÿ”€
GLM Link function AIC no R
LM to GLM
What happens when you apply a linear model to binary, count, or skewed data? Three scenarios show the problem โ€” and how GLMs solve it with the right distribution and link function.

Fair AIC comparison LM vs. GLM, visual link function explanation, direct link to the GLM tools in Section I.
Regression foundations established โ†’ continue with GLM, GLMM, and mixed models
I โ€” From LM to GLMM
Entry (G)LMMs

From LM to GLMM

Four building tools โ€” from probability distributions through conditional distributions and spatial GLM visualisation to mixed models with partial pooling. Recommended after Section 0.
๐Ÿ“Š
Distributions 19 families brms no R
Distribution Lab
19 probability distributions interactively โ€” which distribution fits which data? Adjust parameters, show moments, read off brms parameterisation directly.

Preparation for GLMs and Bayesian models: Normal, Gamma, Beta, Poisson, Binomial, Neg. Binomial, ExGaussian, ZI families and more.
๐Ÿ“Š
GLM Tutorial Ordinal Logit ZIP ยท Hurdle
Conditional Distributions
What does it mean for y|x to be normally distributed? This tool visualizes conditional distributions along a predictor โ€” the core of every GLM. Interactively adjustable parameters show how mean and spread shift.

Covers all major GLM families: Gaussian, Bernoulli, Poisson, Gamma, Ordinal Logit, Zero-Inflated Poisson, and Hurdle models โ€” each with its own dedicated tab.
๐ŸงŠ
GLM 3D Visualization
GLM in 3D
Linear regression in three dimensions: regression surface, residuals, and data points in space. Spatial thinking about regression models with multiple predictors becomes literally visible.
๐Ÿ”—
GLMM Multilevel Tutorial
GLMM interactive
What is partial pooling? Why are mixed models better than separate group analyses? This tool shows the difference between complete pooling, no pooling, and partial pooling visually and interactively.
With this foundation โ†’ build Bayesian intuition
II โ€” Bayesian Intuition
Bayes

Learn to think

Five tools build Bayesian intuition step by step: from qualitative updating through the posterior sampling algorithm to concrete prior selection. No finished model, no statistics software โ€” just understanding.
๐Ÿง 
Simulator 8 scenarios No prior knowledge needed
Bayesian Thinking Simulator
โœ“ No math background needed โœ“ All levels โœ“ Ideal starting point
The best starting point. Eight psychological scenarios make Bayesian updating tangible: What do I believe before the experiment? What do the data say? How does my posterior change? No software, no formulas โ€” just building intuition.
โš–
Frequentist vs. Bayes Posterior Credible Interval no R
Why Bayes?
Concrete and direct: what can a Bayesian posterior do that a p-value cannot? Two acts โ€” frequentist output vs. an interactive posterior with a draggable effect threshold, then experience prior updating live.

For everyone who wants to know: why the credible interval is not a confidence interval โ€” and why that matters.
๐ŸŽ›
Interactive Tutorial 10 distributions CI-Solver
Prior Lab
Before specifying priors in brms, you need to understand what a distribution implies. Ten distributions, interactive parameters, real-time 95%-CrI shading.

CI-Solver: Specify the range in which 95% of your prior beliefs should fall โ€” the tool computes the parameters back. Includes brms syntax and clickable defaults.

GLM Mode: Specify priors on the raw data scale โ€” direct conversion to model scale (logit / log).
โ›ฐ
Interactive Tutorial 3 stages Metropolis-Hastings
MCMC Visualizer
How does the computer find the posterior? An animated hiker explores the posterior landscape โ€” every step, every proposal visible.

Three stages: uni- and bimodal posterior, then 2D for ฮผ and ฯƒ. Especially helpful when convergence problems arise later.
โšก
Interactive Prior ยท Likelihood ยท Posterior
Bayes interactive
Choose a prior, generate data, watch the posterior emerge. How strongly does the prior influence the result? When does the posterior become independent of the prior?

Live visualization of prior, likelihood, and posterior โ€” the core mechanism of Bayesian learning as a direct experience.
Bayesian intuition โ†’ build Small Worlds
III โ€” Small Worlds
Simulation & Causality

Small Worlds

Named after Richard McElreath (Statistical Rethinking, Ch. 2): models are "small worlds" โ€” simplified representations of reality. These tools help build such small worlds: sketch causal structures as DAGs, generate data parametrically, and plan sample sizes โ€” before real data are collected.
๐Ÿ”ฎ
DAG Builder dagitty logic Simulation brms ยท glmmTMB โ†’ G-Comp Builder
Golem Builder
Build DAGs graphically and evaluate them causally: which variables must be controlled (confounders), which must not (colliders), which increase precision? Derive testable implications (d-separation) directly.

Simulation & Code: Quantify relationships (including effect heterogeneity via moderator W), simulate data from the DAG, and copy generated brms and glmmTMB code directly. Automatic detection of instrumental variables (multiple IVs supported) and Front Door Criterion (serial & parallel mediation, Pearl-consistent).

โ†’ G-Comp Builder: Transfer all DAG parameters to the G-Computation Builder at the click of a button โ€” exposure, outcome, adjustment set, and formula are imported automatically, no R code required.
๐Ÿงช
Data generation Between ยท Within ยท Mixed GLM families Power analysis
Data Creator
Parametric data generation for all common designs: between-subjects, within-subjects (repeated measures), and mixed designs โ€” with covariates, cluster structures (random intercepts & slopes), and arbitrary sample sizes.

Supported likelihoods: Gaussian, Student-t, Log-Normal, Gamma, Bernoulli, Beta, Binomial, Poisson, Negative Binomial. Full faux and glmmTMB R code export. Live model formula preview including random effects (within-factors automatically add (1 | id), optional random slope).

Power analysis: Commented simulation-based power block (glmmTMB + car::Anova, Option B: LRT) directly in the generated R code โ€” ready to run in R.
Small Worlds built โ†’ start the Bayesian workflow
IV โ€” Bayesian Model Workflow
Workflow

Build models

Five tools cover the complete Bayesian workflow โ€” from prior specification through code generation to model checking, posterior validation, and model comparison after fitting. Causal DAG structure and data generation: โ†’ Section III โ€” Small Worlds.
โ‘  DESIGN MODEL
โ†’
โ‘ก SPECIFY PRIORS
โ†’
โ‘ข GENERATE CODE
โ†’
โ‘ฃ PRIOR CHECKS
โ†“ fit in R โ†’ Posterior PPC
๐Ÿ“
Kruschke McElreath Tutorial + Tool
Model Architect
Step โ‘ : Build your model visually. Choose likelihood, predictors, and structure โ€” the tool draws the Kruschke diagram in real time and displays McElreath notation. Priors appear as mini distribution curves in the diagram.

With guided walkthrough for beginners โ€” from likelihood selection to a complete hierarchical model.
โš™๏ธ
brms R code Tool
brms Model Builder
Steps โ‘ก + โ‘ข: The complete brms code generator. Configure predictors, set priors (with live slider and distribution curves), set sampling parameters โ€” and copy the ready-to-use R code. Supports distributional models and multilevel structures.

Built-in PPC export: The generated code includes a commented-out block for saving posterior_predict() draws โ€” ready to import into the Posterior Predictive Check app.
๐Ÿ”
Prior Predictive Diagnostics Tool
Prior Predictive Check
Step โ‘ฃ: Before the data flows โ€” simulate what your model predicts a priori. Sensible priors generate realistic predictions. The tool imports the prior configuration directly from the brms Model Builder and visualizes prior predictive distributions.
โ‘ค after fitting in R โ†“ Posterior PPC
โ‘ฅ after PPC โ†’ compare models
โ†“
โ†“
๐Ÿ“Š
Shiny ยท Live real model bayesplot
Posterior Predictive Check
Step โ‘ค: After fitting in R โ€” upload your brms model and check whether it reproduces the data well. Guided tutorial through KDE overlay, summary statistics, error structure, and prediction intervals with automatic evaluation.

Requires: a saved brms object (saveRDS(fit, "model.rds")). Runs as a Shiny app โ€” no local R needed.
๐Ÿ”ญ
LOO-CV elpd ยท PSIS Pareto-k loo_compare()
LOO Lab
Step โ‘ฅ: After PPC โ€” compare your models. Paste loo_compare() output directly from R and get an annotated forest plot, Pareto-k diagnostics, and a traffic-light decision rule.

Concept first: animated LOO walkthrough shows how elpd is built from held-out predictions โ€” no R needed for Stage 1.
Posterior in hand โ†’ now make a decision
V โ€” Posterior Decision
Decision

From posterior to decision

HDI, ETI, and ROPE โ€” turning a posterior into a principled statement. Explore concepts (Decision Lab), analyze your own draws (Decision Maker). For causal effects: Causal Calculator as a guided example, G-Computation Builder for your own analyses โ€” importable directly from the Golem Builder, with export to the Decision Maker.
โ‘ฆ HDI ยท ETI ยท ROPE ยท Decision
โ˜ฝ Golem Builder โ†’ G-Comp โ†’ Decision Maker
โš–๏ธ
Interactive HDI ยท ETI ยท ROPE bayestestR
Decision Lab
What is an HDI โ€” and how does it differ from the equal-tailed interval? Where does the effect lie, and does it fall within the region of practical equivalence (ROPE)?

Three decision logics in parallel: trichotomous traffic-light, full-ROPE proportion, and ETI comparison. Normal, t, and Gamma posteriors. Includes bayestestR code.
๐Ÿ”ฌ
CSV upload real draws bayestestR
Decision Maker
Load your own posterior draws from brms, Stan, or rstanarm โ€” define transformations and derived quantities (Cohen's d, Odds Ratios) directly as formulas. HDI, ETI, and ROPE on real data. APA export for publications.
โš—๏ธ
Guided Example ATE ยท ATT ยท ATU brms
Causal Calculator
A worked example of causal effect estimation via G-Computation (standardization): make confounding visible, correct naive bias, compare ATE / ATT / ATU, visualize counterfactuals.

Guided example โ€” ideal entry point for G-Computation. For your own analyses: โ†’ G-Comp Builder.
๐Ÿ“
R Code Generator marginaleffects ATE ยท ATT ยท ATU โ†’ Decision Maker
G-Comp Builder
Generates ready-to-run R code for G-Computation via marginaleffects โ€” ATE, ATT, and ATU for binary exposures; AME and dose-response curve for metric exposures.

Golem Builder import: DAG structure, exposure, outcome, and adjustment set are transferred at the click of a button โ€” no R code required.

Decision Maker export: Generates CSV export code for MCMC draws for direct import into the Decision Maker.
Which tool for which audience?
Undergraduate
โ†’ Bayesian Thinking Simulator
โ†’ Bayes interactive
โ†’ Prior Lab (CI-Solver)
โ†’ GLM Conditional Distributions
โ†’ GLM 3D Visualization
โ†’ Model Architect (guided)
Graduate / MSc
โ†’ GLMM interactive
โ†’ Prior Lab (GLM Mode)
โ†’ Model Architect (complete)
โ†’ brms Model Builder
โ†’ Prior Predictive Check
โ†’ Decision Lab (HDI/ETI/ROPE)
Research & Applied
โ†’ brms Model Builder (distributional)
โ†’ Posterior PPC (Shiny)
โ†’ LOO Lab (model comparison)
โ†’ Golem Builder + Causal Calculator
โ†’ Decision Maker (APA export)
โ†’ Full workflow โ‘ โ†’โ‘ฆ
Scientific Foundations & Acknowledgments
This lab is inspired by and built upon the pedagogical and methodological approaches of the following researchers.
JKK
John K. Kruschke
The visual model diagrams and the HDI/ROPE decision logic are based on his work Doing Bayesian Data Analysis.
doingbayesiandataanalysis.blogspot.com โ†—
RM
Richard McElreath
Model architecture, causal inference with DAGs, and the Bayesian workflow follow his approach in Statistical Rethinking.
github.com/rmcelreath โ†—
ASK
A. Solomon Kurz
His comprehensive translations of the standard works into brms and tidyverse syntax are an invaluable resource for applied Bayesian modeling.
solomonkurz.netlify.app โ†—
PCB
Paul-Christian Bรผrkner
All code outputs from this lab target compatibility with brms, the R package for Bayesian regression modeling developed by him.
paul-buerkner.github.io/brms โ†—
Help