fligner.test
FlignerKilleen Test of Homogeneity of Variances
Performs a FlignerKilleen (median) test of the null that the variances in each of the groups (samples) are the same.
 Keywords
 htest
Usage
fligner.test(x, ...)
"fligner.test"(x, g, ...)
"fligner.test"(formula, data, subset, na.action, ...)
Arguments
 x
 a numeric vector of data values, or a list of numeric data vectors.
 g
 a vector or factor object giving the group for the
corresponding elements of
x
. Ignored ifx
is a list.  formula
 a formula of the form
lhs ~ rhs
wherelhs
gives the data values andrhs
the corresponding groups.  data
 an optional matrix or data frame (or similar: see
model.frame
) containing the variables in the formulaformula
. By default the variables are taken fromenvironment(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
NA
s. Defaults togetOption("na.action")
.  ...
 further arguments to be passed to or from methods.
Details
If x
is a list, its elements are taken as the samples to be
compared for homogeneity of variances, and hence have to be numeric
data vectors. In this case, g
is ignored, and one can simply
use fligner.test(x)
to perform the test. If the samples are
not yet contained in a list, use fligner.test(list(x, ...))
.
Otherwise, x
must be a numeric data vector, and g
must
be a vector or factor object of the same length as x
giving the
group for the corresponding elements of x
.
The FlignerKilleen (median) test has been determined in a simulation study as one of the many tests for homogeneity of variances which is most robust against departures from normality, see Conover, Johnson & Johnson (1981). It is a $k$sample simple linear rank which uses the ranks of the absolute values of the centered samples and weights $a(i) = qnorm((1 + i/(n+1))/2)$. The version implemented here uses median centering in each of the samples (FK:med $X^2$ in the reference).
Value

A list of class
 statistic
 the FlignerKilleen:med $X^2$ test statistic.
 parameter
 the degrees of freedom of the approximate chisquared distribution of the test statistic.
 p.value
 the pvalue of the test.
 method
 the character string
"FlignerKilleen test of homogeneity of variances"
.  data.name
 a character string giving the names of the data.
"htest"
containing the following components:
References
William J. Conover, Mark E. Johnson and Myrle M. Johnson (1981). A comparative study of tests for homogeneity of variances, with applications to the outer continental shelf bidding data. Technometrics 23, 351361.
See Also
ansari.test
and mood.test
for rankbased
twosample test for a difference in scale parameters;
var.test
and bartlett.test
for parametric
tests for the homogeneity of variances.
Examples
library(stats)
require(graphics)
plot(count ~ spray, data = InsectSprays)
fligner.test(InsectSprays$count, InsectSprays$spray)
fligner.test(count ~ spray, data = InsectSprays)
## Compare this to bartlett.test()