compute_indirect_effect_for {JSmediation} | R Documentation |
Compute the indirect effect index for a specific value of the moderator
Description
When computing a moderated mediation, one assesses whether an indirect
effect changes according a moderator value (Muller et al., 2005).
mdt_moderated
makes it easy to assess moderated mediation, but it does
not allow accessing the indirect effect for a specific moderator values.
compute_indirect_effect_for
fills this gap.
Usage
compute_indirect_effect_for(
mediation_model,
Mod = 0,
times = 5000,
level = 0.05
)
Arguments
mediation_model |
A moderated mediation model fitted with
|
Mod |
The moderator value for which to compute the indirect effect. Must
be a numeric value, defaults to |
times |
Number of simulations to use to compute the Monte Carlo indirect
effect confidence interval. Must be numeric, defaults to |
level |
Alpha threshold to use for the indirect effect's confidence
interval. Defaults to |
Details
The approach used by compute_indirect_effect_for
is similar to the
approach used for simple slope analyses. Specifically, it will fit a new
moderated mediation model, but with a data set with a different variable
coding. Behind the scenes, compute_indirect_effect_for
adjusts the
moderator variable coding, so that the value we want to compute the
indirect effect for is now 0
.
Once done, a new moderated mediation model is applied using the new data
set. Because of the new coding, and because of how one interprets
coefficients in a linear regression, is now the
indirect effect we wanted to compute (see the Models section).
Thanks to the returned values of and
(
and
, see the Models section), it is now
easy to compute
.
compute_indirect_effect_for
uses
the same approach than the add_index
function. A Monte Carlo simulation
is used to compute the indirect effect index (MacKinnon et al., 2004).
Models
In a moderated mediation model, three models are used.
compute_indirect_effect_for
uses the same model specification as
mdt_moderated
:
with , the outcome value for the ith observation,
, the predictor value for the ith observation,
, the moderator value for the ith observation, and
, the mediator value for the ith observation.
Coefficients associated with ,
,
,
,
,
,
, and
, paths are respectively
,
,
,
,
,
,
, and
(see Muller et al., 2005).
References
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
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
# compute an indirect effect index for a specific value in a moderated
# mediation.
data(ho_et_al)
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))
moderated_mediation_model <- mdt_moderated(data = ho_et_al,
DV = hypodescent,
IV = condition_c,
M = linkedfate,
Mod = sdo)
compute_indirect_effect_for(moderated_mediation_model, Mod = 0)