Testing against Ordered Alternatives (Chacko's Test)
Testing against Ordered Alternatives (Chacko's Test)
Performs Chacko's test for testing against ordered alternatives.
chackoTest(x,...)## Default S3 method:chackoTest(x, g, alternative = c("greater","less"),...)## S3 method for class 'formula'chackoTest(formula, data, subset, na.action, alternative = alternative,...)
Arguments
x: a numeric vector of data values, or a list of numeric data vectors.
...: further arguments to be passed to or from methods.
g: a vector or factor object giving the group for the corresponding elements of "x". Ignored with a warning if "x" is a list.
alternative: the alternative hypothesis. Defaults to greater.
formula: a formula of the form response ~ group where response gives the data values and group a vector or factor of the corresponding groups.
data: 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).
subset: an optional vector specifying a subset of observations to be used.
na.action: a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").
Returns
A list with class "htest" containing the following components:
method: a character string indicating what type of test was performed.
data.name: a character string giving the name(s) of the data.
statistic: the estimated quantile of the test statistic.
p.value: the p-value for the test.
parameter: the parameters of the test statistic, if any.
alternative: a character string describing the alternative hypothesis.
estimates: the estimates, if any.
null.value: the estimate under the null hypothesis, if any.
Details
The null hypothesis, H0:θ1=θ2=…=θk
is tested against a simple order hypothesis, Hc("_\\mathrm{A}: \\theta_1 \\le \\theta_2 \\le \\ldots \\le\n", "thetak,theta1<thetak").
Let Rij be the rank of Xij, where Xij is jointly ranked from {1,2,…,N},N=∑i=1kni, then the test statistic is calculated as
H=σR21i=1∑kni(R∗ˉi−Rˉ),
where R∗ˉi is the isotonic mean of the i-th group and σR2=N(N+1)/12 the expected variance (without ties). H0 is rejected, if H>χv,α2 with v=k−1 degree of freedom. The p-values are estimated from the chi-square distribution.
Note
Factor labels for g must be assigned in such a way, that they can be increasingly ordered from zero-dose control to the highest dose level, e.g. integers {0, 1, 2, ..., k} or letters {a, b, c, ...}. Otherwise the function may not select the correct values for intended zero-dose control.
It is safer, to i) label the factor levels as given above, and to ii) sort the data according to increasing dose-levels prior to call the function (see order, factor).
The function does neither check nor correct for ties.
Source
The source code for the application of the pool adjacent violators theorem to calculate the isotonic means was taken from the file "pava.f", which is included in the package Iso:
The file "pava.f" is a Ratfor modification of Algorithm AS 206.1:
Bril, G., Dykstra, R., Pillers, C., Robertson, T. (1984) Statistical Algorithms: Algorithm AS 206: Isotonic Regression in Two Independent Variables, Appl Statist
34 , 352--357.
The Algorith AS 206 is available from StatLib https://lib.stat.cmu.edu/apstat/. The Royal Statistical Society holds the copyright to these routines, but has given its permission for their distribution provided that no fee is charged.