## Testing equality of two variances

Many times it is desirable to compare two variances rather than comparing two means. F test is used to compare two population variances or population standard deviations.

In this tutorial we will discuss six steps approach used in hypothesis testing to test whether two population variances are same or not.

## F-Test for 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.

## Assumptions

a. The two populations are independent.

b. The two samples are simple random samples.

c. The two populations are normally distributed.

## Step by Step Procedure

Step by step procedure of $F$ test for equality of two variances is as follows:

### Step 1 State the hypothesis testing problem

The hypothesis testing problem can be structured in any one of the three situations as follows:

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)

### Step 2 Define the test statistic

The test statistic for testing above hypothesis is $$F =\frac{s_1^2}{s_2^2}$$

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

### Step 3 Specify the level of significance

Specify the value of level of significance $\alpha$.

### Step 4 Determine the critical values

For the specified value of $\alpha$ determine the critical region depending upon the alternative hypothesis.

• For left-tailed alternative hypothesis: Find the $t$-critical value using \begin{aligned} P(F<F_{1-\alpha, n_1-1, n_2-1}) = \alpha. \end{aligned}
• For right-tailed alternative hypothesis: \begin{aligned} P(F > F_{\alpha,n_1-1,n_2-1}) = \alpha. \end{aligned}
• For two-tailed alternative hypothesis:

$$P(F < F_{ 1 - \alpha/2,n_1-1,n_2-1} \text{ or } F> F_{\alpha/2,n_1-1,n_2-1}) = \alpha.$$

### Step 5 Computation

Compute the test statistic under the null hypothesis $H_0$ using equation

$$F_{obs} =\dfrac{s_1^2}{s_2^2}$$

### Step 6 Decision (Traditional Approach)

It is based on the critical values.

• For left-tailed alternative hypothesis: Reject $H_0$ if $F_{obs}\leq F_{1-\alpha,n_1-1,n_2-1}$.

• For right-tailed alternative hypothesis: Reject $H_0$ if $F_{obs}\geq F_{\alpha,n_1-1,n_2-1}$.

• For two-tailed alternative hypothesis: Reject $H_0$ if $F_{obs} < F_{1-\alpha/2,n_1-1,n_2-1}$ or $F_{obs} > F_{\alpha/2,n_1-1,n_2-1}$.

OR

### Step 6 Decision (p-value Approach)

It is based on the $p$-value.

Alternative Hypothesis Type of Hypothesis $p$-value
$H_a: \sigma^2_1<\sigma^2_2$ Left-tailed $p$-value $= P(F\leq F_{obs})$
$H_a: \sigma^2_1>\sigma^2_2$ Right-tailed $p$-value $= P(F\geq F_{obs})$
$H_a: \sigma^2_1\neq \sigma^2_2$ Two-tailed $p$-value $= 2P(F\geq F_{obs})$

If $p$-value is less than $\alpha$, then reject the null hypothesis $H_0$ at $\alpha$ level of significance, otherwise fail to reject $H_0$ at $\alpha$ level of significance.

The above six step approach helps you to understand how to test the hypothesis about the equality of two variances or equality of two standard deviations.