library(performance)
library(see)
library(ggplot2)
model <- lm(mpg ~ wt * cyl + gear, data = mtcars)
check_model(model)library(rempsyc)
##View(nice_assumptions(model))
nice_table(nice_assumptions(model), col.format.p = 2:4)Model | Normality (Shapiro-Wilk) | Homoscedasticity (Breusch-Pagan) | Autocorrelation of residuals (Durbin-Watson) | Diagnostic |
|---|---|---|---|---|
mpg ~ wt * cyl + gear | .615 | .054 | .525 | 0.00 |
# Define our dependent variables
DV <- names(mtcars[-1])
# Make list of all formulas
formulas <- paste(DV, "~ mpg")
# Make list of all models
models.list <- lapply(X = formulas, FUN = lm, data = mtcars)
# Make diagnostic table
assumptions.table <- nice_assumptions(models.list)
nice_table(assumptions.table, col.format.p = 2:4)Model | Normality (Shapiro-Wilk) | Homoscedasticity (Breusch-Pagan) | Autocorrelation of residuals (Durbin-Watson) | Diagnostic |
|---|---|---|---|---|
cyl ~ mpg | .361 | .282 | .460 | 0.00 |
disp ~ mpg | .506 | .831 | .077 | 0.00 |
hp ~ mpg | .004 | .351 | .198 | 1.00 |
drat ~ mpg | .939 | .887 | .505 | 0.00 |
wt ~ mpg | .020 | .270 | .002 | 2.00 |
qsec ~ mpg | .427 | .944 | .011 | 1.00 |
vs ~ mpg | .142 | .568 | .238 | 0.00 |
am ~ mpg | .074 | .650 | < .001 | 1.00 |
gear ~ mpg | .001 | .528 | < .001 | 2.00 |
carb ~ mpg | .008 | .362 | .003 | 2.00 |
nice_qq(data = iris,
variable = "Sepal.Length",
group = "Species")nice_normality(data = iris,
variable = "Sepal.Length",
group = "Species",
shapiro = TRUE,
histogram = TRUE,
title = "Density (Sepal Length)")