Title: | Gabriel Multiple Comparison Test and Plot the Confidence Interval on Barplot |
---|---|
Description: | Analyze multi-level one-way experimental designs where there are unequal sample sizes and population variance homogeneity can not be assumed. To conduct the Gabriel test <doi:10.2307/2286265>, create two vectors: one for your observations and one for the factor level of each observation. The function, rgabriel, conduct the test and save the output as a vector to input into the gabriel.plot function, which produces a confidence interval plot for Multiple Comparison. |
Authors: | Miao YU [aut, cre] |
Maintainer: | Miao YU <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.9 |
Built: | 2025-02-19 04:43:29 UTC |
Source: | https://github.com/yufree/rgabriel |
Functions for conducting and plotting Gabriel's (1978) multiple comparison test accounting for unequal variance and unequal sample sizes.
This package was created to analyze multi-level one-way experimental designs. It is designed to handle vectorized observation and factor data where there are unequal sample sizes and population variance homogeneity can not be assumed.To conduct the Gabriel test, create two vectors: one for your observations and one for the factor level of each observation. The function, rgabriel, conduct the test and save the output as a vector to input into the gabriel.plot function, which produces a confidence interval plot for Multiple Comparison.
More details on the simulation of studentized maximum modulus's distribution from http://cos.name/cn/topic/142002.
Yihui XIE <https://yihui.org/> Miao YU <https://yufree.cn/>
Gabriel, K.R., 1978. A Simple Method of Multiple Comparisons of Means. Journal of the American Statistical Association 73, 724.
Stoline, M.R., Ury, H.K., 1979. Tables of the Studentized Maximum Modulus Distribution and an Application to Multiple Comparisons among Means. Technometrics 21, 87.
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))
Make the Gabriel's barplot, if, and only if, their bar intervals are disjoint, they are differ significantly. This function could also be used to plot error bar when the bar vector is imported as upper or lower margin.
gabriel.plot(x, f, upper, lower = upper, length = 0.1, ...)
gabriel.plot(x, f, upper, lower = upper, length = 0.1, ...)
x |
data vector |
f |
factor vector |
upper |
the upper margin of error bar |
lower |
the upper margin of error bar |
length |
the length of error bar |
... |
Arguments to be passed to methods, such as graphical parameters. |
Miao YU
Gabriel, K.R., 1978. A Simple Method of Multiple Comparisons of Means. Journal of the American Statistical Association 73, 724.
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))
Show the upper or lower confidence interval of Gabriel's barplot.
rgabriel(x, f, a = 0.05)
rgabriel(x, f, a = 0.05)
x |
data vector |
f |
factor vector |
a |
alpha level of mutiple comparison. |
As shown in Gabriel's paper,use M(alpha,k*,v), the upper alpha point of the Studentized Maximum Modulus of k* normals and v df. And this method is a graphical way for visually mutiple comparision.
vstar |
the length of the bar for mutiple comparision |
Yihui XIE
Miao YU
Gabriel, K.R., 1978. A Simple Method of Multiple Comparisons of Means. Journal of the American Statistical Association 73, 724.
Stoline, M.R., Ury, H.K., 1979. Tables of the Studentized Maximum Modulus Distribution and an Application to Multiple Comparisons among Means. Technometrics 21, 87.
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))
# equal numbers g <- c(1:50) f <- c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10)) gabriel.plot(g,f,rgabriel(g,f)) # unequal numbers g <- c(1:40) f <- c(rep(1,3),rep(2,12),rep(3,15),rep(4,5),rep(5,5)) gabriel.plot(g,f,rgabriel(g,f))