qn.test.combined | R Documentation |
This function combines several independent rank score k
-sample tests
into one overall test of the hypothesis that the independent samples within
each block come from a common unspecified distribution, while the common
distributions may vary from block to block.
qn.test.combined(..., data = NULL, test = c("KW", "vdW", "NS"),
method = c("asymptotic", "simulated", "exact"),
dist = FALSE, Nsim = 10000)
... |
Either a sequence of several lists, say or a list of such lists, or a formula, like y ~ g | b, where y is a numeric response vector, g is a factor with levels indicating different treatments and b is a factor indicating different blocks; y, g, b have same length. y is split separately for each block level into separate samples according to the g levels. The same g level may occur in different blocks. The variable names may correspond to variables in an optionally supplied data frame via the data = argument. |
data |
= an optional data frame providing the variables in formula input |
test |
= where
For the above scores |
method |
=
of the final distribution vector, were |
dist |
Otherwise, |
Nsim |
|
The rank score QN
criterion QN_i
for the i
-th block of
k_i
samples,
is used to test the hypothesis that the samples in the i
-th block all come
from the same but unspecified continuous distribution function F_i(x)
.
See qn.test
for the definition of the QN
criterion
and the exact calculation of its null distribution.
The combined QN
criterion QN_{\rm comb} = QN_1 + \ldots + QN_M
is used to simultaneously test whether the samples
in block i come from the same continuous distribution function F_i(x)
.
However, the unspecified common distribution function F_i(x)
may change
from block to block.
The k
for each block of k
independent samples may change from block to block.
The asymptotic approximating chi-square distribution has
f = (k_1-1)+\ldots+(k_M-1)
degrees of freedom.
NA values are removed and the user is alerted with the total NA count. It is up to the user to judge whether the removal of NA's is appropriate.
The continuity assumption can be dispensed with if we deal with
independent random samples, or if randomization was used in allocating
subjects to samples or treatments, independently from block to block, and if
the asymptotic, simulated or exact P
-values are viewed conditionally, given the tie patterns
within each block. Under such randomization any conclusions
are valid only with respect to the blocks of subjects that were randomly allocated.
In case of ties the average rank scores are used across tied observations within each block.
A list of class kSamples
with components
test.name |
|
M |
number of blocks of samples being compared |
n.samples |
list of |
nt |
vector of length |
n.ties |
vector giving the number of ties in each the |
qn.list |
list of |
qn.c |
2 (or 3) vector containing the observed
|
warning |
logical indicator, |
null.dist |
simulated or enumerated null distribution of the
|
method |
The |
Nsim |
The number of simulations used for each block of samples. |
These tests are useful in analyzing treatment effects of shift nature in randomized (incomplete) block experiments.
Lehmann, E.L. (2006), Nonparametric, Statistical Methods Based on Ranks, Springer Verlag, New York. Ch. 6, Sec. 5D.
qn.test
## Create two lists of sample vectors.
x1 <- list( c(1, 3, 2, 5, 7), c(2, 8, 1, 6, 9, 4), c(12, 5, 7, 9, 11) )
x2 <- list( c(51, 43, 31, 53, 21, 75), c(23, 45, 61, 17, 60) )
# and a corresponding data frame datx1x2
x1x2 <- c(unlist(x1),unlist(x2))
gx1x2 <- as.factor(c(rep(1,5),rep(2,6),rep(3,5),rep(1,6),rep(2,5)))
bx1x2 <- as.factor(c(rep(1,16),rep(2,11)))
datx1x2 <- data.frame(A = x1x2, G = gx1x2, B = bx1x2)
## Run qn.test.combined.
set.seed(2627)
qn.test.combined(x1, x2, method = "simulated", Nsim = 1000)
# or with same seed
# qn.test.combined(list(x1, x2), method = "simulated", Nsim = 1000)
# or qn.test.combined(A~G|B,data=datx1x2,method="simulated",Nsim=1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.