R/check_assumptions.R
check_assumptions.Rd
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.
check_assumptions(
mediation_model,
tests = c("normality", "heteroscedasticity")
)
An object of class mediation_model
.
A character vector indicating which test to run. Supported test
includes "normality"
, "heteroscedasticity"
, and
"outliers"
Invisibly returns an object of class mediation_model
.
Other assumption checks:
plot_assumptions()
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)
#> X -> Y
#> Warning: Non-normality of residuals detected (p < .001).
#> OK: Error variance appears to be homoscedastic (p = 0.353).
#> X -> M
#> Warning: Non-normality of residuals detected (p < .001).
#> Warning: Heteroscedasticity (non-constant error variance) detected (p = 0.004).
#> X + M -> Y
#> Warning: Non-normality of residuals detected (p < .001).
#> Warning: Heteroscedasticity (non-constant error variance) detected (p < .001).