bfmedian.test: Brown-Forsythe's Test of Equality of Variances

bfmedian.testR Documentation

Brown-Forsythe's Test of Equality of Variances

Description

The function performs the robust Brown-Forsythe test using the group medians.

Usage

bfmedian.test(formula, data, alpha = 0.05, na.rm = TRUE,
verbose = TRUE)

Arguments

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

data

a tibble or data frame containing the variables in formula.

alpha

the level of significance to assess the statistical difference. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds. Default us set to TRUE.

verbose

a logical for printing output to R console.

Details

Levene (1960) proposed a test for homogeneity of variances in k groups which is based on the ANOVA statistic applied to absolute deviations of observations from the corresponding group mean. The robust Brown-Forsythe version of the Levene-type test substitutes the group mean by the group median in the classical Levene statistic.

Value

A list with class "owt" containing the following components:

statistic

the Brown-Forsythe test statistic.

parameter

the parameter(s) of the approximate F distribution of the test statistic.

p.value

the p-value of the test.

alpha

the level of significance to assess the statistical difference.

method

the character string "Brown-Forsythe-Median Test".

data

a data frame containing the variables in which NA values (if exist) are removed.

formula

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

Note

Modified from the onewaytests package and vGWAS.

Author(s)

Kristian Ullrich

References

Brown, M. B. and Forsythe, A.B. (1974). Robust tests for equality of variances. Journal of the American Statistical Association, 69, 364-367.

Levene, H. (1960). Robust Tests for Equality of Variances, in Contributions to Probability and Statistics, ed. I. Olkin, Palo Alto, CA: Stanford Univ. Press.

Examples

data(pheno)
data(geno)
df <- data.frame(phenotype = pheno, genotype = as.factor(geno[, 911]))
bfmedian.test(phenotype ~ genotype, data = df)

kullrich/vGWAS documentation built on June 10, 2025, 3:56 a.m.