Performs Shirley's nonparametric equivalent of William's test for contrasting increasing dose levels of a treatment.
shirleyWilliamsTest(x, ...)# S3 method for default
shirleyWilliamsTest(x, g, nperm = 1000, ...)
# S3 method for formula
shirleyWilliamsTest(formula, data, subset, na.action,
nperm = 1000, ...)
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.
number of permutations for the assymptotic permutation test.
Defaults to 1000
.
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.
The Shirley-William test is a non-parametric step-down trend test for testing several treatment levels
with a zero control. Let there be \(k\) groups including the control and let
the zero dose level be indicated with \(i = 0\) and the highest
dose level with \(i = m\), then the following m = k - 1
hypotheses are tested:
$$ \begin{array}{ll} \mathrm{H}_{m}: \theta_0 = \theta_1 = \ldots = \theta_m, & \mathrm{A}_{m} = \theta_0 \le \theta_1 \le \ldots \theta_m, \theta_0 < \theta_m \\ \mathrm{H}_{m-1}: \theta_0 = \theta_1 = \ldots = \theta_{m-1}, & \mathrm{A}_{m-1} = \theta_0 \le \theta_1 \le \ldots \theta_{m-1}, \theta_0 < \theta_{m-1} \\ \vdots & \vdots \\ \mathrm{H}_{1}: \theta_0 = \theta_1, & \mathrm{A}_{1} = \theta_0 < \theta_1\\ \end{array} $$
The procedure starts from the highest dose level (\(m\)) to the the lowest dose level (\(1\)) and stops at the first non-significant test. The consequent lowest effect dose is the treatment level of the previous test number.
The p-values are estimated through an assymptotic boot-strap method. The p-values for H\(_1\) are calculated from the t distribution with infinite degree of freedom. This function has included the modifications as recommended by Williams (1986).
Shirley, E., (1977), Nonparametric Equivalent of Williams Test for Contrasting Increasing Dose Levels of a Treatment. Biometrics, 33, 386--389.
Williams, D.A. (1986), Note on Shirley's nonparametric test for comparing several dose levels with a zero-dose control. Biometrics 42, 183--186.
# NOT RUN {
## Example from Sachs (1997, p. 402)
x <- c(106, 114, 116, 127, 145,
110, 125, 143, 148, 151,
136, 139, 149, 160, 174)
g <- gl(3,5)
levels(g) <- c("0", "I", "II")
## Shirley-Williams Test
shirleyWilliamsTest(x ~ g)
# }
Run the code above in your browser using DataLab