Overview
Observed-variable mediation decomposes an association into direct and indirect components. Moderation tests whether an estimated relationship varies with a continuous moderator.
Theoretical foundation
The simple mediation indirect effect is the product a × b. Moderation augments a linear model with X, W and XW; the conditional X slope is bX + bXW W.
Key equations
c=c^{\prime}+ab\frac{\partial \hat{Y}}{\partial X}=b_X+b_{XW}WAlgorithm and computation
Mediation fits three OLS models to one complete-case sample and obtains a percentile case-resampling bootstrap interval for a × b using a stored seed. At least 80% of requested replicates and at least 100 must be valid. Moderation uses OLS with optional mean centring, conventional or HC3 covariance, and simple slopes at mean ± one sample standard deviation unless levels are supplied.
Required data
Numeric X, M or W, and Y variables with theoretical role ordering; at least 10 complete cases for mediation and 12 for moderation.
Assumptions
Linear-model assumptions apply. Statistical mediation in observational or cross-sectional data is not causal mediation. The interaction must be retained with its lower-order terms.
Available settings
Bootstrap replicate count and seed; confidence level; mean centring; covariance type; optional moderator values.
Worked example
Synthetic example: an X → M → Y model reports a, b, total, direct and bootstrap indirect effects. The result is described as an indirect statistical association, not a causal mechanism.
Limitations and non-claims
No causal-identification analysis, latent mediation, multicategorical templates, BCa bootstrap or Johnson–Neyman region is implemented.
Validation notes
Deterministic bootstrap and interaction results are covered by repository numerical tests. The interface discloses failed bootstrap replicates.
How Surv.lytics computes Mediation
{'bootstrap_samples': 1000, 'confidence': 0.95}How Surv.lytics computes Moderation
{'center': True, 'cov_type': 'HC3'}Was this article helpful?
Your response helps the methodology team improve this documentation.