bartlett: Bartlett test

bartlettR Documentation

Bartlett test

Description

Performs the Bartlett's test of homogeneity of variances on each row/column of the input matrix.

Usage

row_bartlett(x, g)

col_bartlett(x, g)

Arguments

x

numeric matrix.

g

a vector specifying group membership for each observation of x.

Details

NA values are always ommited. If values are missing for a whole group - that group is discarded. Groups with only one observation are also discarded.

row_bartlett(x, g) - Bartlet's test on rows. col_bartlett(x, g) - Bartlet's test on columns.

Results should be the same as as running bartlett.test(x, g) on every row (or column) of x.

Value

a data.frame where each row contains the results of the bartlett test performed on the corresponding row/column of x.

Each row contains the following information (in order):
1. obs.tot - total number of observations
2. obs.groups - number of groups
3. var.pooled - pooled variance estimate
4. df - degrees of freedom
5. statistic - chi-squared statistic
6. pvalue - p-value

Author(s)

Karolis Koncevičius

See Also

bartlett.test()

Examples

col_bartlett(iris[,1:4], iris$Species)
row_bartlett(t(iris[,1:4]), iris$Species)


matrixTests documentation built on Oct. 6, 2023, 1:07 a.m.