Comparing Two Variances

4.4.2 Comparing Two Variances

4.4.2.1 The F Test

In some comparison problems to be described later, one needs to decide whether or

2 not two independent data samples A and B, with sample variances 2 s

A and s B and

sample sizes n A and n B , were obtained from normally distributed populations with the same variance. Using Property 6 of B.2.9, we know that:

2 2 ~ F n A −B 1 , n − 1 . s 4.7

2 Under the null hypothesis H 2

0 : σ A = σ B ” , we then use the test statistic:

Note that given the asymmetry of the F distribution, one needs to compute the two (1 − α/2)-percentiles of F for a two-tailed test, and reject the null hypothesis if the observed F value is unusually large or unusually small. Note also that for applying the F test it is not necessary to assume that the populations have equal means.

Example 4.6

Q: Consider the two independent samples shown in Table 4.4 of normally distributed random variables. Test whether or not one should reject at a 5%

4 Parametric Tests of Hypotheses

significance level the hypothesis that the respective population variances are unequal.

A: The sample variances are v 1 = 1.680 and v 2 = 0.482; therefore, F * = 3.49, with an observed one-sided significance of p = 0.027. The 0.025 and 0.975 percentiles of

F 9,11 are 0.26 and 3.59, respectively. Therefore, since the non-critical region [0.26, 3.59] contains p, we do not reject the null hypothesis at the 5% significance level.

Table 4.4. Two independent and normally distributed samples. Case # 1 2 3 4 5 6 7 8 9 10 11 12

Group 1 4.7 3.7 5.2 6.3 6.2 6.7 2.8 4.8 6.1 3.9 Group 2 10.1 8.6 10.9 9.7 9.7 10 9.4 10.1

Example 4.7

Q: Consider the meteorological data and test the validity of the following null hypothesis at a 5% level of significance:

H 0 : σ T81 = σ T80 .

A: We assume, as in previous examples, that both variables are normally distributed. We then have to determine the percentiles of F 24,24 and the non-critical region:

C = [ F 0 . 025 , F 0 . 975 ] = [ 0 . 44 , 2 . 27 ] .

Since F * = s 2 T 2 81 / s T 80 = 7.5/4.84 = 1.55 falls inside the non-critical region, the null hypothesis is not rejected at the 5% level of significance. ฀

SPSS, STATISTICA and MATLAB do not include the test of variances as an individual option. Rather, they include this test as part of other tests, as will be seen in later sections. R has a function, var.test, which performs the F test of two variances. Running var.test(T81,T80)for the Example 4.7 one obtains:

F=1.5496, num df=24, denom df=24, p-value=0.2902

confirming the above results.

4.4.2.2 Levene’s Test

A problem with the previous F test is that it is rather sensitive to the assumption of normality. A less sensitive test to the normality assumption (a more robust test) is

4.4 Inference on Two Populations

Levene’s test, which uses deviations from the sample means. The test is carried out as follows:

1. Compute the means in the two samples: x A and x B .

2. Let d i A = x i A − x A and d i B = x i B − x B represent the absolute deviations

of the sample values around the respective mean.

3. Compute the sample means, d A and d B , and sample variances, v A and v B

of the previous absolute deviations.

4. Compute the pooled variance, v p , for the two samples, with n A and n B cases,

as the following weighted average of the individual variances:

5. Finally, perform a t test with the test statistic:

There is a modification of the Levene’s test that uses the deviations from the median instead of the mean (see section 7.3.3.2).

Example 4.8

Q: Redo the test of Example 4.7 using Levene’s test.

A: The sample means are x 1 = 5.04 and x 2 = 9.825. Using these sample means, we

compute the absolute deviations for the two groups shown in Table 4.5.

The sample means and variances of these absolute deviations are: d 1 = 1.06,

d 2 = 0.492; v 1 = 0.432, v 2 = 0.235. Applying formula 4.9 we obtain a pooled

variance v p = 0.324. Therefore, using formula 4.10, the observed test statistic is t * = 2.33 with a two-sided observed significance of 0.03.

Thus, we reject the null hypothesis of equal variances at a 5% significance level. Notice that this conclusion is the opposite of the one reached in Example 4.7.

Table 4.5. Absolute deviations from the sample means, computed for the two samples of Table 4.4.

Case # 1 2 3 4 5 6 7 8 9 10 11 12

Group 1 0.34 1.34 0.16 1.26 1.16 1.66 2.24 0.24 1.06 1.14 Group 2 0.15 1.35 0.95 0.25 0.25 0.05 0.55 0.15 0.05 0.05 0.85 1.25

4 Parametric Tests of Hypotheses