EVOLUTION-MANAGER
Edit File: var.test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: F Test to Compare Two Variances</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for var.test {stats}"><tr><td>var.test {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>F Test to Compare Two Variances</h2> <h3>Description</h3> <p>Performs an F test to compare the variances of two samples from normal populations. </p> <h3>Usage</h3> <pre> var.test(x, ...) ## Default S3 method: var.test(x, y, ratio = 1, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, ...) ## S3 method for class 'formula' var.test(formula, data, subset, na.action, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, y</code></td> <td> <p>numeric vectors of data values, or fitted linear model objects (inheriting from class <code>"lm"</code>).</p> </td></tr> <tr valign="top"><td><code>ratio</code></td> <td> <p>the hypothesized ratio of the population variances of <code>x</code> and <code>y</code>.</p> </td></tr> <tr valign="top"><td><code>alternative</code></td> <td> <p>a character string specifying the alternative hypothesis, must be one of <code>"two.sided"</code> (default), <code>"greater"</code> or <code>"less"</code>. You can specify just the initial letter.</p> </td></tr> <tr valign="top"><td><code>conf.level</code></td> <td> <p>confidence level for the returned confidence interval.</p> </td></tr> <tr valign="top"><td><code>formula</code></td> <td> <p>a formula of the form <code>lhs ~ rhs</code> where <code>lhs</code> is a numeric variable giving the data values and <code>rhs</code> a factor with two levels giving the corresponding groups.</p> </td></tr> <tr valign="top"><td><code>data</code></td> <td> <p>an optional matrix or data frame (or similar: see <code><a href="model.frame.html">model.frame</a></code>) containing the variables in the formula <code>formula</code>. By default the variables are taken from <code>environment(formula)</code>.</p> </td></tr> <tr valign="top"><td><code>subset</code></td> <td> <p>an optional vector specifying a subset of observations to be used.</p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>a function which indicates what should happen when the data contain <code>NA</code>s. Defaults to <code>getOption("na.action")</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments to be passed to or from methods.</p> </td></tr> </table> <h3>Details</h3> <p>The null hypothesis is that the ratio of the variances of the populations from which <code>x</code> and <code>y</code> were drawn, or in the data to which the linear models <code>x</code> and <code>y</code> were fitted, is equal to <code>ratio</code>. </p> <h3>Value</h3> <p>A list with class <code>"htest"</code> containing the following components: </p> <table summary="R valueblock"> <tr valign="top"><td><code>statistic</code></td> <td> <p>the value of the F test statistic.</p> </td></tr> <tr valign="top"><td><code>parameter</code></td> <td> <p>the degrees of the freedom of the F distribution of the test statistic.</p> </td></tr> <tr valign="top"><td><code>p.value</code></td> <td> <p>the p-value of the test.</p> </td></tr> <tr valign="top"><td><code>conf.int</code></td> <td> <p>a confidence interval for the ratio of the population variances.</p> </td></tr> <tr valign="top"><td><code>estimate</code></td> <td> <p>the ratio of the sample variances of <code>x</code> and <code>y</code>.</p> </td></tr> <tr valign="top"><td><code>null.value</code></td> <td> <p>the ratio of population variances under the null.</p> </td></tr> <tr valign="top"><td><code>alternative</code></td> <td> <p>a character string describing the alternative hypothesis.</p> </td></tr> <tr valign="top"><td><code>method</code></td> <td> <p>the character string <code>"F test to compare two variances"</code>.</p> </td></tr> <tr valign="top"><td><code>data.name</code></td> <td> <p>a character string giving the names of the data.</p> </td></tr> </table> <h3>See Also</h3> <p><code><a href="bartlett.test.html">bartlett.test</a></code> for testing homogeneity of variances in more than two samples from normal distributions; <code><a href="ansari.test.html">ansari.test</a></code> and <code><a href="mood.test.html">mood.test</a></code> for two rank based (nonparametric) two-sample tests for difference in scale. </p> <h3>Examples</h3> <pre> 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. </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>