oneway.test
Test for Equal Means in a One-Way Layout

Description

Performs One-way analysis of means test on data.

Usage

oneway.test(formula, data, subset, na.action, var.equal = FALSE)

Arguments

formula a formula or an object containing a formula with the numeric response on the left side and a single grouping variable on the right side.
data a data frame to contain the variables named in the formula and subset arguments. If you do not supply a value for data, make sure that the variables in the model formula are in the search path.
subset a vector that specifies which subset of observations to use in the formula. By default, all observations are included.
na.action a character string that specifies how missing values(NAs) are handled. By default, missing values are silently omitted from the analysis.
var.equal a logical value, indicates whether to assuming equal variances or not. The default value of FALSE results in Welch's test. If var.equal = TRUE, a classical one-way anova test is performed.
Value
a list of class "htest", containing the following components:
statistic the equal means statistic in a one-way layout, with names attribute "F".
parameter the degrees of freedom of formula data, with names attribute c("num df", "denom df").
p.value the p-value of the test for equal means.
method a character string giving the name of the method used. Currently, it is always One-way analysis of means or One-way analysis of means(not assuming equal variances).
data.name a character string containing the actual names extracted from formula.
References
Welch, B. L. 1951. On the comparison of several mean values: an alternative approach. Biometrika. Volume 38. 330-336.
See Also
aov kruskal.test, t.test
Examples
y <- c(1, 2, 3, 1, 3, 2, 1, 4, 5, 6, NA, 23, 555, 77, 12)
x <- as.factor(c("A", "A", "A", "A", "A", "A", "A", "B", "B", "B",
    "C", "C", "C", "D", "D"))
oneway.test(y ~ x)
oneway.test(y ~ x, na.action = na.omit, var.equal = TRUE)
oneway.test(y ~ x, subset = x %in% c("A", "C"))
Package stats version 6.1.4-13
Package Index