oneway.test package:stats R Documentation _T_e_s_t _f_o_r _E_q_u_a_l _M_e_a_n_s _i_n _a _O_n_e-_W_a_y _L_a_y_o_u_t _D_e_s_c_r_i_p_t_i_o_n: Test whether two or more samples from normal distributions have the same means. The variances are not necessarily assumed to be equal. _U_s_a_g_e: oneway.test(formula, data, subset, na.action, var.equal = FALSE) _A_r_g_u_m_e_n_t_s: formula: a formula of the form 'lhs ~ rhs' where 'lhs' gives the sample values and 'rhs' the corresponding groups. data: an optional matrix or data frame (or similar: see 'model.frame') containing the variables in the formula 'formula'. By default the variables are taken from 'environment(formula)'. subset: an optional vector specifying a subset of observations to be used. na.action: a function which indicates what should happen when the data contain 'NA's. Defaults to 'getOption("na.action")'. var.equal: a logical variable indicating whether to treat the variances in the samples as equal. If 'TRUE', then a simple F test for the equality of means in a one-way analysis of variance is performed. If 'FALSE', an approximate method of Welch (1951) is used, which generalizes the commonly known 2-sample Welch test to the case of arbitrarily many samples. _V_a_l_u_e: A list with class '"htest"' containing the following components: statistic: the value of the test statistic. parameter: the degrees of freedom of the exact or approximate F distribution of the test statistic. p.value: the p-value of the test. method: a character string indicating the test performed. data.name: a character string giving the names of the data. _R_e_f_e_r_e_n_c_e_s: B. L. Welch (1951), On the comparison of several mean values: an alternative approach. _Biometrika_, *38*, 330-336. _S_e_e _A_l_s_o: The standard t test ('t.test') as the special case for two samples; the Kruskal-Wallis test 'kruskal.test' for a nonparametric test for equal location parameters in a one-way layout. _E_x_a_m_p_l_e_s: ## Not assuming equal variances oneway.test(extra ~ group, data = sleep) ## Assuming equal variances oneway.test(extra ~ group, data = sleep, var.equal = TRUE) ## which gives the same result as anova(lm(extra ~ group, data = sleep))