onewaytests (version 2.4)

welch.test: Welch's Heteroscedastic F Test and Welch's Heteroscedastic F Test with Trimmed Means and Winsorized Variances

Description

welch.test performs Welch's heteroscedastic F test and Welch's heteroscedastic F test with trimmed means and Winsorized variances.

Usage

welch.test(formula, data, rate = 0, 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 the formula formula

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 means and Winsorized variances is performed. Default is set to rate = 0.

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.

verbose

a logical for printing output to R console.

Value

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

statistic

the value of the test statistic with a name describing it.

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 "Welch's Heteroscedastic F Test" or "Welch's Heteroscedastic F Test with Trimmed Means and Winsorized Variances" depending on the choice.

rate

the rate of observations trimmed and winsorized from each tail of the distribution.

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.

References

Dag, O., Dolgun, A., Konar, N.M. (2018). onewaytests: An R Package for One-Way Tests in Independent Groups Designs. The R Journal, 10:1, 175-199.

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

Examples

Run this code
# NOT RUN {
library(onewaytests)

welch.test(Sepal.Length ~ Species, data = iris)
welch.test(Sepal.Length ~ Species, data = iris, rate = 0.1)


out <- welch.test(Sepal.Length ~ Species, data = iris)
paircomp(out)

# }

Run the code above in your browser using DataLab