Learn R Programming

olsrr (version 0.6.0)

ols_test_bartlett: Bartlett test

Description

Test if k samples are from populations with equal variances.

Usage

ols_test_bartlett(data, ...)

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

Value

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

fstat

f statistic

pval

p-value of fstat

df

degrees of freedom

Arguments

data

A data.frame or tibble.

...

Columns in data.

group_var

Grouping variable.

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_test_breusch_pagan(), ols_test_f(), ols_test_score()

Examples

Run this code
# using grouping variable
if (require("descriptr")) {
  library(descriptr)
  ols_test_bartlett(mtcarz, 'mpg', group_var = 'cyl')
}

# using variables
ols_test_bartlett(hsb, 'read', 'write')

Run the code above in your browser using DataLab