Learn R Programming

onewaytests (version 1.1)

bf.test: A Function to Perform Brown-Forsythe Test

Description

bf.test performs Brown-Forsythe test.

Usage

bf.test(y, group, na.rm = TRUE)

Arguments

y
a numeric vector of data values.
group
a vector or factor object giving the group for the corresponding elements of y.
na.rm
a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

A list with class "htest" 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.

References

Brown, M. B., Forsythe. A. B. (1974a). The small sample behavior of some statistics which test the equality of several means. Technometrics, 16, 129-132.

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

Examples

Run this code
bf.test(iris$Sepal.Width,iris$Species)

y=rnorm(10,5,2)
group=c(rep(1, times=3),rep("two", times=3), rep(8, times=4))
bf.test(y, group)

Run the code above in your browser using DataLab