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}
$$
Let \(R_{ij}\) be the rank of \(X_{ij}\),
where \(X_{ij}\) is jointly ranked
from \(\left\{1, 2, \ldots, N \right\}, ~~ N = \sum_{i=1}^k n_i\),
then the test statistic is
$$
t_{i} = \frac{\max_{1 \le u \le i} \left(\sum_{j=u}^i n_j \bar{R}_j / \sum_{j=u}^i n_j \right) - \bar{R}_0}
{\sigma_{R_i} \sqrt{1/n_i + 1/n_0}},
$$
with expected variance of
$$
\sigma_{R_i}^2 = N_i \left(N_i + 1 \right) / 12 - T_i,
$$
where \(N_i = n_0 + n_1 + n_2 + \ldots + n_i\) and
\(T_i\) the ties for the \(i\)-th comparison is given by
$$
T_i = \sum_{j=1}^i \frac{t_j^3 - t_j}{12 \left(N_i - 1\right)}.
$$
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. This function has
included the modifications as recommended by Williams (1986), i.e.
the data are re-ranked for each of the \(i\)-th comparison.
If method = "look-up"
is selected, the function does not return p-values.
Instead the critical \(t'_{i,v,\alpha}\)-values
as given in the tables of Williams (1972) for \(\alpha = 0.05\) (one-sided)
are looked up according to the degree of freedoms (\(v = \infty\)) and the order number of the
dose level (\(i\)) and (potentially) modified according to the given extrapolation
coefficient \(\beta\).
Non tabulated values are linearly interpolated with the function
approx
.
For the comparison of the first dose level (i = 1) with the control, the critical
z-value from the standard normal distribution is used (Normal
).
If method = "boot"
, 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.