jt.test {kSamples} | R Documentation |
Jonckheere-Terpstra k-Sample Test for Increasing Alternatives
Description
The
Jonckheere-Terpstra k-sample test statistic JT is defined
as JT = \sum_{i<j} W_{ij}
where
W_{ij}
is the Mann-Whitney statistic comparing
samples i
and j
, indexed in the order
of the stipulated increasing alternative.
There may be ties in the pooled samples.
Usage
jt.test(..., data = NULL, method=c("asymptotic","simulated","exact"),
dist = FALSE, Nsim = 10000)
Arguments
... |
Either several sample vectors, say
or a list of such sample vectors, or a formula y ~ g, where y contains the pooled sample values and g (same length as y) is a factor with levels identifying the samples to which the elements of y belong, the factor levels reflecting the order under the stipulated alternative, |
data |
= an optional data frame providing the variables in formula y ~ g. |
method |
=
of full enumerations. Otherwise, |
dist |
|
Nsim |
|
Details
The JT statistic
is used to test the hypothesis that the samples all come
from the same but unspecified continuous distribution function F(x)
.
It is specifically aimed at alternatives where the sampled distributions
are stochastically increasing.
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, and if we view
the simulated or exact P
-values conditionally, given the tie pattern
in the pooled samples. Of course, under such randomization any conclusions
are valid only with respect to the group of subjects that were randomly allocated
to their respective samples.
The asymptotic P
-value calculation is valid provided all sample sizes become large.
Value
A list of class kSamples
with components
test.name |
|
k |
number of samples being compared |
ns |
vector |
N |
size of the pooled sample |
n.ties |
number of ties in the pooled sample |
qn |
4 (or 5) vector containing the observed |
warning |
logical indicator, |
null.dist |
simulated or enumerated null distribution
of the test statistic. It is |
method |
the |
Nsim |
the number of simulations used. |
References
Harding, E.F. (1984), An Efficient, Minimal-storage Procedure for Calculating the Mann-Whitney U, Generalized U and Similar Distributions, Appl. Statist. 33 No. 1, 1-6.
Jonckheere, A.R. (1954), A Distribution Free k-sample Test against Ordered Alternatives, Biometrika, 41, 133-145.
Lehmann, E.L. (2006), Nonparametrics, Statistical Methods Based on Ranks, Revised First Edition, Springer Verlag.
Terpstra, T.J. (1952), The Asymptotic Normality and Consistency of Kendall's Test against Trend, when Ties are Present in One Ranking, Indagationes Math. 14, 327-333.
Examples
x1 <- c(1,2)
x2 <- c(1.5,2.1)
x3 <- c(1.9,3.1)
yy <- c(x1,x2,x3)
gg <- as.factor(c(1,1,2,2,3,3))
jt.test(x1, x2, x3,method="exact",Nsim=90)
# or
# jt.test(list(x1, x2, x3), method = "exact", Nsim = 90)
# or
# jt.test(yy ~ gg, method = "exact", Nsim = 90)