Rev 59039 | Rev 74265 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/stats/man/fligner.test.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Team% Distributed under GPL 2 or later\name{fligner.test}\alias{fligner.test}\alias{fligner.test.default}\alias{fligner.test.formula}\title{Fligner-Killeen Test of Homogeneity of Variances}\description{Performs a Fligner-Killeen (median) test of the null that thevariances in each of the groups (samples) are the same.}\usage{fligner.test(x, \dots)\method{fligner.test}{default}(x, g, \dots)\method{fligner.test}{formula}(formula, data, subset, na.action, \dots)}\arguments{\item{x}{a numeric vector of data values, or a list of numeric datavectors.}\item{g}{a vector or factor object giving the group for thecorresponding elements of \code{x}.Ignored if \code{x} is a list.}\item{formula}{a formula of the form \code{lhs ~ rhs} where \code{lhs}gives the data values and \code{rhs} the corresponding groups.}\item{data}{an optional matrix or data frame (or similar: see\code{\link{model.frame}}) containing the variables in theformula \code{formula}. By default the variables are taken from\code{environment(formula)}.}\item{subset}{an optional vector specifying a subset of observationsto be used.}\item{na.action}{a function which indicates what should happen whenthe data contain \code{NA}s. Defaults to\code{getOption("na.action")}.}\item{\dots}{further arguments to be passed to or from methods.}}\details{If \code{x} is a list, its elements are taken as the samples to becompared for homogeneity of variances, and hence have to be numericdata vectors. In this case, \code{g} is ignored, and one can simplyuse \code{fligner.test(x)} to perform the test. If the samples arenot yet contained in a list, use \code{fligner.test(list(x, ...))}.Otherwise, \code{x} must be a numeric data vector, and \code{g} mustbe a vector or factor object of the same length as \code{x} giving thegroup for the corresponding elements of \code{x}.The Fligner-Killeen (median) test has been determined in a simulationstudy as one of the many tests for homogeneity of variances which ismost robust against departures from normality, see Conover, Johnson &Johnson (1981). It is a \eqn{k}-sample simple linear rank which usesthe ranks of the absolute values of the centered samples and weights\eqn{a(i) = \mathrm{qnorm}((1 + i/(n+1))/2)}{a(i) = qnorm((1 +i/(n+1))/2)}. The version implemented here uses median centering ineach of the samples (F-K:med \eqn{X^2} in the reference).}\value{A list of class \code{"htest"} containing the following components:\item{statistic}{the Fligner-Killeen:med \eqn{X^2} test statistic.}\item{parameter}{the degrees of freedom of the approximate chi-squareddistribution of the test statistic.}\item{p.value}{the p-value of the test.}\item{method}{the character string\code{"Fligner-Killeen test of homogeneity of variances"}.}\item{data.name}{a character string giving the names of the data.}}\references{William J. Conover, Mark E. Johnson and Myrle M. Johnson (1981).A comparative study of tests for homogeneity of variances, withapplications to the outer continental shelf bidding data.\emph{Technometrics} \bold{23}, 351--361.}\seealso{\code{\link{ansari.test}} and \code{\link{mood.test}} for rank-basedtwo-sample test for a difference in scale parameters;\code{\link{var.test}} and \code{\link{bartlett.test}} for parametrictests for the homogeneity of variances.}% FIXME: could use something more interesting here\examples{require(graphics)plot(count ~ spray, data = InsectSprays)fligner.test(InsectSprays$count, InsectSprays$spray)fligner.test(count ~ spray, data = InsectSprays)## Compare this to bartlett.test()}\keyword{htest}