View source: R/nice_assumptions.R
nice_assumptions | R Documentation |
Test linear regression assumptions easily with a nice summary table.
nice_assumptions(model)
model |
The |
Interpretation: (p) values < .05 imply assumptions are not respected. Diagnostic is how many assumptions are not respected for a given model or variable.
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.
Other functions useful in assumption testing:
nice_density
, nice_normality
,
nice_qq
, nice_varplot
,
nice_var
. Tutorial:
https://rempsyc.remi-theriault.com/articles/assumptions
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.