clusWilcox.test(x, ...)
"clusWilcox.test"(formula, data = parent.frame(), subset = NULL, na.action = na.omit, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, exact = FALSE, B = 2000, method = c("rgl", "ds"), ...)
"clusWilcox.test"(x, y = NULL, cluster = NULL, group = NULL, stratum = NULL, data = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, exact = FALSE, B = 2000, method = c("rgl", "ds"), ...)
lhs ~ rhs
where the
lhs
is the measurements and
the rhs
is of the form group + cluster
(x1) +
stratum
(x2) for clustered rank sum test, where
x1
and x2
are cluster id and stratum id in the
data frame data
. For clustered signed rank test, the
rhs
only contains cluster
x1.getOption("na.action")
."two sided"
(default),
"greater"
or "less"
. You can specify just the
initial letter.FALSE
, then test based on
large-sample theory is carried out. If it is set as
TRUE
, then a permutation test is carried out. There are
two available permutation tests: exact permutation test is available for
rgl
signed rank test and rgl
rank sum test when
treatment is assigned at cluster level, random permutation
test is available for all tests. For more details look at the
description of the argument B
."rgl"
or "ds"
.rgl
rank sum test when treatment is assigned at
cluster level."htest"
containing the following components,
for different test the components may vary:
for different test the components may vary:formula
: S3
method for class 'formula' default
: Default S3
method.
The default of cluster
id is that there is one member in
each cluster. Both balanced data (identical cluster size) and
unbalanced data (different cluster sizes) are
supported in all tests provided in this package. For clustered
rank sum test, the data can either have treatment assigned at
cluster level or individual level.
If both x
and y
are given or only x
is given
and paired
is TRUE
, a clustered Wilcoxon signed
rank test of the null that the distribution of x - y
(paired sample) or of x
(one sample) is symmetric about
mu
is performed.
Otherwise, if only x
is given and paired
is
FALSE
, a Wilcoxon rank sum test is performed. In this case,
measurements from different treatment groups should be combined in
x
and the group
variable is required. When there
are two treatment groups, the null is that the distributions of
values from the two groups differ by a location shift of mu
and the alternative is that they differ by some other location
shift. When there are m
(>= 2) treatment groups, ds
method can test if the location of the m
groups are
identical or not.
For RGL rank sum test when treatment is assigned at cluster level,
an extra stratification variable is allowed through stratum
.
The exact test is only available for RGL signed rank test and RGL rank sum test when treatment is assigned at cluster level.
Bernard Rosner, Robert J. Glynn, Mei-Ling T. Lee (2003) Incorporation of Clustering Effects for the Wilcoxon Rank Sum Test: A Large-Sample Approach. Biometrics, 59, 1089-1098.
Bernard Rosner, Robert J. Glynn, Mei-Ling T. Lee (2006) Extension of the Rank Sum Test for Clustered Data: Two-Group Comparisons with Group. Biometrics, 62, 1251-1259.
Somnath Datta, Glen A. Satten (2005) Rank-Sum Tests for Clustered Data. Journal of the American Statistical Association, 100, 908-915.
Somath Datta, Glen A. Satten (2008) A Signed-Rank test for Clustered Data. Biometric, 64, 501-507.
## Clustered signed rank test using RGL method.
data(crsd)
clusWilcox.test(z, cluster = id, data = crsd, paired = TRUE)
## or
clusWilcox.test(z ~ cluster(id), data = crsd, paired = TRUE)
## Not run: clusWilcox.test(z, cluster = id, data = crsd)
# ## Default is rank sum test. The group variable is required.## End(Not run)
## Clustered rank sum test using RGL method.
data(crd)
clusWilcox.test(z ~ group + cluster(id), data = crd)
## or
clusWilcox.test(z, cluster = id, group = group, data = crd)
Run the code above in your browser using DataLab