1. Exploratory Data Analysis
1.3. EDA Techniques
1.3.5. Quantitative Techniques

## Chi-Square Test for the Variance

Purpose:
Test if the variance is equal to a specified value
A chi-square test ( Snedecor and Cochran, 1983) can be used to test if the variance of a population is equal to a specified value. This test can be either a two-sided test or a one-sided test. The two-sided version tests against the alternative that the true variance is either less than or greater than the specified value. The one-sided version only tests in one direction. The choice of a two-sided or one-sided test is determined by the problem. For example, if we are testing a new process, we may only be concerned if its variability is greater than the variability of the current process.
Definition The chi-square hypothesis test is defined as:

H0: $$\sigma^2 = \sigma_0^2$$
Ha:
 $$\sigma^2 < \sigma_0^2$$ for a lower one-tailed test $$\sigma^2 > \sigma_0^2$$ for an upper one-tailed test $$\sigma^2 \ne \sigma_0^2$$ for a two-tailed test
Test Statistic: $$T = (N-1)(s/\sigma_0)^2$$

where N is the sample size and s is the sample standard deviation. The key element of this formula is the ratio s0 which compares the ratio of the sample standard deviation to the target standard deviation. The more this ratio deviates from 1, the more likely we are to reject the null hypothesis.

Significance Level: α.
Critical Region: Reject the null hypothesis that the variance is a specified value, σ02, if

 $$T > \chi^2_{1-\alpha, \, N-1}$$ for an upper one-tailed alternative $$T < \chi^2_{\alpha, \, N-1}$$ for a lower one-tailed alternative $$T < \chi^2_{\alpha/2, \, N-1}$$     or $$T > \chi^2_{1-\alpha/2, \, N-1}$$ for a two-tailed alternative
where $$\chi^2_{., \, N-1}$$ is the critical value of the chi-square distribution with N - 1 degrees of freedom.

The formula for the hypothesis test can easily be converted to form an interval estimate for the variance:

$\sqrt{\frac{(N-1)s^2}{\chi^2_{1-\alpha/2, \, N-1}}} \le \sigma \le \sqrt{\frac{(N-1)s^2}{\chi^2_{\alpha/2, \, N-1}}}$
A confidence interval for the standard deviation is computed by taking the square root of the upper and lower limits of the confidence interval for the variance.
Chi-Square Test Example A chi-square test was performed for the GEAR.DAT data set. The observed variance for the 100 measurements of gear diameter is 0.00003969 (the standard deviation is 0.0063). We will test the null hypothesis that the true variance is equal to 0.01.
H0:  σ2 = 0.01
Ha:  σ2 ≠ 0.01

Test statistic:  T = 0.3903
Degrees of freedom:  N - 1 = 99
Significance level:  α = 0.05
Critical values:  Χ 2α/2,N-1 = 73.361
Χ 21-α/2,N-1 = 128.422
Critical region: Reject H0 if T < 73.361 or T > 128.422

The test statistic value of 0.3903 is much smaller than the lower critical value, so we reject the null hypothesis and conclude that the variance is not equal to 0.01.
Questions The chi-square test can be used to answer the following questions:
1. Is the variance equal to some pre-determined threshold value?
2. Is the variance greater than some pre-determined threshold value?
3. Is the variance less than some pre-determined threshold value?
Related Techniques F Test
Bartlett Test
Levene Test
Software The chi-square test for the variance is available in many general purpose statistical software programs. Both Dataplot code and R code can be used to generate the analyses in this section.