nice_assumptions: Easy assumptions checks

View source: R/nice_assumptions.R

nice_assumptionsR Documentation

Easy assumptions checks

Description

Test linear regression assumptions easily with a nice summary table.

Usage

nice_assumptions(model)

Arguments

model

The lm() object to be passed to the function.

Details

Interpretation: (p) values < .05 imply assumptions are not respected. Diagnostic is how many assumptions are not respected for a given model or variable.

Value

A dataframe, with p-value results for the Shapiro-Wilk, Breusch-Pagan, and Durbin-Watson tests, as well as a diagnostic column reporting how many assumptions are not respected for a given model. Shapiro-Wilk is set to NA if n < 3 or n > 5000.

See Also

Other functions useful in assumption testing: nice_density, nice_normality, nice_qq, nice_varplot, nice_var. Tutorial: https://rempsyc.remi-theriault.com/articles/assumptions

Examples


# Create a regression model (using data available in R by default)
model <- lm(mpg ~ wt * cyl + gear, data = mtcars)
nice_assumptions(model)

# Multiple dependent variables at once
model2 <- lm(qsec ~ disp + drat * carb, mtcars)
my.models <- list(model, model2)
nice_assumptions(my.models)


RemPsyc/rempsyc documentation built on July 2, 2024, 9:41 p.m.