Model exposure, mediator, and outcome inputs for estimation. See direct contrasts, proportions, and scenario sensitivity. Create clear exports and plots for fast analytical review.
Use a linear mediator model and either an additive outcome model or a log-link interpretation for ratio effects.
This sample shows a simple mediation pattern with one exposure, one mediator, one covariate, and a continuous outcome.
| Observation | Exposure (A) | Mediator (M) | Covariate (C) | Outcome (Y) |
|---|---|---|---|---|
| 1 | 0 | 1.8 | 1.5 | 6.4 |
| 2 | 0 | 2.0 | 2.0 | 6.9 |
| 3 | 0 | 2.1 | 2.3 | 7.1 |
| 4 | 1 | 2.7 | 1.6 | 8.4 |
| 5 | 1 | 2.9 | 2.2 | 8.9 |
| 6 | 1 | 3.0 | 2.4 | 9.4 |
The calculator follows a simple counterfactual mediation setup with one exposure, one mediator, one average covariate profile, and an optional exposure–mediator interaction.
Mediator model: M(a) = α0 + αA·a + αC·C
Outcome model: Y(a, m) = β0 + βA·a + βM·m + βAM·a·m + βC·C
Natural Direct Effect: NDE(a, a*) = Y(a, M(a*)) − Y(a*, M(a*))
Natural Indirect Effect: NIE(a, a*) = Y(a, M(a)) − Y(a, M(a*))
Total Effect: TE(a, a*) = NDE + NIE
On the additive scale, the calculator reports effect differences. On the ratio option, it treats the linear predictor as a log link, then exponentiates the direct, indirect, and total effects into ratios.
The confidence intervals use a simplified delta method with independent standard errors. That approach is practical for screening, but full studies should use covariance matrices or bootstrap intervals.
The natural direct effect captures how the outcome changes when exposure moves from a* to a while the mediator is fixed at the level it would naturally take under the reference exposure.
Interpretation requires no major unmeasured confounding for exposure–outcome, exposure–mediator, and mediator–outcome paths, plus correct model specification and consistent coding of variables.
It measures the outcome change caused by moving exposure from the reference value to the target value while holding the mediator at its natural reference level.
Choose the additive scale when your outcome model is linear and you want direct, indirect, and total effects reported as raw mean differences.
Use the ratio option when your outcome model is interpreted on a log scale, so pathway effects are easier to read as multiplicative changes.
The interaction term allows the mediator effect to depend on exposure. Without it, the mediator contribution is constant across exposure levels.
It is the indirect effect divided by the total effect on the chosen scale. It becomes unstable when the total effect is near zero.
No. They are approximate delta-method intervals using independent standard errors. Publication work should rely on bootstrap methods or full variance-covariance inputs.
Not directly. This version is designed for one mediator and one summarized covariate profile. Multiple mediators need a broader identification strategy.
Unrealistic values often come from mismatched scales, incorrect coefficients, or implausible exposure ranges. Check model units, coding, and the chosen interpretation.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.