levene: Levene test

leveneR Documentation

Levene test

Description

Levene's test and Brown-Forsythe test for equality of variances between groups on each row/column of the input matrix.

Usage

row_levene(x, g)

col_levene(x, g)

row_brownforsythe(x, g)

col_brownforsythe(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.

row_levene(x, g) - Levene's test on rows. col_levene(x, g) - Levene's test on columns.

row_brownforsythe(x, g) - Brown-Forsythe test on rows. col_brownforsythe(x, g) - Brown-Forsythe test on columns.

Value

a data.frame where each row contains the results of the Levene's 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. df.between - between group (treatment) degrees of freedom
4. df.within - within group (residual) degrees of freedom
5. statistic - F statistic
6. pvalue - p.value

Note

Difference between Levene's test and Brown-Forsythe test is that the Brown-Forsythe test uses the median instead of the mean in computing the spread within each group. Many software implementations use the name "Levene's test" for both variants.

Author(s)

Karolis Koncevičius

See Also

leveneTest

Examples

col_levene(iris[,1:4], iris$Species)
row_brownforsythe(t(iris[,1:4]), iris$Species)


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