extract_model: Extracts a single model from a mediation_model object

View source: R/extract_models.R

extract_modelR 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 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")


cedricbatailler/JSmediation documentation built on March 4, 2024, 12:52 p.m.