## Testing equality of two variances

Let `$X_1, X_2, \cdots, X_{n_1}$`

be a random sample of size $n_1$ from a population with variance $\sigma^2_1$ and `$Y_1,Y_2, \cdots, Y_{n_2}$`

be a random samples of sizes $n_2$ from a population with variance $\sigma^2_2$.

Let $\overline{x} = \frac{1}{n_1} \sum X_i$ and $s_1^2 =\frac{1}{n_1-1}\sum (X_i -\overline{x})^2$ be the sample mean and sample variance of first sample respectively.

Let $\overline{y} = \frac{1}{n_2} \sum Y_i$ and $s_2^2 =\frac{1}{n_2-1}\sum (Y_i -\overline{y})^2$ be the sample mean and sample variance of second sample respectively.

The hypothesis testing problem can be set up as:

Situation | Hypothesis Testing Problem |
---|---|

Situation A : | $H_0: \sigma^2_1=\sigma^2_2$ against $H_a : \sigma^2_1 < \sigma^2_2$ (Left-tailed) |

Situation B : | $H_0: \sigma^2_1=\sigma^2_2$ against $H_a : \sigma^2_1 > \sigma^2_2$ (Right-tailed) |

Situation C : | $H_0: \sigma^2_1=\sigma^2_2$ against $H_a : \sigma^2_1 \neq \sigma^2_2$ (Two-tailed) |

## Formula

The test statistic for testing above $H_0:\sigma^2_1=\sigma^2_2$ is

`$F =\frac{s_1^2}{s_2^2}$`

where

`$s_1^2 =\frac{1}{n_1-1}\sum (X_i -\overline{x})^2$`

is the sample variance of first sample,`$s_2^2 =\frac{1}{n_2-1}\sum (Y_i -\overline{y})^2$`

is the sample variance of second sample.

The test statistic $F$ follows $F$ distribution with $n_1-1$ and $n_2-1$ degrees of freedom.