gpTwoWay | R Documentation |
gpTwoWay
computes a two-way ANOVA for main effects and interaction effect under heteroscedasticity.
gpTwoWay(formula, data, method = c("gPB","gPQ"), seed = 123, alpha = 0.05,
na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a data frame containing the variables in |
method |
a character string to select the method. "gPB": Parametric Bootstrap based Generalized Test, "gPQ": Generalized Pivotal Quantity based Generalized Test. |
seed |
a seed number for the reproducibility of results. Default is set to 123. |
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. |
A list containing the following components:
output |
a data frame of output. |
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 |
These tests available from this R library are based on two Generalized P-value approaches, for Two-Way ANOVA under unequal variances and cell frequencies. The first test, the gPQ, is an extension Li et al. (2011), and the second test, gPB, is a generalized test that is numerically equivalent to the Parametric Bootstrap test derived by Xu et al. (2013). The gPQ test tends to assure the intended size of the test, but somewhat conservative, especially when the sample sizes are small.
The gPB test tends to exceed the intended size of the test. Hence, the gPB is recommended for situations of small sample sizes, and gPQ otherwise.
Sam Weerahandi, Osman Dag, Malwane Ananda
Dag, O., Kasikci, M., Yilmaz, M.A., Weerahandi, S., Ananda, M.M.A. (2024). twowaytests: An R Package for Two-Way Tests in Independent Groups Designs. SoftwareX, 27, 1-8.
Ananda, M.M., Dag, O., Weerahandi, S. (2023). Heteroscedastic two-way ANOVA under constraints. Communications in Statistics-Theory and Methods, 52:22, 8207-8222.
Li, X., Wang J., Liang H. (2011). Comparison of several means: a fiducial based approach. Computational Statistics and Data Analysis, 55:5, 1993-2002.
Xu L., Yang F., Abula A., Qin, S. (2013). A parametric bootstrap approach for two-way ANOVA in presence of possible interactions with unequal variances. Journal of Multivariate Analysis, 115, 172-180.
library(twowaytests)
data(alveolar)
# to use Parametric Bootstrap based Generalized Test
gpTwoWay(cell ~ ovalbumin*treatment, data = alveolar, method = "gPB")
# to use Generalized Pivotal Quantity based Generalized Test
gpTwoWay(cell ~ ovalbumin*treatment, data = alveolar, method = "gPQ")
out <- gpTwoWay(cell ~ ovalbumin*treatment, data = alveolar, method = "gPB")
paircompTwoWay(out)
out <- gpTwoWay(cell ~ treatment*ovalbumin, data = alveolar, method = "gPB")
paircompTwoWay(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.