Performs Baumgartner-Wei<U+00DF>-Schindler many-to-one comparison test.
bwsManyOneTest(x, ...)# S3 method for default
bwsManyOneTest(x, g, alternative = c("two.sided", "greater",
"less"), method = c("BWS", "Murakami", "Neuhauser"),
p.adjust.method = p.adjust.methods, ...)
# S3 method for formula
bwsManyOneTest(formula, data, subset, na.action,
alternative = c("two.sided", "greater", "less"), method = c("BWS",
"Murakami", "Neuhauser"), p.adjust.method = p.adjust.methods, ...)
a numeric vector of data values, or a list of numeric data vectors.
further arguments to be passed to or from methods.
a vector or factor object giving the group for the
corresponding elements of "x"
.
Ignored with a warning if "x"
is a list.
the alternative hypothesis. Defaults to two.sided
.
a character string specifying the test statistic to use. Defaults to BWS
.
method for adjusting p values (see p.adjust
).
a formula of the form response ~ group
where
response
gives the data values and group
a vector or
factor of the corresponding groups.
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)
.
an optional vector specifying a subset of observations to be used.
a function which indicates what should happen when
the data contain NA
s. Defaults to getOption("na.action")
.
A list with class "PMCMR"
containing the following components:
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
lower-triangle matrix of the estimated quantiles of the pairwise test statistics.
lower-triangle matrix of the p-values for the pairwise tests.
a character string describing the alternative hypothesis.
a character string describing the method for p-value adjustment.
a data frame of the input data.
a string that denotes the test distribution.
For many-to-one comparisons (pairwise comparisons with one control)
in an one-factorial layout with non-normally distributed
residuals Baumgartner-Wei<U+00DF>-Schindler's non-parametric test can be performed.
Let there be
This function is a wrapper function that sequentially
calls {link[BWStest]{bws_stat}
and {link[BWStest]{bws_cdf}
for each pair. For the default test method ("BWS"
) the original
Baumgartner-Wei<U+00DF>-Schindler test statistic B and its corresponding Pr(>|B|)
is calculated. For method == "BWS"
only a two-sided test is possible.
For method == "Murakami"
the modified BWS statistic
denoted B* and its corresponding Pr(>|B*|) is computed by sequentially calling
{link[BWStest]{murakami_stat}
and {link[BWStest]{murakami_cdf}
.
For method == "Murakami"
only a two-sided test is possible.
If alternative == "greater"
then the alternative, if one
population is stochastically larger than the other is tested:
H{link[BWStest]{murakami_stat}
and {link[BWStest]{murakami_cdf}
with flavor = 2
.
The p-values can be adjusted to account for Type I error
inflation using any method as implemented in p.adjust
.
Baumgartner, W., Weiss, P., Schindler, H. (1998), A nonparametric test for the general two-sample problem, Biometrics 54, 1129--1135.
Murakami, H. (2006) K-sample rank test based on modified Baumgartner statistic and its power comparison, J. Jpn. Comp. Statist. 19, 1--13.
Neuh<U+00E4>user, M. (2001) One-side two-sample and trend tests based on a modified Baumgartner-Weiss-Schindler statistic. Journal of Nonparametric Statistics, 13, 729--739.
# NOT RUN {
out <- bwsManyOneTest(weight ~ group, PlantGrowth, p.adjust="holm")
summary(out)
## A two-sample test
set.seed(1245)
x <- c(rnorm(20), rnorm(20,0.3))
g <- gl(2, 20)
summary(bwsManyOneTest(x ~ g, alternative = "less", p.adjust="none"))
summary(bwsManyOneTest(x ~ g, alternative = "greater", p.adjust="none"))
# }
# NOT RUN {
## Check with the implementation in package BWStest
BWStest::bws_test(x=x[g==1], y=x[g==2], alternative = "less")
BWStest::bws_test(x=x[g==1], y=x[g==2], alternative = "greater")
# }
Run the code above in your browser using DataLab