Adds confidence interval for the index of mediation to a model
fitted with mdt_simple
.
# S3 method for simple_mediation
add_index(mediation_model, times = 5000, level = 0.05, ...)
A mediation model of class "simple_mediation"
.
Number of simulations to use to compute the Monte Carlo indirect effect confidence interval.
Alpha threshold to use for the confidence interval.
Further arguments passed to or from other methods.
Indirect effect index for simple mediation uses \(a\) and \(b\) estimates and their standard errors to compute the \(ab\) product distribution using Monte Carlo methods (see MacKinnon, Lockwood, & Williams, 2004).
MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence Limits for the Indirect Effect: Distribution of the Product and Resampling Methods. Multivariate Behavioral Research, 39(1), 99-128. doi: 10.1207/s15327906mbr3901_4
## getting an indirect effect index
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
"Low discrimination",
"High discrimination")
simple_model <- mdt_simple(data = ho_et_al,
IV = condition_c,
DV = hypodescent,
M = linkedfate)
add_index(simple_model)
#> Test of mediation (simple mediation)
#> ==============================================
#>
#> Variables:
#>
#> - IV: condition_c
#> - DV: hypodescent
#> - M: linkedfate
#>
#> Paths:
#>
#> ==== ============== ===== =======================
#> Path Point estimate SE APA
#> ==== ============== ===== =======================
#> a 0.772 0.085 t(822) = 9.10, p < .001
#> b 0.187 0.033 t(821) = 5.75, p < .001
#> c 0.171 0.081 t(822) = 2.13, p = .034
#> c' 0.027 0.083 t(821) = 0.33, p = .742
#> ==== ============== ===== =======================
#>
#> Indirect effect index:
#>
#> - type: Indirect effect
#> - point estimate: 0.144
#> - confidence interval:
#> - method: Monte Carlo (5000 iterations)
#> - level: 0.05
#> - CI: [0.0896; 0.208]
#>
#> Fitted models:
#>
#> - X -> Y
#> - X -> M
#> - X + M -> Y