Performs Fligner-Wolfe non-parametric test for simultaneous testing of several locations of treatment groups against the location of the control group.
flignerWolfeTest(x,...)## Default S3 method:flignerWolfeTest( x, g, alternative = c("greater","less"), dist = c("Wilcoxon","Normal"),...)## S3 method for class 'formula'flignerWolfeTest( formula, data, subset, na.action, alternative = c("greater","less"), dist = c("Wilcoxon","Normal"),...)
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".
dist: the test distribution. Defaults to "Wilcoxon".
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
For a one-factorial layout with non-normally distributed residuals the Fligner-Wolfe test can be used.
Let there be k−1-treatment groups and one control group, then the null hypothesis, H0:θi−θc=0(1≤i≤k−1)
is tested against the alternative (greater), A1:θi−θc>0(1≤i≤k−1), with at least one inequality being strict.
Let nc denote the sample size of the control group, Nt=∑i=1k−1ni the sum of all treatment sample sizes and N=Nt+nc. The test statistic without taken ties into account is
W=j=1∑k−1i=1∑nirij−2Nt(Nt+1)
with rij the rank of variable xij. The null hypothesis is rejected, if W>Wα,m,n with m=Nt and n=nc.
In the presence of ties, the statistic is
z^=sWW−ncNt/2,
where
sW=12N(N−1)ncNtj=1∑gtj(tj2−1),
with g the number of tied groups and tj
the number of tied values in the jth group. The null hypothesis is rejected, if z^>zα (as cited in EPA 2006).
If dist = Wilcoxon, then the p-values are estimated from the Wilcoxon
distribution, else the Normal distribution is used. The latter can be used, if ties are present.
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).