Checks a simple or multiple linear regression model for heteroscedasticity and linearity. The function outputs orientation plots and computes relevant statistical tests (heteroscedasticity = lmtest::bptest; linearity = lmtest::raintest).

heteroscedasticity_check(mdl, random = NULL)

Arguments

mdl

A simple or multiple linear regression model.

Value

A plot and a test results in the console.

References

Achim Zeileis, Torsten Hothorn (2002). Diagnostic Checking in Regression Relationships. R News 2(3), 7-10. URL: https://CRAN.R-project.org/doc/Rnews/

Author

D. Schmitz & J. Esser

Examples

data("data_s")

model <- lm(sDur ~ typeOfS + pauseDur, data_s)

heteroscedasticity_check(model)
#> Error in ggplot(data, aes(x = x, y = y)): could not find function "ggplot"