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.

extract_model(mediation_model, step = NULL)

Arguments

mediation_model

An object of class mediation_model.

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")
#> 
#> Call:
#> lm(formula = .x, data = data)
#> 
#> Coefficients:
#> (Intercept)  condition_c  
#>      5.1580       0.7717  
#>