mdt_moderated {JSmediation} | R Documentation |
Fits a moderated mediation model
Description
Given a data frame, a predictor (IV
), an outcome (DV
), a
mediator (M
), and a moderator (Mod
) conducts a joint-significant test
for moderated mediation (see Yzerbyt, Muller, Batailler, & Judd, 2018).You
can learn about moderated mediation in vignette("moderated-mediation")
add_index.moderated_mediation
computes the moderated mediation index.
compute_indirect_effect_for
is used to compute the indirect effect
index for a specific value of the moderator.
Usage
mdt_moderated(data, IV, DV, M, Mod)
Arguments
data |
A data frame containing the variables in the model. |
IV |
An unquoted variable in the data frame which will be used as the independent variable. |
DV |
An unquoted variable in the data frame which will be used as the dependent variable. |
M |
An unquoted variable in the data frame which will be used as the mediator. |
Mod |
An unquoted variable in the data frame which will be used as the moderator. |
Details
With moderated mediation analysis, one tests whether the
indirect effect of on
through
is moderated by
. The hypothesis behind this test is that
has an effect on
(
) which has an effect on
(
), meaning that
has an indirect effect on
through
.
Total moderation of the indirect effect of on
can be
described as follows:
with the total moderation of the indirect effect,
the moderation of the direct effect,
, the
moderation of the indirect effect passing by the moderation of
, and
, the moderation of the indirect effect passing by the
moderation of
(see Models section; Muller et al., 2005).
Either both and
or both
and
need to be simultaneously significant for a moderation of the indirect
effect to be claimed (Muller et al., 2005).
Value
Returns an object of class "mediation_model
".
An object of class "mediation_model
" is a list containing at least
the components:
type |
A character string containing the type of model that has been
conducted (e.g., |
method |
A character string containing the approach that has been
used to conduct the mediation analysis (usually
|
params |
A named list of character strings describing the variables used in the model. |
paths |
A named list containing information on each relevant path of the mediation model. |
indirect_index |
A boolean indicating whether an indirect effect index
has been computed or not. Defaults to |
indirect_index_infos |
(Optional) An object of class
|
js_models |
A list of objects of class |
data |
The original data frame that has been passed through
|
Models
In a moderated mediation model, three models will be used:
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).
Variable coding
Because joint-significance tests use linear models
behind the scenes, variables involved in the model have to be numeric.
mdt_simple
will give an error if non-numeric variables are
specified in the model.
If you need to convert a dichotomous categorical variable to a numeric one,
please refer to the build_contrast
function.
Note that variable coding is especially important in models with multiple
predictors as is the case in the model used to conduct a joint-significance
test of moderated mediation. Muller et al. (2005) recommend using variables
that are either contrast-coded or centered. Using mdt_moderated
with
a DV, a mediator, or a moderator that is neither contrast-coded nor
centered will give a warning message.
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
Yzerbyt, V., Muller, D., Batailler, C., & Judd, C. M. (2018). New recommendations for testing indirect effects in mediational models: The need to report and test component paths. Journal of Personality and Social Psychology, 115(6), 929–943. doi: 10.1037/pspa0000132
See Also
Other mediation models:
mdt_simple()
,
mdt_within()