Rev 7561 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{var.test}\alias{var.test}\title{F Test to Compare Two Variances}\description{Performs an F test to compare the variances of two samples from normalpopulations.}\usage{var.test(x, y, ratio = 1, alternative = c("two.sided", "less", "greater"),conf.level = 0.95)}\arguments{\item{x, y}{numeric vectors of data values, or fitted linear modelobjects (inheriting from class \code{"lm"}).}\item{ratio}{the hypothesized ratio of the population variances of\code{x} and \code{y}.}\item{alternative}{the alternative hypothesis; must be one of\code{"two.sided"} (default), \code{"greater"} or \code{"less"}. Youcan specify just the initial letter.}\item{conf.level}{confidence level for the returned confidence interval.}}\details{The null hypothesis is that the ratio of the variances of thepopulations from which \code{x} and \code{y} were drawn, or in thedata to which the linear models \code{x} and \code{y} were fitted, isequal to \code{ratio}.}\value{A list with class \code{"htest"} containing the following components:\item{statistic}{the value of the F test statistic.}\item{parameter}{the degrees of the freedom of the F distribtion ofthe test statistic.}\item{p.value}{the p-value of the test.}\item{conf.int}{a confidence interval for the ratio of the populationvariances.}\item{estimate}{the ratio of the sample variances of \code{x} and\code{y}.}\item{null.value}{the ratio of population variances under the null.}\item{alternative}{a character string describing the alternativehypothesis.}\item{method}{the string \code{"F test to compare two variances"}.}\item{data.name}{a character string giving the names of the data.}}\seealso{\code{\link{bartlett.test}} for testing homogeneity of variances inmore than two samples from normal distributions;\code{\link{ansari.test}} and \code{\link{mood.test}} for two rankbased (nonparametric) two-sample tests for difference in scale.}\examples{x <- rnorm(50, mean = 0, sd = 2)y <- rnorm(30, mean = 1, sd = 1)var.test(x, y) # Do x and y have the same variance?var.test(lm(x ~ 1), lm(y ~ 1)) # The same.}\keyword{htest}