Learn R Programming

onewaytests (version 1.0)

welch.test: A Function to Perform Welch's Heteroscedastic F Test and Welch's Heteroscedastic F Test with Trimmed Mean and Winsorized Variance

Description

welch.test performs Welch's Heteroscedastic F test and Welch's Heteroscedastic F Test with trimmed mean and winsorized variance.

Usage

welch.test(y, group, rate = 0)

Arguments

y
a numeric vector of data values.
group
a vector or factor object giving the group for the corresponding elements of y.
rate
the rate of observations trimmed and winsorized from each tail of the distribution. If rate = 0, it performs Welch's Heteroscedastic F test. Otherwise, Welch's Heteroscedastic F Test with trimmed mean and winsorized variance is performed. Default is set t

Value

  • Returns a list containing following elements:
  • statisticthe corresponding 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

Welch, B. L.(1951). On the Comparison of Several Mean Values: An Alternative Approach. Biometrika, 38, 330-336.

Examples

Run this code
welch.test(iris$Sepal.Length, iris$Species, rate=0.1)

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

Run the code above in your browser using DataLab