Title: | One-Way Tests in Independent Groups Designs |
---|---|
Description: | Performs one-way tests in independent groups designs including homoscedastic and heteroscedastic tests. These are one-way analysis of variance (ANOVA), Welch's heteroscedastic F test, Welch's heteroscedastic F test with trimmed means and Winsorized variances, Brown-Forsythe test, Alexander-Govern test, James second order test, Kruskal-Wallis test, Scott-Smith test, Box F test, Johansen F test, Generalized tests equivalent to Parametric Bootstrap and Fiducial tests, Alvandi's F test, Alvandi's generalized p-value, approximate F test, B square test, Cochran test, Weerahandi's generalized F test, modified Brown-Forsythe test, adjusted Welch's heteroscedastic F test, Welch-Aspin test, Permutation F test. The package performs pairwise comparisons and graphical approaches. Also, the package includes Student's t test, Welch's t test and Mann-Whitney U test for two samples. Moreover, it assesses variance homogeneity and normality of data in each group via tests and plots (Dag et al., 2018, <https://journal.r-project.org/archive/2018/RJ-2018-022/RJ-2018-022.pdf>). |
Authors: | Osman Dag [aut, cre], Merve Kasikci [aut], Anil Dolgun [aut], N. Meric Konar [aut], Sam Weerahandi [aut], Malwane Ananda [aut], H. Erkin Sulekli [aut] |
Maintainer: | Osman Dag <[email protected]> |
License: | GPL (>= 2) |
Version: | 3.0 |
Built: | 2024-10-26 03:55:59 UTC |
Source: | https://github.com/cran/onewaytests |
af.test
performs Alvandi's F test.
af.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
af.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Alvandi's F test statistic. |
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 "Alvandi's F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Merve Kasikci
Sadooghi-Alvandi, S.M., Jafari, A.A., Mardani-Fard, H.A. (2012). One-Way ANOVA with Unequal Variances. Communications in Statistics-Theory and Methods, 41:22, 4200-4221.
library(onewaytests) af.test(Sepal.Length ~ Species, data = iris) out <- af.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) af.test(Sepal.Length ~ Species, data = iris) out <- af.test(Sepal.Length ~ Species, data = iris) paircomp(out)
ag.test
performs Alexander-Govern test.
ag.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
ag.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Alexander-Govern test statistic. |
parameter |
the parameter(s) of the approximate chi-squared 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 "Alexander-Govern Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
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.
Schneider, P. J., Penfield, D. A. (1997). Alexander and Govern's Approximation: Providing an Alternative to ANOVA Under Variance Heterogeneity. The Journal of Experimental Education, 65:3, 271-286.
###### library(onewaytests) ag.test(Sepal.Length ~ Species, data = iris) out <- ag.test(Sepal.Length ~ Species, data = iris) paircomp(out) ###### library(onewaytests) library(tibble) iris <- as_tibble(iris) ag.test(Sepal.Length ~ Species, data = iris) out <- ag.test(Sepal.Length ~ Species, data = iris) paircomp(out) ######
###### library(onewaytests) ag.test(Sepal.Length ~ Species, data = iris) out <- ag.test(Sepal.Length ~ Species, data = iris) paircomp(out) ###### library(onewaytests) library(tibble) iris <- as_tibble(iris) ag.test(Sepal.Length ~ Species, data = iris) out <- ag.test(Sepal.Length ~ Species, data = iris) paircomp(out) ######
agp.test
performs Alvandi's generalized p-value.
agp.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
agp.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
N |
the number of bootstrap samples. Default is set to 10^5. |
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 with class "owt" containing the following components:
p.value |
the Alvandi's generalized p-value. |
alpha |
the level of significance to assess the statistical difference. |
method |
the character string "Alvandi's Generalized P-Value". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
N |
the number of bootstrap samples. |
Merve Kasikci
Sadooghi-Alvandi, S.M., Jafari, A.A., Mardani-Fard, H.A. (2012). One-Way ANOVA with Unequal Variances. Communications in Statistics-Theory and Methods, 41:22, 4200-4221.
library(onewaytests) agp.test(Sepal.Length ~ Species, data = iris) out <- agp.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) agp.test(Sepal.Length ~ Species, data = iris) out <- agp.test(Sepal.Length ~ Species, data = iris) paircomp(out)
aov.test
performs one-way analysis of variance (ANOVA).
aov.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
aov.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the analysis of variance test statistic. |
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 "One-Way Analysis of Variance". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
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.
Sheskin, D. J. (2004). Handbook of Parametric and Nonparametric Statistical Procedures. 3rd Edition. Chapman and Hall CRC. Florida: Boca Raton.
library(onewaytests) aov.test(Sepal.Length ~ Species, data = iris) out <- aov.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) aov.test(Sepal.Length ~ Species, data = iris) out <- aov.test(Sepal.Length ~ Species, data = iris) paircomp(out)
ap.test
performs approximate F test.
ap.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
ap.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the approximate F test statistic. |
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 "Approximate F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Merve Kasikci
Asiribo, O., Gurland, J. (1990). Coping with Variance Heterogeneity. Communications in Statistics-Theory and Methods, 19:11, 4029-4048.
library(onewaytests) ap.test(Sepal.Length ~ Species, data = iris) out <- ap.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) ap.test(Sepal.Length ~ Species, data = iris) out <- ap.test(Sepal.Length ~ Species, data = iris) paircomp(out)
aw.test
performs adjusted Welch's heteroscedastic F test.
aw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
aw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the adjusted Welch's heteroscedastic F test statistic. |
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 "Adjusted Welch's Heteroscedastic F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Hartung, J., Argac, D., Makambi, K.H. (2002). Small Sample Properties of Tests on Homogeneity in One-Way ANOVA and Meta-Analysis. Statistial Papers, 43:2, 197-235.
library(onewaytests) aw.test(Sepal.Length ~ Species, data = iris) out <- aw.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) aw.test(Sepal.Length ~ Species, data = iris) out <- aw.test(Sepal.Length ~ Species, data = iris) paircomp(out)
b2.test
performs B square test.
b2.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
b2.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the B square test statistic. |
parameter |
the parameter(s) of the approximate chi-squared 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 "B Square Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Merve Kasikci
Ozdemir, A.F., Kurt, S. (2006). One Way Fixed Effect Analysis of Variance under Variance Heterogeneity and a Solution Proposal. Selcuk Journal of Applied Mathematics, 7:2, 81-90.
library(onewaytests) b2.test(Sepal.Length ~ Species, data = iris) out <- b2.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) b2.test(Sepal.Length ~ Species, data = iris) out <- b2.test(Sepal.Length ~ Species, data = iris) paircomp(out)
bf.test
performs Brown-Forsythe test.
bf.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
bf.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Brown-Forsythe test statistic. |
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 "Brown-Forsythe Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Brown, M. B., Forsythe. A. B. (1974a). The small sample behavior of some statistics which test the equality of several means. Technometrics, 16, 129-132.
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.
library(onewaytests) bf.test(Sepal.Length ~ Species, data = iris) out <- bf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) bf.test(Sepal.Length ~ Species, data = iris) out <- bf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
box.test
performs Box F test.
box.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
box.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Box F test statistic. |
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 "Box F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Box, G.E.P. (1954). Some Theorems on Quadratic Forms Applied in the Study of Analysis of Variance Problems, Annals of Mathematical Statistics, 25, 290-302.
library(onewaytests) box.test(Sepal.Length ~ Species, data = iris) out <- box.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) box.test(Sepal.Length ~ Species, data = iris) out <- box.test(Sepal.Length ~ Species, data = iris) paircomp(out)
cochran.test
performs Cochran test.
cochran.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
cochran.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Cochran test statistic. |
parameter |
the parameter(s) of the approximate chi-squared 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 "Cochran Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Merve Kasikci
Cochran, W.G. (1937). Problems Arising in the Analysis of a Series of Similar Experiments. Supplement to Journal of the Royal Statistical Society, 4:1, 102-118.
library(onewaytests) cochran.test(Sepal.Length ~ Species, data = iris) out <- cochran.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) cochran.test(Sepal.Length ~ Species, data = iris) out <- cochran.test(Sepal.Length ~ Species, data = iris) paircomp(out)
describe
produces basic descriptive statistics including sample size, mean, standard deviation, median, minimum value, maximum value, 25th quantile, 75th quantile, skewness, kurtosis, the number of missing value.
describe(formula, data)
describe(formula, data)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
Returns a data.frame of output.
Osman Dag
library(onewaytests) describe(Sepal.Length ~ Species, data = iris)
library(onewaytests) describe(Sepal.Length ~ Species, data = iris)
gp.test
tests whether two or more samples from normal distributions have the same means when the variances are not necessarily equal.
gp.test(formula, data, method = c("gtb","gtf"), alpha = 0.05, na.rm = TRUE, verbose = TRUE)
gp.test(formula, data, method = c("gtb","gtf"), alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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. |
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 |
The methods underlying Generalized Tests are summarized in Weerahandi and Krishnamoorthy (2019), which shows that both the Fiducial and the Parametric Bootstrap tests are generalized tests based on an exact probability statement on alternative test variables. Greater details of them can be found in Krishnamoorthy et al. (2007) and Li et al. (2011). For greater details about Generalized Inference, the reader is referred to Weerahandi (2004), which can be freely read at Generalized Inference.
For additional information about the methods and the code, the reader can contact the authors of this code, Sam Weerahandi or Malwane Ananda.
Sam Weerahandi, Malwane Ananda
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.
library(onewaytests) out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtb") paircomp(out) out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtf") paircomp(out)
library(onewaytests) out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtb") paircomp(out) out <- gp.test(Sepal.Length ~ Species, data = iris, method = "gtf") paircomp(out)
gplot
produce box-and-whisker plots, violin plots, and error bars of the given grouped values.
gplot(formula, data, type = c("boxplot-violin", "boxplot", "violin", "errorbar"), width = c(0.3, 1.0, 0.2), dots = TRUE, binwidth = 0.05, color_manual = NULL, theme = theme_bw(), xlab = NULL, ylab = NULL, title = NULL, option = c("sd", "se"), bar = FALSE, na.rm = TRUE)
gplot(formula, data, type = c("boxplot-violin", "boxplot", "violin", "errorbar"), width = c(0.3, 1.0, 0.2), dots = TRUE, binwidth = 0.05, color_manual = NULL, theme = theme_bw(), xlab = NULL, ylab = NULL, title = NULL, option = c("sd", "se"), bar = FALSE, na.rm = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
type |
a character string to select one of the plots. "boxplot-violin": box-and-whisker plot with violin lines, "boxplot": box-and-whisker plot, "violin": violin plot, "errorbar": error bar. |
width |
a vector including three numeric values. First numeric represents the width of the boxes for box-and-whisker plots (defaults to 0.3). Second numeric belongs to the width of violin plot (defaults to 1.0). Third numeric represents the width of the little lines at the tops and bottoms of the error bars (defaults to 0.20). |
dots |
a logical to draw the dots corresponding the data values. |
binwidth |
a numeric to specify bin width of dot(s), defaults to 0.05. |
color_manual |
a vector of colors. A palette can also be defined with |
theme |
a theme (see |
xlab |
a label for the x axis, defaults to a description of x. |
ylab |
a label for the y axis, defaults to a description of y. |
title |
a main title for the plot. |
option |
a character string to select one of the options to draw error bars with standard error or standard deviation. "se": standard error, "sd": standard deviation. Defaults to "sd". |
bar |
a logical to add bar to errorbars. Default is fixed to bar = FALSE. |
na.rm |
a logical indicating whether NA values should be stripped before the computation proceeds. |
The upper whisker of box-and-whisker plots extends from the hinge to the highest value that is within 1.5 * IQR of the hinge, where IQR is the inter-quartile range. The lower whisker extends from the hinge to the lowest value within 1.5 * IQR of the hinge. Data out of the ends of the whiskers are outliers and plotted as points.
Osman Dag
library(onewaytests) # box-and-whisker with dots gplot(Sepal.Length~Species, data = iris, type = "boxplot") # box-and-whisker without dots gplot(Sepal.Length~Species, data = iris, type = "boxplot", dots = FALSE) # to change the width of the boxes for box-and-whisker plots gplot(Sepal.Length~Species, data = iris, type = "boxplot", width = c(0.4, NA, NA)) # violin plot with dots gplot(Sepal.Length~Species, data = iris, type = "violin") # to change the width of violin plots gplot(Sepal.Length~Species, data = iris, type = "violin", width = c(NA, 0.8, NA)) # box-and-whisker plot with violin lines and dots gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin") # to change the width of the boxes for box-and-whisker plots and the width of violin plots gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA)) # to change the theme library(ggplot2) gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), theme = theme_minimal()) # to specify the colors gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=c("#999999","#E69F00","#56B4E9")) # to specify the colors as white gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=c("white","white","white")) #to change color palette library(wesanderson) gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=wes_palette(name="GrandBudapest1",n=3)) # error bars (mean +- standard deviation) without bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "sd", bar = FALSE) # error bars (mean +- standard deviation) with bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "sd", bar = TRUE) # to change the width of the little lines at the tops and bottoms of the error bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", width = c(NA, NA, 0.25)) # error bars (mean +- standard error) without bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "se", bar = FALSE)
library(onewaytests) # box-and-whisker with dots gplot(Sepal.Length~Species, data = iris, type = "boxplot") # box-and-whisker without dots gplot(Sepal.Length~Species, data = iris, type = "boxplot", dots = FALSE) # to change the width of the boxes for box-and-whisker plots gplot(Sepal.Length~Species, data = iris, type = "boxplot", width = c(0.4, NA, NA)) # violin plot with dots gplot(Sepal.Length~Species, data = iris, type = "violin") # to change the width of violin plots gplot(Sepal.Length~Species, data = iris, type = "violin", width = c(NA, 0.8, NA)) # box-and-whisker plot with violin lines and dots gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin") # to change the width of the boxes for box-and-whisker plots and the width of violin plots gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA)) # to change the theme library(ggplot2) gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), theme = theme_minimal()) # to specify the colors gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=c("#999999","#E69F00","#56B4E9")) # to specify the colors as white gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=c("white","white","white")) #to change color palette library(wesanderson) gplot(Sepal.Length~Species, data = iris, type = "boxplot-violin", width = c(0.25, 0.95, NA), color_manual=wes_palette(name="GrandBudapest1",n=3)) # error bars (mean +- standard deviation) without bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "sd", bar = FALSE) # error bars (mean +- standard deviation) with bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "sd", bar = TRUE) # to change the width of the little lines at the tops and bottoms of the error bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", width = c(NA, NA, 0.25)) # error bars (mean +- standard error) without bars gplot(Sepal.Length~Species, data = iris, type = "errorbar", option = "se", bar = FALSE)
homog.test
performs variance homogeneity tests including Levene, Bartlett, Fligner-Killeen tests.
homog.test(formula, data, method = c("Levene", "Bartlett", "Fligner"), alpha = 0.05, na.rm = TRUE, verbose = TRUE)
homog.test(formula, data, method = c("Levene", "Bartlett", "Fligner"), alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
method |
a character string to select one of the variance homogeneity tests. "Levene": Levene's test, "Bartlett": Bartlett's test, "Fligner": Fligner-Killeen test. |
alpha |
the level of significance to assess variance homogeneity. 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:
statistic |
the corresponding test statistic. |
parameter |
the parameter(s) of the approximate corresponding distribution of the test statistic. The corresponding distribution is F distribution for Levene's test, Chi-square distribution for Bartlett's test and Fligner-Killeen test. |
p.value |
the p-value of the test. |
Osman Dag
leveneTest
bartlett.test
fligner.test
library(onewaytests) homog.test(Sepal.Length ~ Species, data = iris) homog.test(Sepal.Length ~ Species, data = iris, method = "Bartlett")
library(onewaytests) homog.test(Sepal.Length ~ Species, data = iris) homog.test(Sepal.Length ~ Species, data = iris, method = "Bartlett")
james.test
performs James second order test.
james.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
james.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
a significance level. Defaults 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 with class "jt" containing the following components:
statistic |
the James second order test statistic. |
criticalValue |
the critical value of the James second order test statistic. |
alpha |
the level of significance to assess the statistical difference. |
method |
the character string "James Second Order Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Anil Dolgun
Cribbie, R. A., Fiksenbaum, L., Keselman, H. J., Wilcox, R. R. (2012). Effect of Non-Normality on Test Statistics for One-Way Independent Groups Designs. British Journal of Mathematical and Statistical Psychology, 65, 56-73.
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.
library(onewaytests) james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) out <- james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) paircomp(out)
library(onewaytests) james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) out <- james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) paircomp(out)
johansen.test
performs Johansen F test.
johansen.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
johansen.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Johansen F test statistic. |
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 "Johansen F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Johansen, S. (1980). The Welch-James Approximation to the Distribution of the Residual Sum of Squares in a Weighted Linear Regression, Biometrika, 67:1, 58-92.
library(onewaytests) johansen.test(Sepal.Length ~ Species, data = iris) out <- johansen.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) johansen.test(Sepal.Length ~ Species, data = iris) out <- johansen.test(Sepal.Length ~ Species, data = iris) paircomp(out)
kw.test
performs Kruskal-Wallis test.
kw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
kw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Kruskal-Wallis test statistic. |
parameter |
the parameter(s) of the approximate chi-squared 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 "Kruskal-Wallis Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Anil Dolgun
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.
Sheskin, D. J. (2004). Handbook of Parametric and Nonparametric Statistical Procedures. 3rd Edition. Chapman and Hall CRC. Florida: Boca Raton.
library(onewaytests) kw.test(Sepal.Length ~ Species, data = iris) out <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) kw.test(Sepal.Length ~ Species, data = iris) out <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out)
mbf.test
performs modified Brown-Forsythe test.
mbf.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
mbf.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the modified Brown-Forsythe test statistic. |
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 "Modified Brown-Forsythe Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Merve Kasikci
Mehrotra, D.V. (1997). Improving the Brown-Forsythe Solution to the Generalized Behrens-Fisher Problem. Communications in Statistics-Simulation and Computation, 26:3, 1139-1145.
library(onewaytests) mbf.test(Sepal.Length ~ Species, data = iris) out <- mbf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) mbf.test(Sepal.Length ~ Species, data = iris) out <- mbf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
mw.test
performs Mann-Whitney U test for two samples.
mw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
mw.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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. |
Approximation to normal distribution is used to obtain the p-value.
A list with class "owt" containing the following components:
statistic |
the Z statistic. |
p.value |
the p-value of the test. |
alpha |
the level of significance to assess the statistical difference. |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) mw.test(aadt ~ control, data = AADT)
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) mw.test(aadt ~ control, data = AADT)
nor.test
performs normality tests including Shapiro-Wilk, Shapiro-Francia, Kolmogorov-Smirnov, Anderson-Darling, Cramer-von Mises, Pearson Chi-square tests, and also assess the normality of each group through plots.
nor.test(formula, data, method = c("SW", "SF", "LT", "AD", "CVM", "PT"), alpha = 0.05, plot = c("qqplot-histogram", "qqplot", "histogram"), mfrow = NULL, na.rm = TRUE, verbose = TRUE)
nor.test(formula, data, method = c("SW", "SF", "LT", "AD", "CVM", "PT"), alpha = 0.05, plot = c("qqplot-histogram", "qqplot", "histogram"), mfrow = NULL, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
method |
a character string to select one of the normality tests. "SW": Shapiro-Wilk test, "SF": Shapiro-Francia test, "LT": Lilliefors (Kolmogorov-Smirnov) test, "AD": Anderson-Darling test, "CVM": Cramer-von Mises test, "PT": Pearson Chi-square test. |
alpha |
the level of significance to assess normality. Default is set to alpha = 0.05. |
plot |
a character string to select one of the plots including qqplot-histogram, qqplot, histogram. The red line is the density line of normal distribution. |
mfrow |
a two element vector to draw subsequent figures. |
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 data frame gives the test results for the normality of groups via corresponding normality.
Osman Dag
library(onewaytests) nor.test(Sepal.Length ~ Species, data = iris, method = "SW", plot = "qqplot-histogram") nor.test(Sepal.Length ~ Species, data = iris, method = "SF", plot = "qqplot", mfrow = c(1,3))
library(onewaytests) nor.test(Sepal.Length ~ Species, data = iris, method = "SW", plot = "qqplot-histogram") nor.test(Sepal.Length ~ Species, data = iris, method = "SF", plot = "qqplot", mfrow = c(1,3))
onewaytests
is a function covering 22 one-way tests for independent groups designs.
onewaytests(formula, data, method = c("aov", "af", "ag", "agp", "ap", "aw", "b2", "bf", "box", "cochran", "gtb", "gtf", "james", "johansen", "kw", "mbf", "pf", "ss", "wa", "welch", "welch_tw", "wgf"), N = 10^5, rate = 0.1, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
onewaytests(formula, data, method = c("aov", "af", "ag", "agp", "ap", "aw", "b2", "bf", "box", "cochran", "gtb", "gtf", "james", "johansen", "kw", "mbf", "pf", "ss", "wa", "welch", "welch_tw", "wgf"), N = 10^5, rate = 0.1, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
method |
the one-way test. There are 22 tests available: one-way analysis of variance ("aov"), Welch's heteroscedastic F test ("welch"), Welch's heteroscedastic F test with trimmed means and Winsorized variances ("welch_tw"), Brown-Forsythe test ("bf"), Alexander-Govern test ("ag"), James second order test ("james"), Kruskal-Wallis test ("kw"), Scott-Smith test ("ss"), Box F test ("bf"), Generalized tests equivalent to Parametric Bootstrap ("gtb") and Fiducial ("gtf") tests, Johansen F test ("johansen"), Alvandi's F test ("af"), Alvandi's generalized p-value ("agp"), approximate F test ("af"), B square test ("b2"), Cochran test ("cochran"), Weerahandi's generalized F test ("wgf"), modified Brown-Forsythe test ("mbf"), adjusted Welch's heteroscedastic F test ("aw"), Welch-Aspin test ("wa"), Permutation F test ("pf"). Default is set to "aov". |
N |
the number of bootstrap samples for Weerahandi's generalized F test, Alvandi's generalized p-value, and permutation F test. Default is set to 10^5. |
rate |
the rate of observations trimmed and winsorized from each tail of the distribution for Welch's heteroscedastic F test with trimmed means and Winsorized variances. Default is set to rate = 0.1. |
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. |
See the corresponding one-way test function.
Merve Kasikci, Osman Dag
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.
library(onewaytests) # One-Way Analysis of Variance onewaytests(Sepal.Length ~ Species, data = iris, method = "aov") # Alexander-Govern test onewaytests(Sepal.Length ~ Species, data = iris, method = "ag") # Johansen F test onewaytests(Sepal.Length ~ Species, data = iris, method = "johansen") out <- onewaytests(Sepal.Length ~ Species, data = iris, method = "aov") paircomp(out)
library(onewaytests) # One-Way Analysis of Variance onewaytests(Sepal.Length ~ Species, data = iris, method = "aov") # Alexander-Govern test onewaytests(Sepal.Length ~ Species, data = iris, method = "ag") # Johansen F test onewaytests(Sepal.Length ~ Species, data = iris, method = "johansen") out <- onewaytests(Sepal.Length ~ Species, data = iris, method = "aov") paircomp(out)
paircomp
is a generic function for pairwise comparisons by adjusting p-values.
## S3 method for class 'owt' paircomp(x, adjust.method = c("bonferroni", "holm", "hochberg", "hommel", "BH", "BY", "fdr", "none"), verbose = TRUE, ...)
## S3 method for class 'owt' paircomp(x, adjust.method = c("bonferroni", "holm", "hochberg", "hommel", "BH", "BY", "fdr", "none"), verbose = TRUE, ...)
x |
a |
adjust.method |
Method for adjusting p values (see |
verbose |
a logical for printing output to R console. |
... |
Additional arguments affecting multiple comparisons of groups in one-way independent designs. |
Returns a data.frame of output.
Osman Dag
library(onewaytests) out <- aov.test(Sepal.Length ~ Species, data = iris) paircomp(out) paircomp(out, adjust.method = "hochberg") out2 <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out2) paircomp(out2, adjust.method = "hommel") out3 <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out3) paircomp(out3, adjust.method = "holm")
library(onewaytests) out <- aov.test(Sepal.Length ~ Species, data = iris) paircomp(out) paircomp(out, adjust.method = "hochberg") out2 <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out2) paircomp(out2, adjust.method = "hommel") out3 <- kw.test(Sepal.Length ~ Species, data = iris) paircomp(out3) paircomp(out3, adjust.method = "holm")
paircomp.jt
performs multiple comparisons by adjusting the level of significance for James second order test.
## S3 method for class 'jt' paircomp(x, adjust.method = c("bonferroni", "none"), verbose = TRUE, ...)
## S3 method for class 'jt' paircomp(x, adjust.method = c("bonferroni", "none"), verbose = TRUE, ...)
x |
a |
adjust.method |
Method for adjusting the significance level. "bonferroni": Bonferroni correction, "none": No correction. |
verbose |
a logical for printing output to R console. |
... |
Additional arguments affecting multiple comparisons of groups in one-way independent designs. |
Returns a data.frame of output.
Osman Dag
library(onewaytests) out <- james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) paircomp(out, adjust.method = "bonferroni")
library(onewaytests) out <- james.test(Sepal.Length ~ Species, data = iris, alpha = 0.05) paircomp(out, adjust.method = "bonferroni")
pf.test
performs Permutation F test.
pf.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
pf.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
N |
the number of bootstrap samples. Default is set to 10^5. |
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 with class "owt" containing the following components:
p.value |
the Permutation F test p-value. |
alpha |
the level of significance to assess the statistical difference. |
method |
the character string "Permutation F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
N |
the number of bootstrap samples. |
Osman Dag
Berry, K.J., Mielke Jr, P.W., Mielke, H.W. (2002). The Fisher-Pitman Permutation Test: an Attractive Alternative to the F Test. Psychological Reports, 90:2, 495-502.
library(onewaytests) pf.test(Sepal.Length ~ Species, data = iris) out <- pf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) pf.test(Sepal.Length ~ Species, data = iris) out <- pf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
ss.test
performs Scott-Smith test.
ss.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
ss.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Scott-Smith test statistic. |
parameter |
the parameter(s) of the approximate chi-squared 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 "Scott-Smith Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Scott, A., Smith, T. (1971). Interval Estimates for Linear Combinations of Means. Journal of the Royal Statistical Society: Series C (Applied Statistics), 20:3, 276-285.
library(onewaytests) ss.test(Sepal.Length ~ Species, data = iris) out <- ss.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) ss.test(Sepal.Length ~ Species, data = iris) out <- ss.test(Sepal.Length ~ Species, data = iris) paircomp(out)
st.test
performs Student's t-test for two samples.
st.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
st.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Student's t-test statistic. |
parameter |
the parameter(s) of the approximate t distribution of the test statistic. |
p.value |
the p-value of the test. |
alpha |
the level of significance to assess the statistical difference. |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) st.test(aadt ~ control, data = AADT)
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) st.test(aadt ~ control, data = AADT)
wa.test
performs Welch-Aspin test.
wa.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
wa.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Welch-Aspin test statistic. |
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-Aspin Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
Aspin, A.A. (1948). An Examination and Further Development of a Formula Arising in the Problem of Comparing Two Mean Values. Biometrika, 35:1/2, 88-96.
library(onewaytests) wa.test(Sepal.Length ~ Species, data = iris) out <- wa.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) wa.test(Sepal.Length ~ Species, data = iris) out <- wa.test(Sepal.Length ~ Species, data = iris) paircomp(out)
welch.test
performs Welch's heteroscedastic F test and Welch's heteroscedastic F test with trimmed means and Winsorized variances.
welch.test(formula, data, rate = 0, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
welch.test(formula, data, rate = 0, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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. |
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 |
Osman Dag
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.
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)
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)
wgf.test
performs Weerahandi's generalized F test.
wgf.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
wgf.test(formula, data, N = 10^5, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
N |
the number of bootstrap samples. Default is set to 10^5. |
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 with class "owt" containing the following components:
p.value |
the p-value of Weerahandi's generalized F test. |
alpha |
the level of significance to assess the statistical difference. |
method |
the character string "Weerahandi's Generalized F Test". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
N |
the number of bootstrap samples. |
The user can contact the author of this code, Sam Weerahandi, for additional information about the method and the code.
Sam Weerahandi
Weerahandi, S. (1995). ANOVA under Unequal Error Variances. Biometrics, 589-599.
library(onewaytests) wgf.test(Sepal.Length ~ Species, data = iris) out <- wgf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
library(onewaytests) wgf.test(Sepal.Length ~ Species, data = iris) out <- wgf.test(Sepal.Length ~ Species, data = iris) paircomp(out)
wt.test
performs Welch's t-test for two samples.
wt.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
wt.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
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 with class "owt" containing the following components:
statistic |
the Welch's t-test statistic. |
parameter |
the parameter(s) of the approximate t distribution of the test statistic. |
p.value |
the p-value of the test. |
alpha |
the level of significance to assess the statistical difference. |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
Osman Dag
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) wt.test(aadt ~ control, data = AADT)
library(AID) data(AADT) library(onewaytests) describe(aadt ~ control, data = AADT) wt.test(aadt ~ control, data = AADT)