Two filling machines can put the same average amount into bottles while one of them varies far more from bottle to bottle. When consistency is the question, an interval for the mean does not answer it. This lesson builds confidence intervals for a population variance and standard deviation from the chi-square pivot, compares two variances with the F test, and compares spread across groups with the Levene and Brown-Forsythe tests. Each method rests on a model, and the classical ones depend on normality far more strongly than the t procedures for means do.
Key terms
Chi-square pivot
Definition A pivot is a function of the data and an unknown parameter whose distribution is completely known, the same for every value of the parameters. Let be independent observations from one normal population , with and , and let be the sample variance with denominator . Then
whatever the values of and . Write for the quantile of . For the pivot lies between and with probability exactly . The result needs independence and normality. It holds for every under that model, but a large sample does not in general rescue it when the population is not normal, as the last card explains.
In plain words The unknown divides the sample variance, which removes the scale, so the distribution of the ratio is the same whatever the true spread. That known distribution is what turns a probability statement about into an interval for .
Example Five constructed measurements of a part, in millimeters, are , , , and . The mean is , the deviations are , , , and , and their squares add to . So and . Under the normal model has the distribution, whose and quantiles are about and , so the event
has probability before the data are seen. For these data the observed value of the pivot is , which still contains the unknown .
Confidence interval for a standard deviation
Definition Under the same model, solving the pivot inequality for gives the percent confidence interval for , with
The larger quantile gives the lower endpoint, because dividing by a larger positive number gives a smaller result. The interval for is in squared units. The square root is increasing on the nonnegative numbers, so lies in exactly when lies in . Hence is a confidence interval for with the same confidence level, in the original units. The intervals are not symmetric about the sample values and . The confidence level describes the procedure. For a 95 percent interval this means that, in repeated samples from the normal model, 95 percent of the intervals built this way contain , which is not the same as a 95 percent probability that lies in one computed interval.
In plain words Take the square roots of both endpoints, not of the width or of the midpoint. Spread is hard to pin down from a few observations, so with a small sample the interval is long and reaches much farther above the sample value than below it.
Example For the five measurements, , so in square millimeters
The 95 percent interval for runs from to . The sample value lies about above the lower end and about below the upper end, and the upper end is almost three times . Five observations leave the spread very uncertain, even when the normal model is right.
F test for two variances
Definition Suppose two independent samples of sizes and consist of independent observations from normal populations and . Then
To test against , use the statistic , which under has the distribution. For an observed value , the equal-tailed two-sided p-value is . Putting the other sample on top swaps the degrees of freedom and gives the same two-sided p-value. Inverting the same pivot gives a confidence interval for the ratio .
In plain words The test compares two sample variances through their ratio. A ratio far from in either direction is evidence of unequal variances, but with small samples ratios far from are common even when the variances are equal, and nonnormal data can produce extreme ratios too. A nonsignificant result does not show that the variances are equal. Welch’s t test and Welch’s ANOVA allow unequal variances from the start, so no preliminary variance test is needed before using them, and letting such a test choose the method changes the error rates of the whole two-stage analysis.
Example The constructed groups and both have mean , with sample variances and . With on top, on and degrees of freedom. The distribution has the simple tail for , so and the two-sided p-value is . The same formula gives and as the and quantiles of , so the 95 percent interval for is
These tiny samples are compatible both with equal variances and with a variance ratio above one hundred.
Levene test
Definition Let independent groups have observations , where labels the group and the observation, and let . Levene’s test replaces each observation by its absolute deviation from a group center ,
where the original version uses the group mean, . It then computes the one-way ANOVA F statistic of the deviations,
with between-group sum of squares and within-group sum of squares , where is the mean of the deviations in group and the mean of all deviations. It compares with . The null hypothesis is that the groups have equal population mean absolute deviations from their centers. This matches equal variances when the group distributions have the same shape apart from scale. The F reference is approximate, even for normal data, and the test requires independent observations within and between groups.
In plain words Replace each observation by its distance from its group’s center, then ask with an ordinary ANOVA whether some groups have larger typical distances than others. A more spread out group tends to have larger distances. The mean-centered version can reject a true null hypothesis too often when the populations are skewed, which is why the median-centered version in the next card is often preferred.
Example For and , each group has mean , which is also its median. The deviations are and , with group means and and grand mean . So and , which give
Compared with , the p-value is . The calculation shows the mechanics only. Six constructed observations do not establish a real difference in consistency.
Brown-Forsythe test
Definition The Brown-Forsythe test for spread is Levene’s procedure with each group’s median as the center, , where is the median of group . The statistic and its approximate reference are as before. Median centering makes the test less sensitive to skewness and to extreme observations, and simulation studies have found that it keeps the actual error rate closer to the nominal level than mean centering when populations are skewed. It is not free of assumptions. It still needs independent observations, its F reference is still an approximation, least reliable for tiny groups, and like Levene’s test it compares mean absolute deviations rather than variances directly. The same names are also attached to a different procedure, a test of equal means that allows unequal variances, so a report should say which one it used.
In plain words Measure each observation’s distance from its group median instead of its group mean. In a group of three or more, making the largest value even larger moves the group mean, and with it the distances measured from the mean, but leaves the median and the other distances from it unchanged.
Example In the group the mean is and the median is . The deviations from the mean are , and , so the two ordinary values look far from the center because the extreme value has pulled the center toward itself. The deviations from the median are , and , which keep the ordinary values near the center and assign the spread to the one extreme value. In a group of odd size the middle observation always has deviation from the median, as in and above. For those two groups each mean equals the median, so the Brown-Forsythe test gives the same and p-value of about as Levene’s test.
Sensitivity to nonnormality
Definition A procedure is sensitive to nonnormality when its actual coverage or error rate moves away from the stated level once the population is not normal. The chi-square interval and the F test for variances are highly sensitive in this sense. For independent observations from a population with mean , variance and finite fourth moment,
where is the excess kurtosis, equal to for every normal population. The chi-square model builds in . When , as for heavy-tailed populations, the sample variance varies more than the model says, so in large samples the intervals cover less often than claimed and the F test rejects true null hypotheses too often. When the errors run the other way. Both terms shrink at the same rate, so the discrepancy does not go away as grows. By contrast, the t interval for a mean has approximately correct coverage in large samples from any population with finite variance.
In plain words The mean of a large sample is approximately normal for any population with finite variance, but the sample variance squares the deviations and so carries the population’s tail behavior with it. A few large deviations can dominate , and the chi-square model does not allow for them. Normality is a real condition of these methods, not a small-sample technicality. When spread matters and normality is doubtful, a different spread target, a resampling method justified for the sample size, or a model chosen for the population’s shape may serve better.
Example An exponential population is strongly right-skewed and has . As grows, the coverage of the nominal 95 percent chi-square interval tends to
where is the standard normal cumulative distribution function. In simulations the coverage is already about for samples of and about for samples of . For two large samples from the same exponential population, a nominal 5 percent two-sided F test rejects in about of samples. For a uniform population, with , the limiting coverage is about instead of .
Check yourself
- Under the normal model, a 95 percent confidence interval for the variance of fill weights is in square grams. Give the 95 percent interval for the standard deviation. A classmate instead takes the square root of the midpoint of the variance interval and of its half-width, and reports the midpoint root plus or minus the half-width root. Why is that wrong?
Show the answer
Take the square root of each endpoint. The interval for is in grams. Since the square root is increasing on the nonnegative numbers, lies in exactly when lies in , so the confidence level is still 95 percent.
The classmate’s method gives the midpoint root and the half-width root , hence about . That interval does not correspond to the variance interval, so it carries no 95 percent guarantee. The square root does not commute with adding and subtracting, and only the endpoints can be carried over.
- The five measurements , , , and mm came from a process that is known to produce strongly right-skewed values, with an exponential-like shape. Is mm still a 95 percent confidence interval for ? Would measuring parts instead of five fix the problem?
Show the answer
The arithmetic can still be done, but the 95 percent label no longer follows. The exact coverage came from the pivot , which requires a normal population. An exponential population has excess kurtosis , so the sample variance varies far more than the chi-square model assumes, and the intervals are too short to reach the claimed coverage. Simulations give a coverage of about for samples of five from an exponential population.
A larger sample does not repair this. The term in the variance of shrinks at the same rate as the normal-model term , and for an exponential population the coverage tends to about as grows. With parts the estimate would be much more precise, but the interval would still claim a coverage it does not have. A method justified for the population’s shape, or a different spread target, is needed.
- Two constructed groups are and . Find the F statistic with on top and its two-sided p-value, using for . An analyst sees that the result is not significant at the 5 percent level, concludes that the variances are equal and pools them for a t test of the means. What is wrong?
Show the answer
The sample variances are and , so on and degrees of freedom. The upper tail is , and the two-sided p-value is
The sample standard deviations are and , yet the test does not reject at the 5 percent level, because three observations per group say little about spread. Not rejecting does not show that the variances are equal. The 95 percent interval for is , which includes and also enormous ratios. The F test also depends strongly on normality. The analyst should compare the means with Welch’s t test, which allows unequal variances, without making it depend on a preliminary variance test.