Learn R Programming

matrixTests (version 0.2.2)

bartlett: 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)

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

Arguments

x

numeric matrix.

g

a vector specifying group membership for each observation of x.

Author

Karolis Koncevičius

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.

See Also

Examples

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

Run the code above in your browser using DataLab