Learn R Programming

onewaytests (version 1.0)

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

Description

bf.test performs Brown-Forsythe test.

Usage

bf.test(y, group)

Arguments

y
a numeric vector of data values.
group
a vector or factor object giving the group for the corresponding elements of y.

Value

  • Returns a list containing following elements:
  • statisticthe Brown-Forsythe test statistic.
  • df1the first degrees of freedom of the approximate F distribution of the test statistic.
  • df2the second degrees of freedom of the approximate F distribution of the test statistic.
  • p.valuethe 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