Mediation & Causal Path Analysis Studio

Causal Inference Entered estimates

Estimate, draw, and visualize causal mediation and moderated mediation models. Fit simultaneous path equations from your raw data with live non-parametric bootstrapping, draw custom path diagrams on the interactive canvas, or explore literature estimates and teaching case studies.

👨‍🏫 Professor Mode: Guided Learning Experience

New to mediation analysis? Enable Professor Mode for step-by-step guidance through understanding direct, indirect, and total effects in mediation and moderated mediation models!

OVERVIEW

Mediation analysis examines how a causal effect occurs by testing whether an intermediate variable $M$ transmits the influence of predictor $X$ to outcome $Y$. Moderated mediation tests whether this transmission varies across different levels of a context moderator $W$.

🎯 Three Ways to Work in This Studio:

  • ✏️ Build & Estimate with Data (Interactive Canvas): Upload your CSV dataset or pick practice data, inspect variable scales (continuous vs. multi-category with baseline reference selection), draw your causal path model from a blank canvas, and click Run to fit simultaneous equations and compute 95% bootstrap confidence intervals (1,000–20,000 resamples).
  • 📚 Curated Case Studies: Explore 9 realistic marketing scenarios (ad impressions, pricing & WTP, influencer trust with age moderation, serial email funnel) with pre-calibrated models, interactive sliders, and reporting notes.
  • 📋 Literature & Software Estimates: Bring in regression coefficients ($a, b, c'$) and standard errors from published research or PROCESS/Stata/R output to explore conditional effects, compare Monte Carlo vs. delta-method uncertainty, and generate publication-ready APA reports.
📖 What this tool does
  • Estimates simultaneous path equations directly from raw data via OLS regression and Maximum Likelihood Logistic regression (via IRLS Newton-Raphson for binary outcomes)
  • Supports multi-category predictors ($K \ge 2$) with customizable baseline reference categories ($K-1$ dummy indicators)
  • Runs non-parametric bootstrapping (1,000 to 20,000 resamples) directly in your browser with percentile and BCa confidence limits
  • Offers an interactive Drag & Drop Path Canvas to visually draw arbitrary causal DAGs, parallel mediators, serial chains, and moderated paths
  • Accepts literature coefficients and standard errors for rapid post-estimation visualization and Monte Carlo simulation
  • Generates dynamic direct, indirect, and total effect decompositions, conditional effect plots, and plain-language APA interpretations
📘 Supported Model Types & Architectures

Model A: Single Mediator

$$M = aX$$

$$Y = c'X + bM$$

With optional moderation at a-path, b-path, or direct path (c′) conditional on W

Model B: Parallel Mediators

$$M_1 = a_1 X, \quad M_2 = a_2 X$$

$$Y = c'X + b_1 M_1 + b_2 M_2$$

Multiple simultaneous mediators transmitting independent indirect pathways

Model C: Serial Mediators (PROCESS 6)

$$M_1 = a_1 X, \quad M_2 = a_2 X + d_{21} M_1$$

$$Y = c'X + b_1 M_1 + b_2 M_2$$

Causal chain linking mediators ($X \to M_1 \to M_2 \to Y$) with chained indirect effect $a_1 d_{21} b_2$

Model D: Interactive DAG Path Networks

$$\mathbf{y}_j = \mathbf{X}_j \boldsymbol{\beta}_j + \boldsymbol{\varepsilon}_j$$

Arbitrary directed acyclic graphs drawn on canvas, supporting multi-category dummy coding, moderators, and covariates

DATA SOURCE

📚

Select a Case Study

📤

Do It Yourself (Your Data or Estimates)

Upload one row per case. You need a numeric column for the predictor, one for each mediator and one for the outcome, plus a moderator column if you have switched moderation on. Extra columns are fine — you choose which to use below.

Drag & drop a data file (.csv, .tsv, .txt, .xls, .xlsx)

Headers required, and at least 30 complete rows.

Or practice with a calibrated marketing dataset:

400 subscribers from a fictional outdoor retailer: email frequency, brand awareness, consideration, purchase value, plus age and tenure to try as controls.
No file uploaded.
✏️ Prefer to visually draw your path model?

Use the Interactive Path Canvas to drag variables from a blank slate, connect mediators, and bootstrap simultaneous equations.

INPUTS & SETTINGS

Model Configuration

When enabled, path coefficients become conditional on moderator W.

Path Coefficients

Enter the unstandardized coefficients and standard errors from your analysis output.

a-path (X → M)

a(W) = a₁ = 0.50

b-path (M → Y)

b(W) = b₁ = 0.60

c′-path (X → Y, direct)

c′(W) = c′₁ = 0.30

INTERACTIVE CONTROLS

Standard deviations from the average. 0 is a typical customer, 1 is one standard deviation above average. Load your own data and this switches to your column's real units.

VISUALIZATIONS

X → M Relationship

The orange line is the a-path. The red point is the selected predictor value and its predicted mediator value. See formulas

Predicted M → Y Relationship

The orange line is the b-path. The red point carries the predicted mediator value forward to its indirect contribution to the outcome. See formulas

Structural Diagram

Each node shows the variable name and its role letter. Circles represent continuous variables; squares represent categorical variables. Blue is the direct path; orange is the indirect route through the mediator.

X → Y Effect Decomposition

Blue = Direct, Orange = Indirect, Black = Total. Each line is the predicted outcome contribution at each predictor value. See formulas

Effect Decomposition Summary

Error bars show 95% confidence intervals. Effects computed at current X and W values.

Effect Decomposition at Current Values

Scale:
Direct Effect (c′) —
Indirect Effect (ab) —
Total Effect (c) —

AUDIT THE NUMBERS

Effects used in this visualization

Use this table to check that the values on screen match your original output. The interval column names the method that produced it.

Effect Estimate SE Displayed 95% interval
Select a case study above, draw a path model on the canvas, or enter estimates to view results.

INTERPRETATION

Start Here

Select a case study above, draw a path model on the canvas, or enter estimates to begin.

Professional Post-Estimation Note

Select a case study above, draw a path model on the canvas, or enter estimates to view a reporting note.

Interpretation and Next Checks

Select a case study above, draw a path model on the canvas, or enter estimates to view an interpretation.

TECHNICAL DOCUMENTATION

📐 Model Equations

Single Mediator Model

$$M = a(W) \cdot X$$ $$Y = c'(W) \cdot X + b(W) \cdot M$$

Conditional Path Coefficients (when moderated)

$$a(W) = a_1 + a_3 W$$ $$b(W) = b_1 + b_3 W$$ $$c'(W) = c'_1 + c'_3 W$$

Parallel Mediator Model

$$M_1 = a_1 X, \quad M_2 = a_2 X$$ $$Y = c'X + b_1 M_1 + b_2 M_2$$

Serial Mediator Model (PROCESS 6)

$$M_1 = a_1 X$$ $$M_2 = a_2 X + d_{21} M_1$$ $$Y = c'X + b_1 M_1 + b_2 M_2$$

The chained route is $a_1 d_{21} b_2$. It exists only because you placed $M_1$ before $M_2$; reversing that order produces a different model with the same fit statistics, so the data cannot tell you which ordering is right.

📊 Effect Definitions
Effect Formula Interpretation
Direct Effect $c'(W)$ Effect of X on Y not through M
Indirect Effect $a(W) \times b(W)$ Effect of X on Y transmitted through M
Total Effect $c'(W) + a(W) \times b(W)$ Combined direct + indirect effects

For parallel mediators, total indirect effect = $a_1 b_1 + a_2 b_2$. For serial mediators it is $a_1 b_1 + a_2 b_2 + a_1 d_{21} b_2$.

📈 Uncertainty Approximation

Converting CI to SE

$$SE = \frac{\text{Upper} - \text{Lower}}{2 \times 1.96}$$

Variance of Conditional Path Coefficients

$$\text{Var}(a(W)) = \text{Var}(a_1) + W^2 \cdot \text{Var}(a_3)$$

Similarly for b(W) and c′(W). Independence of coefficients is assumed.

Indirect Effect Variance (Delta Method)

$$SE_{IE(W)} \approx \sqrt{b(W)^2 \cdot \text{Var}(a(W)) + a(W)^2 \cdot \text{Var}(b(W))}$$

Why this is an approximation, and why bootstrap is usually preferred: The indirect effect is a product, $ab$, not a single coefficient. Products of estimates often have an uneven, asymmetric sampling distribution, especially when one path is small. The delta method replaces that curved distribution with a local linear approximation and this visualizer must also assume the path estimates are independent because it does not have their covariance matrix. Bootstrap inference repeatedly resamples the original cases and refits the original model, so its interval can reflect both the asymmetry of $ab$ and how the path estimates move together. For formal inference, report the bootstrap CI from your estimation software.

Total Effect Variance

$$SE_{TE(W)} \approx \sqrt{\text{Var}(c'(W)) + \text{Var}(IE(W))}$$

Propagated Uncertainty in Visualizations

The charts show error bars that propagate uncertainty through the mediation path:

X → M Plot (vertical error): Uncertainty in predicted mediator

$$SE(\hat{M}) = |X| \cdot SE(a)$$

M̂ → Y Plot: Uncertainty propagates through both the a-path and b-path

  • Horizontal error: $SE(\hat{M}) = |X| \cdot SE(a)$
  • Vertical error (delta method): $$SE(\hat{Y}_{via \hat{M}}) = \sqrt{(b \cdot SE(\hat{M}))^2 + (\hat{M} \cdot SE(b))^2}$$

This combines: (1) uncertainty in where M̂ lands, and (2) uncertainty in the b slope.

X → Y Decomposition (vertical errors): Effect uncertainty scaled by X

$$SE(\hat{Y}_{direct}) = |X| \cdot SE(c')$$ $$SE(\hat{Y}_{indirect}) = |X| \cdot SE_{IE}$$ $$SE(\hat{Y}_{total}) = |X| \cdot SE_{TE}$$

⚠️ Important Limitation: The delta-method intervals described above are shown for comparison only. When you upload data the tool reports a bootstrap interval instead, and when you type estimates in it reports a Monte Carlo interval; both handle the skew of a product, which the delta method cannot. The delta column exists so you can see what the symmetry costs.

🔬 What's This? / How Binary Outcome Logistic Mediation Works

When your outcome variable ($Y$) is binary (e.g. 0 vs 1, Churned vs Retained, Purchased vs Not Purchased), standard Ordinary Least Squares (OLS) mediation breaks down mathematically. This tool implements full in-browser Maximum Likelihood Logistic Mediation via Iteratively Reweighted Least Squares (IRLS Newton-Raphson).

1. Why Ordinary Least Squares (OLS) Fails for Binary Outcomes

Fitting a linear probability model ($Y = i_2 + c'X + bM + e$) to a binary outcome creates three fundamental violations:

  • Nonsensical Probabilities: Linear slopes project predictions outside the valid probability domain $[0, 1]$ for extreme values of $X$ and $M$.
  • Severe Heteroscedasticity: The residual variance of a Bernoulli random variable is $p_i(1 - p_i)$, which varies directly with the predictors, violating Gauss-Markov assumptions and invalidating OLS standard errors.
  • Ceiling and Floor Compressions: In real customer behavior, shifting brand awareness from 10% to 20% does not yield the same conversion probability gain as shifting from 50% to 60%. Sigmoidal curves are required.

2. Maximum Likelihood Estimation via IRLS Newton-Raphson

The mediator equation remains linear ($M = i_1 + aX + e_1$), while the outcome equation uses the logistic link function:

$$\text{logit}(P(Y=1)) = \ln\left(\frac{P(Y=1)}{1 - P(Y=1)}\right) = i_2 + c'X + bM$$

The solver uses Newton-Raphson gradient descent with Fisher information weighting ($\mathbf{W} = \text{diag}(p_i(1-p_i))$) until parameter estimates converge:

$$\boldsymbol{\beta}^{(t+1)} = \boldsymbol{\beta}^{(t)} + (\mathbf{X}^T \mathbf{W} \mathbf{X})^{-1} \mathbf{X}^T (\mathbf{y} - \mathbf{p})$$

3. The 4 Reporting Scales (How to Interpret Results)

Because the mediator equation is linear (OLS) and the outcome equation is logistic, effects can be expressed across four complementary metrics:

Scale A: Log-Odds Metric

$$\text{Indirect} = a \times b, \quad \text{Direct} = c', \quad \text{Total} = c' + ab$$

Direct regression coefficients. $ab$ represents the change in log-odds of $Y=1$ transmitted through $M$ per 1-unit increase in $X$.

Scale B: Odds Ratios (OR)

$$\text{OR}_{\text{indirect}} = e^{ab}, \quad \text{OR}_{\text{direct}} = e^{c'}, \quad \text{OR}_{\text{total}} = e^{c' + ab}$$

Multiplicative impact on the odds of $Y=1$. Notice that OR = 1.0 indicates zero effect (no change in odds).

Scale C: MacKinnon Latent Standardization ($Y^*$)

$$\text{Var}(Y^*) = b^2 \text{Var}(M) + (c')^2 \text{Var}(X) + 2bc'\text{Cov}(X,M) + \frac{\pi^2}{3}$$

Because logistic regression sets error variance to $\pi^2/3 \approx 3.29$, dividing by $\text{SD}(Y^*)$ produces standardized latent paths ($b^*, c'^*, ab^*$) directly comparable to OLS path $a$.

Scale D: Probability Scale (ACME / ADE)

$$\text{ACME} = \frac{1}{n} \sum_{i=1}^n \left[ P(Y_i=1 \mid x_i, \hat{M}_{x_i+1}) - P(Y_i=1 \mid x_i, \hat{M}_{x_i}) \right]$$

Average Causal Mediation Effect (Imai et al. 2010): The discrete average percentage-point shift $\Delta P(Y=1)$ across all sample cases.

4. Resample Bootstrapping & Asymmetric Odds Ratio Intervals

Standard Wald confidence intervals assume a symmetric normal distribution. However, Odds Ratios are strictly non-negative and highly right-skewed ($e^{ab}$). The non-parametric bootstrap resamples cases, refits both the OLS and logistic equations on every draw, and cuts percentile and BCa confidence limits directly on empirical distributions.

🔧 Version & Boundaries

Capabilities

  • ✔ Interactive DAG Path Canvas: Draw arbitrary recursive causal graphs from a blank slate
  • ✔ Single, parallel, serial (PROCESS 6), and complex multi-mediator path networks
  • ✔ Multi-category dummy coding ($K \ge 2$) with customizable baseline reference categories ($K-1$ contrast indicators)
  • ✔ Binary outcome (0/1 or two-group) via Maximum Likelihood Logistic Regression (IRLS Newton-Raphson)
  • ✔ 4-scale reporting for logistic mediation: Log-odds, Odds Ratios, MacKinnon Latent Standardization ($Y^*$), and Probability ACME
  • ✔ Non-parametric bootstrap resampling (1,000 to 20,000 resamples) directly on your rows with percentile and BCa intervals
  • ✔ Path midpoint moderators and statistical controls/covariates
  • ✔ Covariance-aware inference (bootstrap mode only)
  • ✔ Monte Carlo intervals from typed literature estimates
  • ✔ Approximate uncertainty via delta method, shown for contrast
  • ✔ Conditional effect plots and simple slopes ($\pm 1$ SD)

Current Boundaries & Scope

  • ✘ Non-recursive models (feedback loops / cycles are blocked by DAG validation)
  • ✘ Count outcomes (Poisson or negative binomial mediation)
  • ✘ Multi-categorical outcomes ($K > 2$ categorical outcomes not supported for OLS path regressions)
  • ✘ Latent variables and full SEM with measurement models
  • ✘ Multilevel or clustered hierarchical data
  • ✘ Missing-data imputation (rows with a missing value in active variables are dropped)

What each mode can and cannot claim. Covariance-aware inference requires the original rows. When you upload data, both equations are refitted on the same resampled cases, so the interval reflects how the a-path and b-path move together. When you type coefficients in, the tool has your standard errors but not their covariances, so the Monte Carlo interval has to treat the paths as independent. It still reproduces the skew of the product, which the delta method cannot, but it is not a substitute for a bootstrap on the data.