mdt_simple {JSmediation} | R Documentation |
Joint-significance test for simple mediation
Description
Given a data frame, a predictor (IV
), an outcome
(DV
), and a mediator (M
), conducts a joint-significant test
for simple mediation (see Yzerbyt, Muller, Batailler, & Judd, 2018).
Usage
mdt_simple(data, IV, DV, M)
Arguments
data |
A data frame containing the variables to be used in the model. |
IV |
An unquoted numeric variable in the data frame which will be used as independent variable. |
DV |
An unquoted numeric variable in the data frame which will be used as dependent variable. |
M |
An unquoted numeric variable in the data frame which will be used as mediator. |
Details
With simple mediation analysis, one is interested in finding if the
effect of on
goes through a third variable
. The
hypothesis behind this test is that
has an effect on
(
) that has an effect on
(
), meaning that
has an indirect effect on
through
.
The total effect of on
can be described as follows:
with the total effect of
on
,
the direct of
on
, and
the indirect effect of
on
through
(see Models section).
To assess whether the indirect effect is different from the null, one has
to assess the significance against the null for both (the effect of
on
) and
(effect of
on
controlling for the effect of
). Both
and
need to
be simultaneously significant for an indirect effect to be claimed (Cohen &
Cohen, 1983; Yzerbyt, Muller, Batailler, & Judd, 2018).
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 simple mediation model, three models will be fitted:
with , the outcome value for the ith observation,
, the predictor value for the ith observation, and
, the mediator value for the ith observation (Cohen &
Cohen, 1983; Yzerbyt, Muller, Batailler, & Judd, 2018).
Coefficients associated with ,
,
, and
paths
are respectively
,
,
, and
.
Variable coding
Because joint-significance tests uses 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.
To convert a dichotomous categorical variable to a numeric one, please
refer to the build_contrast
function.
References
Cohen, J., & Cohen, P. (1983). Applied multiple regression/correlation analysis for the behavioral sciences (2nd ed). Hillsdale, N.J: L. Erlbaum Associates.
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_moderated()
,
mdt_within()
Examples
## fit a simple mediation model
data(ho_et_al)
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
"Low discrimination",
"High discrimination")
mdt_simple(data = ho_et_al,
IV = condition_c,
DV = hypodescent,
M = linkedfate)