extract_model {JSmediation} | R Documentation |
Extracts a single model from a mediation_model object
Description
When conducting a joint-significant test, different models are
fitted to the data. This function helps you access the models used in an
object of class mediation_model
.
Usage
extract_model(mediation_model, step = NULL)
Arguments
mediation_model |
An object of class |
step |
An integer or a string corresponding to the model to extract. |
Value
An lm
object.
See Also
extract_models
to access a list of every model
relevant to joint-significance testing.
Other extract functions:
extract_models()
,
extract_tidy_models()
Examples
data(ho_et_al)
ho_et_al$condition_c <- build_contrast(ho_et_al$condition,
"Low discrimination",
"High discrimination")
my_model <-
mdt_simple(data = ho_et_al,
IV = condition_c,
DV = hypodescent,
M = linkedfate)
extract_model(my_model, step = "X -> M")
[Package JSmediation version 0.2.2 Index]