mdt_simple | R Documentation |
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).
mdt_simple(data, IV, DV, M)
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. |
With simple mediation analysis, one is interested in finding if the effect of X on Y goes through a third variable M. The hypothesis behind this test is that X has an effect on M (a) that has an effect on Y (b), meaning that X has an indirect effect on Y through M.
The total effect of X on Y can be described as follows:
c = c' + ab
with c the total effect of X on Y, c' the direct of X on Y, and ab the indirect effect of X on Y through M (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 a (the effect of X on M) and b (effect of M on Y controlling for the effect of X). Both a and b need to be simultaneously significant for an indirect effect to be claimed (Cohen & Cohen, 1983; Yzerbyt, Muller, Batailler, & Judd, 2018).
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
|
In a simple mediation model, three models will be fitted:
Yi = b_10 + c_11*Xi
Mi = b_20 + a_21*Xi
Yi = b_30 + c'_31*Xi + b_32*Mi
with Yi, the outcome value for the ith observation, Xi, the predictor value for the ith observation, and Mi, the mediator value for the ith observation (Cohen & Cohen, 1983; Yzerbyt, Muller, Batailler, & Judd, 2018).
Coefficients associated with a, b, c, and c' paths are respectively a_21, b_32, c_11, and c'_31.
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.
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
Other mediation models:
mdt_moderated()
,
mdt_within()
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.