These functions are wrappers that compute various test statistics,
however, each of them returns a tibble instead of a list of values.
Furthermore, all functions can also be applied to multiples models
in stored in list-variables (see 'Examples').
outliers()
wraps outlierTest
and iteratively
removes outliers for iterations
times, or if the r-squared value
(for glm: the AIC) did not improve after removing outliers. The function
returns a tibble with r-squared and AIC statistics for the original
and updated model, as well as the update model itself ($updated.model
),
the number ($removed.count
) and indices of the removed observations
($removed.obs
).
heteroskedastic()
wraps ncvTest
and returns
the p-value of the test statistics as tibble. A p-value < 0.05 indicates
a non-constant variance (heteroskedasticity).
autocorrelation()
wraps durbinWatsonTest
and returns the p-value of the test statistics as tibble. A p-value
< 0.05 indicates autocorrelated residuals. In such cases, robust
standard errors (see robust
return more accurate results
for the estimates, or maybe a mixed model with error term for the
cluster groups should be used.
normality()
calls shapiro.test
and checks the standardized residuals for normal distribution.
The p-value of the test statistics is returned as tibble. A p-value
< 0.05 indicates a significant deviation from normal distribution.
Note that this formal test almost always yields significant results
for the distribution of residuals and visual inspection (e.g. qqplots)
are preferable (see plot_model
with
type = "diag"
).
multicollin()
wraps vif
and returns
the maximum vif-value from a model as tibble. If this value is
larger than about 4, multicollinearity exists, else not.
In case of multicollinearity, the names of independent
variables that vioalte contribute to multicollinearity are printed
to the console.
check_assumptions()
runs all of the above tests and returns
a tibble with all test statistics included. In case the p-values
are too confusing, use the as.logical
argument, where all
p-values are replaced with either TRUE
(in case of violation)
or FALSE
(in case of model conforms to assumption of linar
regression).