View source: R/ols-bartlett-test.R
ols_test_bartlett | R Documentation |
Test if k samples are from populations with equal variances.
ols_test_bartlett(data, ...)
## Default S3 method:
ols_test_bartlett(data, ..., group_var = NULL)
data |
A |
... |
Columns in |
group_var |
Grouping variable. |
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.
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 |
df |
degrees of freedom |
Snedecor, George W. and Cochran, William G. (1989), Statistical Methods, Eighth Edition, Iowa State University Press.
Other heteroskedasticity tests:
ols_test_breusch_pagan()
,
ols_test_f()
,
ols_test_score()
# using grouping variable
if (require("descriptr")) {
library(descriptr)
ols_test_bartlett(mtcarz, 'mpg', group_var = 'cyl')
}
# using variables
ols_test_bartlett(hsb, 'read', 'write')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.