Decision Maker
Analyse Real Posterior Draws — HDI · ETI · ROPE · Transformations · Derived Quantities
© Dr. Rainer Düsing · Interactive Tools by Claude
CSV Upload brms · Stan · rstanarm bayestestR APA Export
Help
Import Posterior Draws
Drop CSV file here or click
Columns = parameters, rows = draws (e.g. as_draws_df() output)
Available columns (click to copy)
▸ R code: Export draws (brms · G-Computation)
# ── 1 · Standard: parameter draws from brms ───────────────────────────────── # Suitable for linear models (Gaussian family, identity link). library(brms) draws <- as_draws_df(fit) # all parameters as data.frame draws_clean <- dplyr::select(draws, starts_with("b_"), sigma) # relevant columns only — adjust! write.csv(draws_clean, "draws.csv", row.names = FALSE) # Stan: posterior::as_draws_df(fit$draws()) # rstanarm: as.data.frame(fit) # ── 2 · G-Computation draws from brms (ATE) ───────────────────────────────── # Use this option if your model uses a GLM link (logit, log etc.). # Raw β draws are on the link scale — substantively incorrect in that case. # G-Computation draws are always on the response scale (e.g. percentage points). # Note: this code estimates the ATE (entire population) only. # For ATT or ATU: see Causal Calculator → sections 5 & 6. library(marginaleffects) comp <- avg_comparisons(fit_gc, variables = "A") # ATE: entire population comp # Summary: median + 95% CI # posteriordraws() extracts the draw distribution directly from comp: ate_post <- posteriordraws(comp)$draw # ⚠ Do NOT use raw parameter draws (e.g. β_A) if the model uses a GLM link # (logit, log etc.) — these are on the link scale, not the response scale. # G-Computation draws are the correct choice in that case. write.csv( data.frame(draw = ate_post), "ate_draws.csv", row.names = FALSE ) # Then upload here — the column is named "draw".
Define Analysis Variables
Settings
Credible Interval (CrI)
95% — Kruschke's standard, widely used in publications
Display interval (plot)
HDI = shortest interval. Especially informative for skewed posteriors.
Decision rule (ROPE logic)
Kruschke: HDI fully outside → effect; fully inside → null.
First load a CSV and define at least one variable
Background Knowledge
Why Posterior Draws?
Rather than summarising point estimates, the posterior contains full uncertainty. Each draw is a plausible parameter value — from the ensemble, HDI, ROPE, and any conceivable transformation can be computed without a normality assumption.
HDI vs. ETI
The HDI (Highest Density Interval) is the shortest interval containing X% of the mass — ideal for skewed posteriors. The ETI (Equal-Tailed Interval) is quantile-based and invariant under monotone transformations. For symmetric posteriors both are identical.
ROPE & SESOI
The Region of Practical Equivalence (ROPE) defines a region around zero that would be practically meaningless. It corresponds to the Smallest Effect Size of Interest (SESOI). Lakens (2018) recommends: for standardised effects, ROPE = [−0.1, 0.1] as a starting point.
Kruschke Decision
Kruschke's trichotomous logic: if the HDI lies entirely outside the ROPE → effect present. If it lies entirely inside → practically null. Otherwise → withhold judgement. This approach avoids binary p-value logic and quantifies uncertainty explicitly.
Transformations & Link Functions
In models with a log-link (Poisson, Gamma) or logit-link (Binomial), coefficients are not on the original scale. exp(b) yields rate/odds ratios, plogis(b) probabilities. Decisions should always be made on the substantively meaningful scale.
Derived Quantities (Cohen's d)
The advantage of real draws: any quantity can be computed. Cohen's d as b_treatment / sigma propagates uncertainty across both parameters. The resulting HDI is a fully Bayesian credible band for the standardised effect — no delta-method standard errors needed.