Test if k samples are from populations with equal variances.

ols_bartlett_test(data, ...)

# S3 method for default
ols_bartlett_test(data, ..., group_var = NULL)

Arguments

data

A data.frame or tibble.

...

Columns in data.

group_var

Grouping variable.

Value

ols_bartlett_test returns an object of class "ols_bartlett_test". An object of class "ols_bartlett_test" is a list containing the following components:

fstat

f statistic

pval

p-value of fstat

df

degrees of freedom

Details

Bartlett's test is used to test if variances across samples is equal. It is sensitive to departures from normality. The Levene test is an alternative test that is less sensitive to departures from normality.

References

Snedecor, George W. and Cochran, William G. (1989), Statistical Methods, Eighth Edition, Iowa State University Press.

See also

Other heteroskedasticity tests: ols_bp_test, ols_f_test, ols_score_test

Examples

# NOT RUN {
# using grouping variable
library(descriptr)
ols_bartlett_test(mtcarz, mpg, group_var = cyl)
# }
# NOT RUN { # using variables ols_bartlett_test(hsb, read, write) # }