Adds the confidence interval for the index of moderated mediation to a model fitted with mdt_moderated.

# S3 method for moderated_mediation
add_index(mediation_model, times = 5000, level = 0.05, stage = NULL, ...)

Arguments

mediation_model

A mediation model of class "moderated_mediation".

times

Number of simulations to use to compute the Monte Carlo indirect effect confidence interval.

level

Alpha threshold to use for the confidence interval.

stage

Moderated indirect effect's stage for which to compute the confidence interval. Can be either 1 (or "first") or 2 (or "second"). To compute total indirect effect moderation index, use "total".

...

Further arguments passed to or from other methods.

Details

Indirect effect moderation index for moderated mediation uses \(a\), \(a \times Mod\), \(b\), and \(b \times Mod\) estimates and their standard errors to compute the appropriate index product distribution using Monte Carlo methods (see Muller, Judd, & Yzerbyt, 2005).

JSmediation supports different types of mediated indirect effect index:

  • Stage 1: computes the product between \(a \times Mod\) and \(b\).

  • Stage 2: computes the product between \(a\) and \(b \times Mod\).

  • Total: computes the sum of Stage 1 and Stage 2 distribution.

References

Muller, D., Judd, C. M., & Yzerbyt, V. Y. (2005). When moderation is mediated and mediation is moderated. Journal of Personality and Social Psychology, 89(6), 852-863. doi: 10.1037/0022-3514.89.6.852

Examples

## getting a stage 1 moderated indirect effect index
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
                                       "Low discrimination",
                                       "High discrimination")
ho_et_al <- standardize_variable(ho_et_al, c(linkedfate, sdo), suffix ="c")
moderated_model <- mdt_moderated(data = ho_et_al,
                                 IV = condition_c,
                                 DV = hypodescent,
                                 M = linkedfate_c,
                                 Mod = sdo_c)
add_index(moderated_model, stage = 1)
#> Test of mediation (moderated mediation)
#> ==============================================
#> 
#> Variables:
#> 
#> - IV: condition_c 
#> - DV: hypodescent 
#> - M: linkedfate_c 
#> - Mod: sdo_c 
#> 
#> Paths:
#> 
#> ========  ==============  =====  =======================
#> Path      Point estimate     SE  APA                    
#> ========  ==============  =====  =======================
#> a                  0.569  0.063  t(820) = 9.01, p < .001
#> a * Mod           -0.268  0.063  t(820) = 4.25, p < .001
#> b                  0.161  0.043  t(818) = 3.75, p < .001
#> b * Mod           -0.066  0.042  t(818) = 1.57, p = .117
#> c                  0.131  0.078  t(820) = 1.67, p = .095
#> c * Mod           -0.037  0.078  t(820) = 0.47, p = .640
#> c'                 0.021  0.082  t(818) = 0.25, p = .800
#> c' * Mod           0.037  0.081  t(818) = 0.46, p = .645
#> ========  ==============  =====  =======================
#> 
#> Indirect effect index:
#> 
#> - type: Mediated moderation index (First stage) 
#> - point estimate: -0.0432 
#> - confidence interval:
#>   - method: Monte Carlo (5000 iterations)
#>   - level: 0.05 
#>   - CI: [-0.0766; -0.017]
#> 
#> Fitted models:
#> 
#> - X * Mod -> Y 
#> - X * Mod -> M 
#> - (X + M) * Mod -> Y