check_assumptions: Test assumptions for models underlying the mediation

View source: R/check_assumptions.R

check_assumptionsR Documentation

Test assumptions for models underlying the mediation

Description

When conducting a joint-significant test, different models are fitted to the data. This function tests assumptions regarding these models using the performance package.

The assumptions test are performed using check_normality, check_heteroscedasticity, and check_outliers.

Note that check_assumptions returns a mediation_model object.

Usage

check_assumptions(
  mediation_model,
  tests = c("normality", "heteroscedasticity")
)

Arguments

mediation_model

An object of class mediation_model.

tests

A character vector indicating which test to run. Supported test includes "normality", "heteroscedasticity", and "outliers"

Value

Invisibly returns an object of class mediation_model.

See Also

Other assumption checks: plot_assumptions()

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)

check_assumptions(my_model)


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