Learn R Programming

performance (version 0.4.3)

check_homogeneity: Check model for homogeneity of variances

Description

Check model for homogeneity of variances between groups described by independent variables in a model.

Usage

check_homogeneity(x, method = c("bartlett", "fligner", "auto"), ...)

Arguments

x

A linear model or an ANOVA object.

method

Name of the method (underlying test) that should be performend to check the homogeneity of variances. May either be "bartlett" for the Bartlett test (assuming normal distributed samples or groups), "fligner" for the Fligner-Killeen test (rank-based, non-parametric test), or "auto". In the latter case, Bartlett test is used if the model response is normal distributed, else Fligner-Killeen test is used.

...

Currently not used.

Value

Invisibly returns the p-value of the test statistics. A p-value < 0.05 indicates a significant difference in the variance between the groups.

Examples

Run this code
# NOT RUN {
model <- lm(len ~ supp + dose, data = ToothGrowth)
check_homogeneity(model)

# plot results
result <- check_homogeneity(model)
plot(result)
# }

Run the code above in your browser using DataLab