bartlett.test {ctest}R Documentation

Bartlett Test for Homogeneity of Variances

Description

bartlett.test performs Bartlett's test of the null that the variances in each of the groups (samples) are the same.

Usage

bartlett.test(x, g)

Arguments

x a numeric vector of data values, or a list of numeric data vectors.
g a vector or factor object giving the group for the corresponding elements of x. Ignored if x is a list.

Details

If x is a list, its elements are taken as the samples to be compared for homogeneity of variances, and hence have to be numeric data vectors. In this case, g is ignored, and one can simply use bartlett.test(x) to perform the test. If the samples are not yet contained in a list, use bartlett.test(list(x, ...)).

Otherwise, x must be a numeric data vector, and g must be a vector or factor object of the same length as x giving the group for the corresponding elements of x.

Value

A list of class "htest" containing the following components:
statistic Bartlett's K-square test statistic.
parameter the degrees of freedom of the approximate chi-square distribution of the test statistic.
p.value the p-value of the test.
method the string "Bartlett test for homogeneity of variances".
data.name a character string giving the names of the data.


[Package Contents]