Learn R Programming

onewaytests (version 3.0)

gp.test: Test for Equal Means in a One-Way Layout under Unequal Variances

Description

gp.test tests whether two or more samples from normal distributions have the same means when the variances are not necessarily equal.

Usage

gp.test(formula, data, method = c("gtb","gtf"), alpha = 0.05, 
  na.rm = TRUE, verbose = TRUE)

Value

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

p.value

the p-value of the corresponding test.

alpha

the level of significance to assess the statistical difference.

method

the selected method used in generalized test.

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.

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 formula.

method

a character string to select the method. "gtb": Generalized Test Equivalent to Parametric Bootstrap Test (size close to intended), "gtf": Generalized Test Equivalent to Fiducial Test (size assured).

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.

Author

Sam Weerahandi, Malwane Ananda

References

Daniel, W.W., Cross, C.L. (2013). Biostatistics: A Foundation for Analysis in the Health Sciences. (10th ed.). John Wiley and Sons, Inc.

Krishnamoorthy, K., Lu, F., Mathew, T. (2007). A parametric bootstrap approach for ANOVA with unequal variances: fixed and random models. Computational Statistics and Data Analysis, 51:12, 5731-5742.

Li, X., Wang J., Liang H. (2011). Comparison of several means: a fiducial based approach. Computational Statistics and Data Analysis, 55:5, 1993-2002.

Weerahandi, S. (2004). Generalized Inference in Repeated Measures: Exact Methods in MANOVA and Mixed Models, Series in Probability and Statistics. John Wiley and Sons, Inc.

Weerahandi, S., Krishnamoorthy, K. (2019). A note reconciling ANOVA tests under unequal error variances. Communications in Statistics-Theory and Methods, 48:3, 689-693.

Examples

Run this code

library(onewaytests)
# \donttest{
out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtb")
paircomp(out)

out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtf")
paircomp(out)
# }


Run the code above in your browser using DataLab