| bartlettTests | R Documentation |
This function extends bartlett.test to a multivariate
response setting. It performs the Bartlett test of homogeneity of variances
for each of a set of response variables, and prints a compact summary.
Bartlett's test is the univariate version of Box's M test for equality of covariance matrices. This function provides a univariate follow-up test to Box's M test to give one simple assessment of which response variables contribute to significant differences in variances among groups.
bartlettTests(y, ...)
## Default S3 method:
bartlettTests(y, group, ...)
## S3 method for class 'formula'
bartlettTests(y, data, ...)
## S3 method for class 'lm'
bartlettTests(y, ...)
y |
A data frame or matrix of numeric response variables for the default method, or a model formula for a multivariate linear model, or the multivariate linear model itself. In the case of a formula or model, the variables on the right-hand-side of the model must all be factors and must be completely crossed. |
... |
other arguments, passed to |
group |
a vector or factor object giving the group for the
corresponding elements of the rows of |
data |
the data set, for the |
An object of classes "anova" and "data.frame", with one observation
for each response variable in y.
Michael Friendly
Bartlett, M. S. (1937). Properties of sufficiency and statistical tests. Proceedings of the Royal Society of London Series A, 160, 268-282.
boxM for Box's M test for all responses together.
bartlettTests(iris[,1:4], iris$Species)
data(Skulls, package="heplots")
bartlettTests(Skulls[,-1], Skulls$epoch)
# formula method
bartlettTests(cbind(mb, bh, bl, nh) ~ epoch, data=Skulls)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.