Last chance! 50% off unlimited learning
Sale ends in
Performs the non-parametric Hayter-Stone all-pairs procedure to test against monotonically increasing alternatives.
hsAllPairsTest(x, ...)# S3 method for default
hsAllPairsTest(
x,
g,
alternative = c("greater", "less"),
method = c("look-up", "boot"),
nperm = 10000,
...
)
# S3 method for formula
hsAllPairsTest(
formula,
data,
subset,
na.action,
alternative = c("greater", "less"),
method = c("look-up", "boot"),
nperm = 10000,
...
)
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 greater
.
a character string specifying the test statistic to use.
Defaults to "look-up"
that uses published Table values of Williams (1972).
number of permutations for the asymptotic permutation test.
Defaults to 1000
. Ignored, if method = "look-up"
.
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")
.
Either a list of class "PMCMR"
or a
list with class "osrt"
that contains the following
components:
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
the estimated statistic(s)
critical values for
a character string describing the alternative hypothesis.
the parameter(s) of the test distribution.
a string that denotes the test distribution.
There are print and summary methods available.
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.
Let
The statistic for all-pairs comparisons is calculated as,
with the Mann-Whittney counts:
Under the large sample approximation, the test statistic
If method = "look-up"
the function will not return
p-values. Instead the critical h-values
as given in the tables of Hayter (1990) for
If method = "boot"
an asymetric permutation test
is conducted and
Hayter, A. J.(1990) A One-Sided Studentised Range Test for Testing Against a Simple Ordered Alternative, Journal of the American Statistical Association 85, 778--785.
Hayter, A.J., Stone, G. (1991) Distribution free multiple comparisons for monotonically ordered treatment effects. Austral J Statist 33, 335--346.
# NOT RUN {
## Example from Shirley (1977)
## Reaction times of mice to stimuli to their tails.
x <- c(2.4, 3, 3, 2.2, 2.2, 2.2, 2.2, 2.8, 2, 3,
2.8, 2.2, 3.8, 9.4, 8.4, 3, 3.2, 4.4, 3.2, 7.4, 9.8, 3.2, 5.8,
7.8, 2.6, 2.2, 6.2, 9.4, 7.8, 3.4, 7, 9.8, 9.4, 8.8, 8.8, 3.4,
9, 8.4, 2.4, 7.8)
g <- gl(4, 10)
## Shirley's test
## one-sided test using look-up table
shirleyWilliamsTest(x ~ g, alternative = "greater")
## Chacko's global hypothesis test for 'greater'
chackoTest(x , g)
## post-hoc test, default is standard normal distribution (NPT'-test)
summary(chaAllPairsNashimotoTest(x, g, p.adjust.method = "none"))
## same but h-distribution (NPY'-test)
chaAllPairsNashimotoTest(x, g, dist = "h")
## NPM-test
NPMTest(x, g)
## Hayter-Stone test
hayterStoneTest(x, g)
## all-pairs comparisons
hsAllPairsTest(x, g)
# }
Run the code above in your browser using DataLab