Learn R Programming

performance (version 0.3.0)

check_heteroscedasticity: Check model for (non-)constant error variance

Description

Check model for (non-)constant error variance.

Usage

check_heteroscedasticity(x, ...)

Arguments

x

A model object.

...

Currently not used.

Value

Invisibly returns the p-value of the test statistics. A p-value < 0.05 indicates a non-constant variance (heteroskedasticity).

Examples

Run this code
# NOT RUN {
m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
check_heteroscedasticity(m)

# plot results
x <- check_heteroscedasticity(m)
plot(x)

# }

Run the code above in your browser using DataLab