The chapter's outlier. Every pattern the previous four sections established breaks here: the data are quantitative rather than categorical, the null names a parameter and is written as an equation, the degrees of freedom are the familiar n minus one, and the test may be right-tailed, left-tailed or two-tailed. That last point is the genuinely new one — sections 11.2 to 11.4 had no left-tailed version because their statistics measured disagreement, which cannot be negative, whereas this statistic compares a sample variance against a claimed one and a variance can be too small as well as too large. The test assumes the underlying distribution is normal, and that assumption does not soften with sample size the way the t procedures' did. Worked through the book's exam-score and post-office examples.
Subject: Statistics · 65 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 11 — The Chi-Square Distribution
Testing a claim about spread: the statistic (n − 1)s²/σ², a parameter in the hypotheses, a left tail at last, and a normality assumption that never relaxes
Objectives
Sections 11.2 to 11.4 used the chi-square curve to judge counts in categories. This section uses the same family of curves for a completely different job: testing a claim about how spread out a quantitative variable is. Almost every habit from the last three sections changes, so the objectives name the changes.
Marks in this section are lost in four places: a standard deviation used where a variance belongs, a tail chosen from the data instead of the claim, a conclusion about spread rewritten as one about the average, and a skewed population tested as if it were normal. Each one has its own slide and its own one-line check.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, pp. 582-584 — the section this deck covers
Warm-up
Two facts from earlier carry this whole section. Section 2.7 defined the sample variance; Section 11.1 gave the mean and spread of a chi-square curve. Recall both before anything new appears.
Discussion prompt
A post office claims its waiting times have a standard deviation of 7.2 minutes. What variance is that? And a chi-square curve with 24 degrees of freedom: where is its mean, and what is its standard deviation?
Keep both numbers in view. In a moment you will build a statistic whose value, when the claim about spread is right, lands near 24 on exactly this curve. Whether it lands near 24, far below, or far above is the whole test.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §2.7 and §11.1 — the sample variance; facts about the chi-square distribution
Section
Part 1
Concept
Every test so far in this course asked about a centre or a set of proportions. Some questions are about consistency instead. The book's Example 11.10 begins with exactly this point: math instructors care how exam scores vary, not only how they average, and to many of them the spread matters more than the mean.
Example 11.11 is the clearest case. With individual lines at its windows, a post office finds that waiting times on Friday afternoons have a standard deviation of 7.2 minutes. It tries a single main line, and a random sample of 25 customers has a standard deviation of only 3.5 minutes.
Figure (svg): Two bell curves on one axis of minutes above or below the average wait, from minus 24 to 24. The wide orange curve has standard deviation 7.2 minutes, for individual lines; the tall narrow blue curve has standard deviation 3.5 minutes, the sample from the single line. Both are centred on the same average. Brackets mark one standard deviation either side of the centre for each.
The two curves are drawn with the same centre on purpose. Nothing in the problem says the average wait changed; what changed is how predictable the wait is. A customer facing the narrow curve knows roughly how long the wait will be. A customer facing the wide one does not.
The question for a test is whether 3.5 against 7.2 is a real reduction in spread, or the kind of difference a sample of 25 could show by chance even if nothing had changed.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, pp. 582-583 — Examples 11.10 and 11.11
Concept
This test shares a name and a curve with the previous three sections, and almost nothing else. Before you meet its formula, see the differences laid out, because every one of them is a place where a habit from Section 11.2 would give the wrong answer.
| §11.2 to §11.4 | §11.6: single variance | |
|---|---|---|
| data | counts in categories | measurements on a number scale |
| hypotheses | in words: fits, independent, same | about a parameter: σ² equals a value |
| degrees of freedom | from cells: k − 1 or (r − 1)(c − 1) | from the sample: n − 1 |
| tail | always right | left, right or two-tailed |
| condition | every expected count at least 5 | the population is normal |
Read the table row by row. The data are quantitative, so there are no expected counts at all. The null names a parameter, so you can write it as an equation for the first time in the chapter. The degrees of freedom are the familiar n minus one from the t procedures.
The last two rows are the real news. The tail is chosen by the alternative, as it was in Chapter 9, and the condition is not about sample size: it is about the shape of the population, and no sample is large enough to make it go away.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.5 and §11.6, p. 582 — the comparison of the chi-square tests, and the single variance
Notation
The book states the statistic on page 582 (the extracted text lost the formula; it is reconstructed here from the worked example). Hover over each piece to see what it is and where it comes from.
Annotate
On: \( \chi^2 = \frac{(n-1)\,s^2}{\sigma^2}, \qquad df = n - 1 \)
Read the formula left to right as a recipe: take the spread of your sample, scale it up by the degrees of freedom, and measure it against the spread the claim allows. A sample exactly as spread out as claimed gives n minus one.
Notice that both quantities inside the fraction are variances, squared numbers. A problem usually hands you standard deviations, so the first move is always to square them. The second thing to notice is that sigma squared is the claim, not a value from the data, which is why it sits in the denominator as a fixed yardstick.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the test statistic and its inputs
Concept
Rewrite the statistic so you can read it at a glance. Group the two variances together, and the factor in front is just the degrees of freedom.
\[ \chi^2 = (n-1) \cdot \frac{s^2}{\sigma^2} \]
The fraction is the ratio of the sample's variance to the claimed variance. If the sample is exactly as spread out as the claim, the ratio is one and the statistic equals n minus one, the mean of its chi-square curve. That is where it should land, roughly, when the null is true.
Figure (svg): A straight line through the origin giving the test statistic against the ratio of the sample variance to the claimed variance, for a sample of 25, so the slope is 24. Dots mark a ratio of 0.236, which gives 5.67, Example 11.11; a ratio of 1, which gives 24, the mean; and the two 5 percent cutoffs, a ratio of 0.577 giving 13.85 and a ratio of 1.517 giving 36.42.
For the post office the ratio is 12.25 over 51.84, about 0.236, so the sample variance is less than a quarter of the claimed one. Multiply by 24 and the statistic is 5.67, far below 24. Ratios much bigger than one push the statistic far above 24.
\[ \frac{s^2}{\sigma^2} = \frac{12.25}{51.84} = 0.236, \qquad 24 \times 0.236 = 5.67 \]
So the statistic has a direction built into it. Below n minus one means less spread than claimed; above it means more. Hold on to that: it is why this test can have a left tail.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, pp. 582-583 — the statistic, and Example 11.11
Worked example
Individual lines gave a waiting-time standard deviation of 7.2 minutes. With a single line, a random sample of 25 customers had a standard deviation of 3.5 minutes. Compute the test statistic for a claim about the variance.
Name the three inputs
Why: the sample size, the sample standard deviation and the claimed standard deviation.
\[ n = 25, \quad s = 3.5, \quad \sigma = 7.2 \]
Find the degrees of freedom
Why: one less than the sample size.
\[ df = n - 1 = 25 - 1 = 24 \]
Why n minus one and not 25? The degrees of freedom count the independent pieces of information about spread. One piece went into estimating the mean of the 25 waits, so 24 remain, and the same 24 divided the sum of squares when the sample variance was computed.
Square the sample standard deviation
Why: the statistic is written in variances.
\[ s^2 = 3.5^2 = 12.25 \]
Square the claimed standard deviation
Why: the same reason.
\[ \sigma^2 = 7.2^2 = 51.84 \]
Squaring both is where most slips happen, so say what the numbers mean. The sample's waits spread with a variance of 12.25 square minutes; the claim says 51.84 square minutes. Variances are awkward in units, but they are what adds up, which is why the formula uses them.
Multiply the sample variance by the degrees of freedom
Why: the numerator.
\[ (n-1)s^2 = 24 \times 12.25 = 294 \]
Divide by the claimed variance
Why: the claim is the yardstick.
\[ \chi^2 = \frac{294}{51.84} = 5.6713 \]
The book prints 5.67, which agrees. In context: if waiting times with a single line still had a standard deviation of 7.2 minutes, a statistic near 24 would be typical. This one is less than a quarter of that, because the 25 sampled waits were far more consistent than the claim allows.
Check through the ratio
Why: the variance ratio times the degrees of freedom must give the same number.
\[ \frac{12.25}{51.84} = 0.2363, \quad 24 \times 0.2363 = 5.67 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11, the test statistic
Prediction
Commit to an answer before reading the explanation. Suppose the claimed standard deviation is exactly right and you take a sample of 25 from a normal population.
Predict first
If the claimed variance is the true population variance, roughly where should the statistic fall for a sample of 25?
Correct: near 24, its degrees of freedom
Why: When the claim is right the sample variance is about equal to the claimed variance, so their ratio is about one and the statistic is about n minus one. That is also the mean of the chi-square curve with 24 degrees of freedom, which is the curve the statistic follows.
Each wrong answer is a real slip. Near zero is what a goodness-of-fit statistic does when the fit is perfect; here zero would mean no spread at all. Near one is the ratio, before multiplying by the degrees of freedom. And 25 uses the sample size where the degrees of freedom belong.
The useful habit: before computing any p-value in this section, compare the statistic with its degrees of freedom. Far below means the sample was less variable than claimed; far above, more variable; close means the data agree with the claim.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.1 and §11.6 — the mean of a chi-square curve is its df
Concept
Push the prediction to its limit. Suppose the single line had produced a sample standard deviation of exactly 7.2 minutes, the claimed value. The ratio is then one.
\[ \chi^2 = 24 \cdot \frac{7.2^2}{7.2^2} = 24 \cdot 1 = 24 \]
The statistic lands precisely on the mean of its curve. You might expect half of the curve to lie on each side of it, but a chi-square curve is skewed to the right, and a right-skewed curve has its mean above its median.
\[ P(\chi^2_{24} < 24) = 0.5384 \]
So slightly more than half of the area lies below the mean. With a left-tailed alternative the p-value would be 0.5384, and with a right-tailed one 0.4616: either way, nowhere near significance, which is exactly right for a sample that matches the claim perfectly.
The skew fades as the degrees of freedom grow, and the area below the mean creeps down toward one half. It is a small effect, but it explains why the two one-sided p-values for a statistic equal to its degrees of freedom never quite split fifty-fifty.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.1, fact 5, and §11.6 — the shape of the chi-square curve
Intuition
Section 11.1 built the chi-square curve as a sum of squared standard normal values. This statistic is secretly one of those sums. Start from the definition of the sample variance and multiply both sides by n minus one.
\[ s^2 = \frac{\sum (x - \bar{x})^2}{n - 1} \quad \Longrightarrow \quad (n-1)s^2 = \sum (x - \bar{x})^2 \]
Now divide by the claimed variance. Dividing a sum of squares by sigma squared is the same as dividing each deviation by sigma before squaring it.
\[ \frac{(n-1)s^2}{\sigma^2} = \sum \left(\frac{x - \bar{x}}{\sigma}\right)^2 \]
Each term is a squared standardised distance, which is exactly the ingredient of a chi-square variable when the data come from a normal population. That is where the normality assumption enters: the terms are squared standard normals only if the population is normal.
Why n minus one terms' worth, and not n? The deviations from the sample mean always add to zero, so once n minus one of them are known, the last is forced. One degree of freedom is spent estimating the mean.
\[ \sum (x - \bar{x}) = 0 \quad \Longrightarrow \quad df = n - 1 \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.1 and §11.6 — the chi-square variable as a sum of squares
Picture it
A claim that a statistic follows a chi-square curve is a claim about what happens over many samples. Check it directly. Draw 2,000 samples of 25 from a normal population whose variance really is the claimed one, compute the statistic for each, and stack the results.
Figure (svg): A histogram of 2,000 simulated values of n minus one times s squared over sigma squared, each from a sample of 25 drawn from a normal population with standard deviation 1. The bars rise from near zero to a peak around 22 and trail off to the right by about 50. The chi-square curve with 24 degrees of freedom runs along the tops of the bars. Bars beyond the right 5 percent cutoff, 36.42, are yellow; 5.0% of the simulated values fall there.
The bars pile up around 24 with a long right side, and the chi-square curve with 24 degrees of freedom runs along their tops. Of the 2,000 simulated statistics, 5.0 percent landed beyond the right 5 percent cutoff of 36.42, as the curve promises.
This is the picture to have in mind when you compute a p-value. The p-value is the share of this pile that lies as far out as your statistic, or further, in the direction the alternative names. A statistic of 5.67 would sit to the left of every bar here: not one of the 2,000 null samples was that consistent.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the distribution for the test; simulation our own
Estimation
Before any software, size up Example 11.11's statistic against its curve. The warm-up gave you the curve's mean and standard deviation.
Predict first
The chi-square curve with 24 degrees of freedom has mean 24 and standard deviation about 6.93. Roughly how many standard deviations below the mean is a statistic of 5.67?
Correct: about 2.6
Why: The gap from 24 down to 5.67 is about 18.3, and 18.3 divided by 6.93 is about 2.6 standard deviations. On a roughly mound-shaped curve, anything beyond two standard deviations is rare, so expect a very small left-tail p-value.
\[ \frac{24 - 5.67}{\sqrt{48}} = \frac{18.33}{6.93} \approx 2.65 \]
This is a sanity check, not a p-value: the chi-square curve is skewed, so standard-deviation counts are only a rough guide. Here the true left-tail area is 0.000042, even smaller than a normal curve would suggest, because a right-skewed curve's left tail is short and stops dead at zero.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.1 — the mean and standard deviation of the chi-square distribution
Fill the middle
A sample of 11 measurements has a standard deviation of 6, and the claim is that the population standard deviation is 5. Fill in the squared sample standard deviation, then the statistic.
Fill in the blanks
\chi^2 = \frac36})}14.4 = ___
Why: The sample variance is 6 squared, which is 36. Ten times 36 is 360, and 360 divided by the claimed variance 25 is 14.4, on 10 degrees of freedom.
Check the size the quick way. The variance ratio is 36 over 25, or 1.44, so the sample is somewhat more spread out than claimed, and the statistic is 1.44 times its degrees of freedom: 14.4 against a mean of 10. That is above the mean but not far above it.
If you wrote 6 in the first blank, you used the standard deviation; that gives 2.4, below the mean, and turns a sample that was more variable into one that looks less variable. Squaring is never optional here.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the test statistic
Trap
For Example 11.11, a first attempt plugs the standard deviations straight in:
\[ \frac{24 \times 3.5}{7.2} \]
\[ = 11.67 \]
Wrong. The formula is written in variances, so both standard deviations must be squared.
Squaring changes the ratio, and so the answer. The standard-deviation ratio is 0.486; the variance ratio is its square, 0.236.
\[ \frac{24 \times 3.5^2}{7.2^2} \]
\[ = \frac{294}{51.84} = 5.67 \]
The wrong value, 11.67, has a left-tail p-value near 0.02 instead of 0.00004: the decision survives here, but the evidence is misstated by a factor of hundreds.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11
Section
Part 2
Concept
For three sections the hypotheses were sentences, because a fit or an independence has no single number to name. Here there is a parameter, the population variance, and the hypotheses go back to the shape you know from Chapter 9: a null with an equals sign and an alternative with an inequality.
\[ H_0: \sigma^2 = \sigma_0^2 \qquad H_a: \sigma^2 < \sigma_0^2, \; > \sigma_0^2 \; \text{or} \; \ne \sigma_0^2 \]
Problems almost always state the claim as a standard deviation, because that is in the units of the data. The book's move is to square it and write the hypotheses about the variance, since that is what the statistic uses.
Squaring loses nothing. Standard deviations are never negative, and for numbers that are not negative, squaring keeps their order: sigma is more than 5 exactly when sigma squared is more than 25. So the inequality keeps its direction when you square both sides.
\[ \sigma > 5 \iff \sigma^2 > 25, \qquad \sigma < 3 \iff \sigma^2 < 9 \]
The book writes the squared claim as 5 squared rather than 25, which keeps the original number visible. Either form is correct; never write the null about the sample's s, which is data, not a parameter.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — hypotheses stated in terms of the population variance
Notation
Here are Example 11.10's hypotheses exactly as the book writes them. Every symbol has a job; hover over each to see it.
Annotate
On: \( H_0: \sigma^2 = 5^2 \qquad H_a: \sigma^2 > 5^2 \)
Read the pair aloud as one sentence: assume the exam scores have a standard deviation of five points, and look for evidence that they are more spread out than that. The inequality sign in the alternative is the arrow that picks the tail, so it must come from the wording of the claim, never from the data.
The 5 squared in the null does double duty. It states the claim, and it is the number that goes into the denominator of the statistic, so the hypotheses already contain half of the arithmetic.
Compare this with Section 11.3, where the null had to be written in words. The return to symbols is a sign that you are back to testing a parameter.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — Example 11.10
Concept
The book's examples write the null as an equality. Its homework answers, for claims such as a variance of no more than 150, write the null with an at-most sign instead. Both are in use, and they lead to exactly the same calculation.
\[ H_0: \sigma^2 \le 150 \qquad H_a: \sigma^2 > 150 \]
Why the same calculation? A p-value is computed at one value of the parameter, and the right one is the boundary, 150. Any variance smaller than 150 would make a large sample variance even less likely, so if the data are surprising at 150, they are more surprising at every value below it.
\[ \chi^2 = \frac{(n-1)s^2}{150} \quad \text{for either form of } H_0 \]
So read an at-most or at-least claim as follows: the claim goes in the null, the opposite direction goes in the alternative, and the number on the boundary goes in the denominator. The alternative never contains the equals sign.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 614 — answers 112 and 124: H₀ written with ≤
Worked example
A math instructor believes the standard deviation of his final exam is five points. One of his best students disagrees and claims it is more than five points. If that claim were tested, what would the null and alternative hypotheses be?
Identify the parameter
Why: the claim is about spread, so it concerns the population standard deviation of exam scores.
\[ \sigma = \text{population SD of final exam scores} \]
Square the claimed value
Why: the test is set up in variances.
\[ \sigma_0^2 = 5^2 = 25 \]
Write the null
Why: the instructor's belief, with an equals sign.
\[ H_0: \sigma^2 = 5^2 \]
Who gets the null? The instructor's belief is the status quo, a specific value that a calculation can assume. The challenger's claim is what needs evidence, and evidence is only ever gathered against a null, so the claim of more goes in the alternative.
Read the challenger's wording
Why: more than five points points to the right.
\[ H_a: \sigma^2 > 5^2 \]
In context: the null says final exam scores have a standard deviation of five points; the alternative says they are more spread out than that. A test would compute the statistic with 25 in the denominator and look in the right tail only, since a smaller spread would not support the claim of more.
Check that squaring kept the claim
Why: for a standard deviation, more than 5 and a variance of more than 25 are the same statement.
\[ \sigma > 5 \iff \sigma^2 > 25 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — Example 11.10
Worked example
A scuba instructor records the depths his students dive during their checkout. Everyone should have been at the same depth, so he is interested in how the depths vary. He believes the standard deviation is three feet; his assistant thinks it is less. Write the hypotheses.
Identify the parameter
Why: variation in depth, a population standard deviation in feet.
\[ \sigma = \text{population SD of checkout depths} \]
Square the instructor's value
Why: the null's number.
\[ \sigma_0^2 = 3^2 = 9 \text{ square feet} \]
Write the null
Why: the instructor's belief.
\[ H_0: \sigma^2 = 3^2 \]
Read the assistant's wording
Why: less than three feet points to the left.
\[ H_a: \sigma^2 < 3^2 \]
This is a left-tailed test: only a statistic well below its degrees of freedom, a sample whose depths bunch more tightly than three feet allows, would support the assistant. The book prints no answer for this Try It; these hypotheses follow Example 11.10's pattern with the inequality reversed.
In context: the null says the depths have a standard deviation of three feet; the alternative says the students' depths are more consistent than that.
Check the direction against the wording
Why: less than three in the claim, a less-than sign in the alternative, and so the left tail.
\[ \sigma < 3 \iff \sigma^2 < 9 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Try It 11.10
Worked example
Back to the post office. The claim to test is that a single line causes lower variation among waiting times. Set up the test before computing anything.
Decide what kind of test
Why: the claim is about variation, so it is a test of a single variance.
\[ \text{parameter: } \sigma^2 \]
Name the random variable
Why: the book's wording: the sample standard deviation of the waiting times.
\[ s = \text{SD of the 25 sampled waits} \]
Write the null
Why: the old value, from individual lines.
\[ H_0: \sigma^2 = 7.2^2 \]
Write the alternative
Why: the claim says lower variation.
\[ H_a: \sigma^2 < 7.2^2 \]
Notice that 7.2 squared stays in the denominator whatever the alternative is. The null value is the yardstick; the alternative only decides which end of the curve counts as evidence.
The book adds a short phrase you should not skip: the sample standard deviation is the random variable. It is the quantity that would change if the post office drew another 25 customers, while sigma is the fixed, unknown spread of all single-line waits.
Name the distribution for the test
Why: chi-square with n minus one degrees of freedom.
\[ \chi^2_{24}, \quad df = 25 - 1 = 24 \]
The book puts it in one sentence: the word less tells you this is a left-tailed test. Only a small statistic, a sample much less variable than 7.2 minutes, counts as evidence for the single line. The null carries the old arrangement's value because the study is trying to show a change from it.
Check the tail against the statistic's meaning
Why: a small statistic means a small variance ratio, which is exactly what less variation predicts.
\[ H_a: < \;\Rightarrow\; \text{left tail}, \quad 5.67 \ll 24 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11
Error analysis
The book's Practice exercises 59 to 61: an archer's standard deviation for hits is six, measured as distance from the centre of the target, and an observer claims it is less. Four classmates write four setups. Hover over each one.
Annotate
On: \( H_0{:}\,\sigma^2 = 6^2, \; H_a{:}\,\sigma^2 < 6^2 \quad H_a{:}\,s^2 < 36 \quad H_a{:}\,\sigma^2 > 6^2 \quad H_a{:}\,\sigma^2 \le 6^2 \)
The second setup is the deepest error, because it inverts the logic of testing. A hypothesis is a claim about something you cannot see, the archer's long-run spread; the sample is what you use to judge it. Writing a hypothesis about s is like hypothesising about a number already printed on your page.
The third is the most common under time pressure: the tail must come from the claim's wording, less, and never from a guess about what the data will show.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Practice, p. 595; answers p. 611 — exercises 59-61
Matching
Match each claim to its alternative hypothesis. Square the stated standard deviation, then read the direction word.
Match the pairs
Why: Greater and more point right; less points left; not, or different from, points both ways. A claim already stated as a variance, such as 150, is used as it stands, without squaring again.
The last pair is a quiet trap. When the problem states the claim as a variance, it is already squared, and squaring again would test a variance of 22,500. Read whether the number is a standard deviation or a variance before you touch it.
The heights match the book's own answer to exercise 63, which writes the null as sigma squared equals 0.81 squared and the alternative with a greater-than sign.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Practice and Homework, pp. 595, 606-608 — exercises 60, 63, 112 and 126
Trap
For the post office, a write-up states:
\[ H_0: s = 7.2 \]
\[ H_a: s < 7.2 \]
Wrong. The sample standard deviation is 3.5; it is data, not a hypothesis.
Hypotheses are about the population, the long-run spread of all waits under the single line. The sample only supplies evidence.
\[ H_0: \sigma^2 = 7.2^2 \]
\[ H_a: \sigma^2 < 7.2^2 \]
A quick test: if a hypothesis could be checked by looking at your own sample, it is about the wrong quantity.
Here s equals 3.5, so the wrong alternative is simply true and tests nothing.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11
Discrimination
The book's airline exercises turn on one decision. An airline claims its average delay is at most 15 minutes, and that delays are so consistent that the variance is no more than 150. A traveller doubts the consistency. Sort each question by the procedure it calls for.
Sort into buckets
Sort each question by the procedure it calls for.
The book's answer to exercise 118 makes the point: you know to test the variance because the claim is that the variance is no more than 150. The words decide the test, not the numbers, since both tests use the same mean and standard deviation from the same 25 flights.
Its answer to exercise 120 names a Student's t distribution or a normal distribution for the mean with 45 flights. The t is the safer choice, because the population standard deviation is unknown.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, pp. 606-607; answers p. 614 — exercises 109, 118-120
Section
Part 3
Concept
Sections 11.2 to 11.4 were right-tailed without exception, and this section is the chapter's only home for a left tail. The reason is what each statistic measures. A goodness-of-fit statistic adds squared gaps between observed and expected counts, so it measures disagreement, and its smallest possible value, zero, is perfect agreement with the null.
Figure (svg): Two horizontal scales. Top, for goodness of fit, independence and homogeneity: zero at the left marked perfect fit, and a red region at the far right marked evidence against the null; every misfit pushes the statistic right. Bottom, for a single variance: the ratio of sample to claimed variance, with 1 in the middle marked s squared equals the claim, a blue region near zero marked less spread than claimed, and an orange region on the right marked more spread than claimed.
On that scale only one end is bad news for the null. A small statistic means the data fit the claim well, which is support, not evidence against it. The book's own answer to Homework exercise 130 adds that a left-tailed goodness-of-fit test would be testing whether the data fit too well, too perfectly, which is a different question entirely.
The single-variance statistic measures something with a direction: the sample variance relative to the claimed one. The null sits in the middle, at a ratio of one. A ratio well below one is just as real a departure as a ratio well above it, so a small statistic can be evidence, of less spread than claimed.
\[ \frac{s^2}{\sigma_0^2} < 1 \;\Rightarrow\; \text{less spread}, \qquad \frac{s^2}{\sigma_0^2} > 1 \;\Rightarrow\; \text{more spread} \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582; Homework answer 130, p. 616 — a test of a single variance may be left-tailed
Picture it
Fix a sample of 25, so the curve has 24 degrees of freedom, and fix alpha at 5 percent. The three possible alternatives give three different rejection regions on exactly the same curve.
Figure (svg): Three copies of the chi-square curve with 24 degrees of freedom. Left panel, left-tailed: the area below 13.85 is shaded red. Middle panel, right-tailed: the area above 36.42 is shaded red. Right panel, two-tailed: the areas below 12.40 and above 39.36 are shaded red, 2.5 percent each.
Left-tailed: reject when the statistic is below 13.85, a sample variance less than about 58 percent of the claim. Right-tailed: reject above 36.42, a sample variance more than about 152 percent of it. Two-tailed: each tail holds only 2.5 percent, so both cutoffs move outward, to 12.40 and 39.36.
Notice the asymmetry. Because the curve is skewed, the left cutoff is 10.15 below the mean and the right cutoff 12.42 above it. You cannot find one cutoff by reflecting the other across 24; each must be read from a table or software for its own tail.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — right-tailed, left-tailed, or two-tailed
Concept
Software and calculators give tail areas directly, but a cutoff from a table is the quick way to check a decision. The book's TI instruction uses the chi-square cdf, which gives the area to the left of a value; that is all you need for any tail.
\[ \text{left tail: } P(\chi^2 < x) \qquad \text{right tail: } 1 - P(\chi^2 < x) \]
For Example 11.11 the book enters the lower bound as a huge negative number and the upper bound as 5.67, on 24 degrees of freedom, and gets 0.000042. A chi-square value cannot be negative, so a lower bound of zero gives the same area.
\[ P(\chi^2_{24} < 5.67) = \text{cdf}(0, \, 5.67, \, 24) = 0.000042 \]
For cutoffs, ask the table for the value with alpha to its left or to its right. On 24 degrees of freedom the left 5 percent cutoff is 13.85, the value with 95 percent of the area above it; the right 5 percent cutoff is 36.42.
\[ P(\chi^2_{24} < 13.85) = 0.05, \qquad P(\chi^2_{24} > 36.42) = 0.05 \]
Two-tailed tests take alpha over two from each side. The usual slip is to use a right-tail table value for a left-tailed test: on 24 degrees of freedom that would put the cutoff at 36.42, and a statistic of 5.67 would wrongly look ordinary.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 584 — using the TI-83, 83+, 84, 84+ calculator
Worked example
The statistic is 5.67 on 24 degrees of freedom and the test is left-tailed. With a significance level of 5 percent, finish the test of the claim that a single line causes lower variation among waiting times.
Write the probability statement
Why: left-tailed, so the area below the statistic.
\[ p\text{-value} = P(\chi^2_{24} < 5.67) \]
Find the area
Why: calculator or software, the chi-square cdf from 0 to 5.67 on 24 degrees of freedom.
\[ p\text{-value} = 0.000042 \approx 0.000042 \]
Figure (svg): A chi-square curve with 24 degrees of freedom from 0 to 50, with its hump near 22. The region below the left 5 percent cutoff, 13.85, is shaded red. The observed statistic 5.67 sits far to the left, where the curve is almost flat on the axis, marked in yellow and labelled p-value 0.000042. The mean, 24, is marked.
Read the number in words before using it. If the single line had changed nothing, so that waits still had a standard deviation of 7.2 minutes, a sample of 25 as consistent as this one would turn up about four times in a hundred thousand samples. That is the meaning of the p-value, and it is why the estimate of 2.6 standard deviations undersold it.
Compare with alpha
Why: the p-value is far below 0.05.
\[ \alpha = 0.05 > 0.000042 = p \]
Decide
Why: a p-value below alpha means reject.
\[ \text{reject } H_0: \sigma^2 = 7.2^2 \]
Conclusion, in context: at the 5 percent level, there is sufficient evidence that with a single line, customer waiting times vary less than the 7.2-minute standard deviation of individual lines. The book also adds a parenthetical about shorter waiting times; that part does not follow, as the next slide shows.
Check against the critical value
Why: the left 5 percent cutoff on 24 degrees of freedom is 13.85, and 5.67 is below it, so the decision agrees.
\[ 5.67 < 13.85 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, pp. 583-584 — Example 11.11 and Figure 11.8
Trap
The book's own conclusion to Example 11.11 reads: a single line causes a lower variation among the waiting times
\[ \text{(shorter waiting times)} \]
Wrong in the parenthesis. The test was about spread, not about the average wait.
A smaller standard deviation says waits are more predictable. The average could be the same, longer or shorter.
\[ H_0: \sigma^2 = 7.2^2 \]
Nothing in these hypotheses mentions the mean, so the conclusion cannot either. A claim about shorter waits needs a test of the mean wait.
Keep the conclusion about spread: with a single line, waiting times vary less.
Shorter waits may well be true too, but this test cannot show it.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11, conclusion
Sorting
The post office test rejected the null with a p-value of 0.000042. Sort each statement by whether that result supports it.
Sort into buckets
Sort each statement about Example 11.11 by whether the test result supports it.
Before you sort, recall exactly what was tested: a null that the variance of single-line waits is 7.2 squared, against the alternative that it is smaller. Anything the result supports has to be a statement about that spread, or about how surprising the data would be if the null were true.
Two of the unsupported statements deserve a second look. The p-value is computed by assuming the null is true, so it cannot also be the chance that the null is true. And the problem itself says the waiting times are normally distributed; the test's validity comes from that sentence, not from anything in the formula.
Predictability is the honest headline: customers in a single line can tell more reliably how long they will stand there.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 583 — Example 11.11
Counterexample
The book's Homework exercise 122: 43 stores give a sample standard deviation of 12 dollars for a calculator's price, and the claim to test is that the standard deviation is greater than 15 dollars. The sample's spread is already smaller than the claimed value.
Discussion prompt
Set up and run the test at 5 percent. What does the p-value come out as, and could you instead switch to a left-tailed test because the sample looks less variable?
Figure (svg): A chi-square curve with 42 degrees of freedom from 0 to 75. The statistic 26.88 is marked in yellow on the left side of the hump, and the whole area to its right, 0.9663, is shaded blue. A dashed red line at 58.12 marks the right 5 percent cutoff.
The book's answer agrees: 26.88 and a p-value of 0.9663. A p-value that large is not a sign of an error; it is what a one-sided test reports when the sample points the opposite way. A separate study, planned in advance, could test whether prices vary less than 15 dollars.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 607; answer p. 615 — exercise 122
Tweak it
The statistic divided by its degrees of freedom is the variance ratio, sample over claimed. Slide the sample size and watch the curve of that ratio when the claim is true. The readout names n and the degrees of freedom.
Parameter explorer
Move n from 5 to 100. How does the spread of possible variance ratios around 1 change, and what does that mean for a ratio of 0.6?
\[ n = {n}, \quad df = {n} - 1, \quad \text{curve of } s^2 / \sigma^2 \]
At n equal to 5 the curve is wide and skewed: a sample variance anywhere from about a fifth of the truth to more than double it is ordinary, inside the middle 90 percent. At n equal to 100 the curve hugs one tightly, and a ratio below about 0.78 happens only one time in twenty.
So the same variance ratio of 0.6 means different things at different sizes: on 4 degrees of freedom it is unremarkable, while on 99 degrees of freedom it is strong evidence of less spread. That is why the statistic multiplies the ratio by n minus one before comparing it with a curve.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.1 and §11.6 — a different chi-square curve for each df
Ranking
Four of this section's tests, each in its own tail. Rank them from the strongest evidence against the null to the weakest, that is, from the smallest p-value to the largest.
Put in order
Order these results from the smallest p-value to the largest.
Why: The post office statistic is less than a quarter of its degrees of freedom, deep in the left tail, with p near 0.00004. The babies statistic is about 1.7 times its df, p equal to 0.037. The doctor's office is about 1.45 times its df, p equal to 0.054. Broadband is barely above its df, p equal to 0.29.
\[ 0.000042 < 0.0371 < 0.0542 < 0.2902 \]
The ratio of statistic to degrees of freedom is the quick yardstick, in the direction of the tail: the further the ratio is from one on the side the alternative names, the smaller the p-value. Use it to sanity-check every software p-value you report.
Notice that the strongest evidence here is a left-tailed result. In the previous three sections a statistic far below its degrees of freedom would have been good news for the null.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 and exercises — Example 11.11, Try It 11.11, exercises 66-67 and 124
Section
Part 4
Concept
The section's first sentence is the condition: a test of a single variance assumes that the underlying distribution is normal. That is a claim about the population the data come from, not about the sample size or about any count.
You have seen why. The statistic is a sum of squared standardised deviations, and those terms behave like squared standard normal values only if the data themselves are normal.
\[ \frac{(n-1)s^2}{\sigma^2} = \sum \left(\frac{x - \bar{x}}{\sigma}\right)^2 \sim \chi^2_{n-1} \quad \text{only for normal data} \]
Compare the t procedures of Chapter 8. A t test is about a mean, and the central limit theorem rescues means: with a large sample, the sample mean is close to normal whatever the population's shape. No such theorem rescues the sample variance. Its behaviour depends on how heavy the population's tails are, and that does not average away.
So in a problem, look for the sentence that grants normality, as Example 11.11 does with normally distributed waiting times. When the problem gives raw data, plot them before trusting the test.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — a test of a single variance assumes that the underlying distribution is normal
Picture it
Repeat the earlier simulation with one change: draw the samples of 25 from a strongly right-skewed population, an exponential one, while keeping its true variance equal to the claimed variance. The null is still true. Only the shape has changed.
Figure (svg): A histogram of 2,000 simulated values of the same statistic, each from a sample of 25 drawn from a strongly right-skewed exponential population with standard deviation 1. The bars are far more spread out than the chi-square curve with 24 degrees of freedom drawn on top: too many values below 13.85 and far too many beyond 36.42, with a long tail past 60. 14.0% of the values pass the right cutoff and 22.0% fall below the left one.
The bars no longer follow the curve. They are far more spread out, with too many small statistics and a long tail of large ones. 14.0 percent of these true-null samples land beyond the right 5 percent cutoff, and 22.0 percent below the left one.
In practice that means a right-tailed test at 5 percent would declare too much spread about three times as often as promised, and a left-tailed test would declare too little about four times as often, all with the claim exactly right. The p-values printed by software would be confidently wrong.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the normality assumption; simulation our own
Concept
With a mean, more data fixes a shape problem. Check whether more data fixes this one. For each of three populations with the claimed variance, run 3,000 right-tailed tests at 5 percent and count how often the true null is rejected.
Figure (svg): Grouped bars showing, for samples of 10, 30, 100 and 300, the share of 3,000 simulated right-tailed tests at the 5 percent level that rejected a true null. Normal population: 5.4 percent, 5.2 percent, 5.0 percent, 5.3 percent. Exponential population: 12.2 percent, 15.3 percent, 17.6 percent, 17.6 percent. Uniform population: 0.3 percent, 0.4 percent, 0.6 percent, 0.6 percent. A dashed yellow line marks the promised 5 percent.
Normal population: about 5 percent at every sample size, as it should be. Exponential population: 12.2 percent at n equal to 10 and 17.6 percent at n equal to 300, worse, not better. Uniform population, flat with short tails: well under 1 percent, so a real increase in spread would usually be missed.
The direction of the error depends on the tails. Heavy-tailed populations make sample variances swing wildly, so the test rejects too often; light-tailed ones make them unusually steady, so it rejects too rarely. Growing the sample makes the statistic's spread settle at the wrong width rather than the right one.
This is the point the old rule of thumb hides: n of at least 30 is a rule for means, and it does nothing for a variance.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the normality assumption; simulation our own
Trap
A report on 300 delivery times, clearly right-skewed, says:
\[ n = 300 \ge 30 \]
so by the central limit theorem the variance test is valid.
Wrong. The central limit theorem is about sample means, not sample variances.
The sample variance of skewed data stays more variable than the chi-square curve allows, at every n.
\[ \text{exponential}, n = 300: \]
\[ \text{true-null rejections} \approx 18\text{ in } 100 \]
Say instead: the delivery times are skewed, so the chi-square test of a single variance is not trustworthy for these data.
The rule of thirty belongs to means, through the central limit theorem, and nowhere else.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the normality assumption
Step zero
Before any arithmetic, there is one question this test always asks first. Decide what it is for each of three data sets.
Discussion prompt
A manager wants to test claims about the spread of: the weights of 84 cereal boxes from one filling machine; household incomes in a city, from 200 households; and the times of five races by one runner. For which may you use the chi-square test of a single variance, and what would you check?
Step zero here is not about counts or sample size, as it was in Sections 11.2 to 11.4. It is about the shape of the population. Look for a sentence in the problem that grants normality; if there is none and you have data, draw a dot plot or histogram first.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582, and Homework exercises 121, 123 — the normality assumption
Real world
A quality engineer rejects a null about the variance of a machine's cycle times at the 1 percent level, concluding that the process has become more variable. A histogram of the sample, attached to the report, is visibly skewed to the right, with a long tail of slow cycles.
Discussion prompt
Write the two sentences you would add to the report.
This is the ordinary situation in industry: variance tests are popular because consistency is what quality means, and process data are often skewed. The honest report keeps the finding as a warning sign and flags the assumption, rather than presenting a p-value the data cannot support.
Notice the direction of the danger. For a right-skewed process, the error makes a real problem look more certain than it is, which is exactly when a manager is most likely to act on it.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — the normality assumption
Section
Part 5
Worked example
The FCC measures how much data per second passes between a consumer's computer and the internet. At one point the standard deviation of speeds across providers was 12.2 percent. A sample of 15 providers has a standard deviation of 13.2. An analyst claims the standard deviation is more than reported. Test at the 1 percent level.
Write the hypotheses
Why: more than reported points to the right.
\[ H_0: \sigma^2 = 12.2^2, \quad H_a: \sigma^2 > 12.2^2 \]
Find the degrees of freedom
Why: fifteen providers.
\[ df = 15 - 1 = 14 \]
Square both standard deviations
Why: the statistic uses variances.
\[ s^2 = 13.2^2 = 174.24, \quad \sigma^2 = 12.2^2 = 148.84 \]
Before computing, size it up. The sample standard deviation, 13.2, is only about 8 percent above the claimed 12.2, so the variance ratio is about 1.17. With just 15 providers, expect a statistic a little above 14 and an unimpressive p-value.
Compute the numerator
Why: degrees of freedom times the sample variance.
\[ 14 \times 174.24 = 2{,}439.36 \]
Divide by the claimed variance
Why: the statistic.
\[ \chi^2 = \frac{2{,}439.36}{148.84} = 16.389 \]
Find the right-tail p-value
Why: software or the calculator's cdf, subtracted from one.
\[ p = P(\chi^2_{14} > 16.39) = 0.2902 \]
Figure (svg): A chi-square curve with 14 degrees of freedom from 0 to 40. The observed statistic 16.39 is marked in yellow just right of the hump, and the area to its right is shaded blue, labelled p-value 0.2902. A dashed red line at 29.14 marks the 1 percent cutoff, far to the right.
Decision: 0.2902 is far above 0.01, so do not reject. In context: at the 1 percent level there is insufficient evidence that the standard deviation of internet speeds across providers is more than 12.2 percent. A sample of 15 providers at 13.2 is well within chance variation. The book prints no answer for this Try It; these values are from node.
Check with the yardstick
Why: the statistic is only slightly above its mean of 14, and the 1 percent cutoff is 29.14.
\[ 16.39 < 29.14 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 584 — Try It 11.11
Worked example
The standard deviation of waiting times in a doctor's office is 3.4 minutes. A random sample of 30 patients has a standard deviation of 4.1 minutes. One doctor believes the variance is greater than originally thought. Test at the 5 percent level.
Name the test and hypotheses
Why: a test of a single variance; greater points right.
\[ H_0: \sigma^2 = 3.4^2, \quad H_a: \sigma^2 > 3.4^2 \]
Find the degrees of freedom
Why: thirty patients.
\[ df = 30 - 1 = 29 \]
Square both standard deviations
Why: variances in the formula.
\[ 4.1^2 = 16.81, \quad 3.4^2 = 11.56 \]
Notice the doctor's wording: the variance is greater than originally thought. The claim is about spread, and the word greater fixes the right tail before any data are looked at. The office's average wait is not part of the question, and nothing here would tell you about it.
Multiply by the degrees of freedom
Why: the numerator.
\[ 29 \times 16.81 = 487.49 \]
Divide by the claimed variance
Why: the statistic.
\[ \chi^2 = \frac{487.49}{11.56} = 42.170 \]
Find the right-tail p-value
Why: by software.
\[ p = P(\chi^2_{29} > 42.17) = 0.0542 \]
Figure (svg): A chi-square curve with 29 degrees of freedom from 0 to 60. A dashed red line at 42.56 marks the 5 percent cutoff with the region beyond shaded red. The observed statistic 42.17 is marked in yellow just to the left of the cutoff, and the area beyond it, 0.0542, is shaded blue.
This matches the book's answer to exercise 67, 0.0542. Decision: 0.0542 is just above 0.05, so do not reject. In context: at the 5 percent level, there is not quite enough evidence that waiting times at this office vary more than a standard deviation of 3.4 minutes. With a borderline p-value, a larger sample is the sensible next step.
Check against the critical value
Why: the right 5 percent cutoff on 29 degrees of freedom is 42.56, and 42.17 falls just short of it.
\[ 42.17 < 42.56 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Practice, p. 596; answer p. 611 — exercises 65-68
Worked example
An airline claims its delays are so consistent that the variance is no more than 150. The book writes 150 minutes; a variance of minutes is in square minutes, which this slide uses. A traveller times his next 25 flights: mean delay 22 minutes, standard deviation 15 minutes. Test at 5 percent.
Decide which claim is disputed
Why: the traveller doubts the consistency, a variance.
\[ \text{parameter: } \sigma^2 \]
Convert the sample standard deviation
Why: exercise 110: the sample variance.
\[ s^2 = 15^2 = 225 \text{ square minutes} \]
Write the hypotheses
Why: the claim is at most 150, so the null keeps it.
\[ H_0: \sigma^2 \le 150, \quad H_a: \sigma^2 > 150 \]
Find the degrees of freedom
Why: 25 flights.
\[ df = 25 - 1 = 24 \]
The claim is already a variance, so 150 goes into the denominator as it stands. Squaring it again, a natural reflex after so many standard-deviation problems, would test a variance of 22,500 and make any sample look wildly consistent.
Compute the statistic
Why: the boundary value 150 in the denominator.
\[ \chi^2 = \frac{24 \times 225}{150} = \frac{5{,}400}{150} = 36 \]
Find the right-tail p-value
Why: by software.
\[ p = P(\chi^2_{24} > 36) = 0.0549 \]
Figure (svg): A chi-square curve with 24 degrees of freedom from 0 to 55. A dashed red line at 36.42 marks the right 5 percent cutoff. The statistic 36.00 is marked in yellow just short of it, and the area to its right, 0.0549, is shaded blue.
Compare with the yardstick before trusting the software. The variance ratio is 225 over 150, exactly 1.5, so the statistic is 1.5 times 24. A sample variance half again as large as the claim sounds damning, but with 25 flights the curve is wide enough to make that a borderline result.
The statistic, 36, matches the book's answer to exercise 114. Decision: 0.0549 is just above 0.05, so do not reject. In context: from 25 flights there is not enough evidence at the 5 percent level that the variance of delays exceeds 150 square minutes. The 22-minute mean is irrelevant here; it belongs to a separate t test of the average delay.
Check against the critical value
Why: the right 5 percent cutoff on 24 degrees of freedom is 36.42.
\[ 36 < 36.42 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, pp. 606-607; answers p. 614 — exercises 109-117
Worked example
Isabella, an accomplished Bay to Breakers runner, claims the standard deviation of her time for the 7.5-mile race is at most three minutes. Rupinder looks up five of her times: 55, 61, 58, 63 and 57 minutes. First, the sample variance, computed by hand from the data.
Find the mean
Why: add the five times and divide by 5.
\[ \bar{x} = \frac{55 + 61 + 58 + 63 + 57}{5} = \frac{294}{5} = 58.8 \]
Find each deviation from the mean
Why: time minus 58.8.
\[ -3.8, \; 2.2, \; -0.8, \; 4.2, \; -1.8 \]
Keep the signs for now; they are your check at the end. Times below the mean give negative deviations, times above give positive ones, and because the mean is the balance point of the data the two sides must cancel exactly.
Square each deviation
Why: squares make every term positive.
\[ 14.44, \; 4.84, \; 0.64, \; 17.64, \; 3.24 \]
Add the squares
Why: the sum of squares.
\[ \sum (x - \bar{x})^2 = 40.8 \]
Divide by n minus one
Why: four, not five.
\[ s^2 = \frac{40.8}{4} = 10.20, \quad s = 3.194 \]
Figure (svg): A number line of race times from 53 to 65 minutes with five dots at 55, 57, 58, 61 and 63. A dashed yellow line marks the mean, 58.8. Arrows run from the mean to each time: 55 is 3.8 below, 61 is 2.2 above, 58 is 0.8 below, 63 is 4.2 above and 57 is 1.8 below. The squared deviations add to 40.8.
In context: these five races vary with a standard deviation of about 3.19 minutes, a little above the three minutes Isabella claims. Whether a little above is evidence, with only five races, is what the test on the next slide decides.
Check the deviations
Why: deviations from the mean must add to zero.
\[ -3.8 + 2.2 - 0.8 + 4.2 - 1.8 = 0 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 607 — exercise 123
Worked example
Isabella claims a standard deviation of at most three minutes; Rupinder's five races have a sample variance of 10.2. Test at the 5 percent level. With four degrees of freedom, the right tail has a closed form, so the p-value can be found without software.
Write the hypotheses
Why: her claim is at most 3, so the alternative is more.
\[ H_0: \sigma^2 \le 3^2, \quad H_a: \sigma^2 > 3^2 \]
Compute the statistic
Why: four degrees of freedom, boundary variance 9.
\[ \chi^2 = \frac{4 \times 10.2}{9} = \frac{40.8}{9} = 4.5333 \]
Use the closed form for four degrees of freedom
Why: from Section 11.2.
\[ P(\chi^2_4 > x) = e^{-x/2}\left(1 + \frac{x}{2}\right) \]
Why does four degrees of freedom have a formula when 24 did not seem to? Every even number of degrees of freedom has one, a finite sum of terms, but it lengthens as the degrees of freedom grow. With four it is just two terms, short enough to use by hand.
Halve the statistic
Why: the exponent and the bracket both use it.
\[ \frac{x}{2} = 2.2667 \]
Evaluate
Why: e to the minus 2.2667, times 3.2667.
\[ 0.1037 \times 3.2667 = 0.3386 \]
Figure (svg): A chi-square curve with 4 degrees of freedom from 0 to 16, rising to a peak at 2 and decaying. The statistic 4.53 is marked in yellow, and the area to its right, 0.3386, is shaded blue. A dashed red line at 9.49 marks the 5 percent cutoff.
Decision: 0.3386 is far above 0.05, so do not reject. In context: five race times give no real evidence that Isabella's standard deviation exceeds three minutes. Five values also cannot show whether her times are normal, so the conclusion rests on that assumption.
Check against software
Why: the chi-square cdf on 4 degrees of freedom gives the same right tail.
\[ 1 - P(\chi^2_4 < 4.533) = 0.3386 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 607 — exercise 123
Worked example
An airline executive believes the number of babies on flights has a variance of nine at most. A survey of 18 flights gives a sample mean of 6.4 and a sample standard deviation of 3.9. Test the executive's belief at the 5 percent level.
Write the hypotheses
Why: a variance of at most 9 is a standard deviation of at most 3.
\[ H_0: \sigma^2 \le 9, \quad H_a: \sigma^2 > 9 \]
Find the degrees of freedom
Why: eighteen flights.
\[ df = 18 - 1 = 17 \]
Square the sample standard deviation
Why: the sample variance.
\[ s^2 = 3.9^2 = 15.21 \]
The executive's belief is about two things, an average of six and a variance of at most nine; only the second is tested here. The 6.4 sample average plays no part in the statistic, which uses only the spread of the 18 counts.
Compute the numerator
Why: degrees of freedom times the sample variance.
\[ 17 \times 15.21 = 258.57 \]
Divide by the boundary variance
Why: the statistic.
\[ \chi^2 = \frac{258.57}{9} = 28.73 \]
Find the right-tail p-value
Why: by software.
\[ p = P(\chi^2_{17} > 28.73) = 0.0371 \]
Figure (svg): A chi-square curve with 17 degrees of freedom from 0 to 45. A dashed red line at 27.59 marks the 5 percent cutoff, with the region beyond shaded red. The statistic 28.73 is marked in yellow just past it, and the thin area beyond, 0.0371, is shaded blue.
Both numbers match the book's answer. Decision: 0.0371 is below 0.05, so reject. In context: there is sufficient evidence at the 5 percent level that the number of babies per flight varies more than a standard deviation of three, so the safety equipment should be planned for wider swings. At the 1 percent level the same data would not reject.
Check against the critical value
Why: the right 5 percent cutoff on 17 degrees of freedom is 27.59.
\[ 28.73 > 27.59 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 607; answer p. 615 — exercise 124
Worked example
A plant manager's machine fills 15-ounce cereal boxes, and the standard deviation of the weights should be at most 0.5 ounces. From the next day's production 84 boxes are weighed, with a standard deviation of 0.54 ounces. Does the machine need recalibrating? Use 5 percent.
Write the hypotheses
Why: recalibrate only if the spread is more than 0.5.
\[ H_0: \sigma^2 \le 0.5^2, \quad H_a: \sigma^2 > 0.5^2 \]
Find the degrees of freedom
Why: 84 boxes.
\[ df = 84 - 1 = 83 \]
Square both standard deviations
Why: variances in square ounces.
\[ 0.54^2 = 0.2916, \quad 0.5^2 = 0.25 \]
Size it up first. The sample standard deviation is 8 percent above the limit, so the variance ratio is 0.2916 over 0.25, about 1.17, the same ratio as the broadband example. The difference is the sample size: 83 degrees of freedom judge a ratio of 1.17 much more strictly than 14 do.
Compute the numerator
Why: degrees of freedom times the sample variance.
\[ 83 \times 0.2916 = 24.2028 \]
Divide by the boundary variance
Why: the statistic.
\[ \chi^2 = \frac{24.2028}{0.25} = 96.81 \]
Find the right-tail p-value
Why: by software.
\[ p = P(\chi^2_{83} > 96.81) = 0.1426 \]
Figure (svg): A chi-square curve with 83 degrees of freedom from 40 to 130, almost symmetric, with its hump near 81. The statistic 96.81 is marked in yellow to the right of the hump and the area beyond it, 0.1426, is shaded blue. A dashed red line at 105.27 marks the 5 percent cutoff.
At this many degrees of freedom the chi-square curve is close to symmetric, with mean 83 and standard deviation about 12.9. The statistic sits about 1.07 standard deviations above the mean, which already says the p-value will be modest, roughly one in seven.
Decision: 0.1426 is above 0.05, so do not reject. In context: the 84 boxes give no convincing evidence that fill weights vary by more than 0.5 ounces, so on this evidence the machine does not need recalibrating. The validity rests on fill weights being normal, which is reasonable for a filling machine but worth a quick histogram.
Check with the yardstick
Why: the statistic is about 1.17 times its degrees of freedom, and the 5 percent cutoff is 105.27.
\[ 96.81 < 105.27 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 607 — exercise 121
Concept
When the claim is only that the standard deviation is different from a value, both directions count as evidence. A two-tailed test puts half of alpha in each tail, and the p-value counts results as extreme as yours on either side.
\[ H_0: \sigma^2 = \sigma_0^2 \qquad H_a: \sigma^2 \ne \sigma_0^2 \]
The chi-square curve is skewed, so you cannot find the opposite tail's area by symmetry. The book's convention, and the one software uses, is to find the area in the tail where the statistic fell, the smaller of the two, and double it.
\[ p = 2 \cdot \min\big(P(\chi^2 < x), \; P(\chi^2 > x)\big) \]
Which tail is the smaller one? Compare the statistic with its degrees of freedom. Below the degrees of freedom, use the left tail; above, the right. For a statistic near its degrees of freedom both tails are about one half, and the doubled p-value is close to one, as it should be.
The rule with critical values is the same idea: reject if the statistic is below the lower cutoff with alpha over two to its left, or above the upper cutoff with alpha over two to its right.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, p. 582 — a test may be two-tailed
Worked example
An aquarist says the number of fish in a 20-gallon tank has a standard deviation of two. A friend doubts it, and they count the fish in 15 other tanks: 11, 10, 9, 10, 10, 11, 11, 10, 12, 9, 7, 9, 11, 10, 11. First, the sample variance from a frequency table.
| fish x | 7 | 9 | 10 | 11 | 12 | total |
|---|---|---|---|---|---|---|
| tanks f | 1 | 3 | 5 | 5 | 1 | 15 |
| f · x | 7 | 27 | 50 | 55 | 12 | 151 |
| f · x² | 49 | 243 | 500 | 605 | 144 | 1,541 |
Find the mean
Why: total fish over 15 tanks.
\[ \bar{x} = \frac{151}{15} = 10.0667 \]
With repeated values, a frequency table saves work: each count is multiplied by how many tanks hold it. The shortcut on the next line avoids subtracting 10.0667 fifteen times, and it uses only the two column totals of the table.
Use the shortcut for the sum of squares
Why: the sum of squares minus the squared total over n.
\[ \sum (x - \bar{x})^2 = 1{,}541 - \frac{151^2}{15} \]
Evaluate
Why: 151 squared is 22,801.
\[ 1{,}541 - \frac{22{,}801}{15} = 1{,}541 - 1{,}520.0667 = 20.9333 \]
Divide by n minus one
Why: fourteen.
\[ s^2 = \frac{20.9333}{14} = 1.4952, \quad s = 1.2228 \]
Figure (svg): A dot plot of fish counts in 15 tanks: one tank at 7, three at 9, five at 10, five at 11 and one at 12. A dashed yellow line marks the mean, 10.07. An orange bar shows plus or minus 2 around the mean, the claimed standard deviation, and a shorter blue bar shows plus or minus 1.22, the sample standard deviation.
In context: the 15 tanks vary with a standard deviation of about 1.22 fish, well under the claimed two. Fish counts are whole numbers in a narrow range, so normality is an approximation here; the dot plot is mound-shaped apart from the one tank of seven.
Check the sum of squares directly
Why: squared deviations from the mean, tank by tank, give the same total.
\[ 1(-3.067)^2 + 3(-1.067)^2 + 5(-0.067)^2 + 5(0.933)^2 + 1(1.933)^2 = 20.93 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 608 — exercise 126
Worked example
The friend does not believe the standard deviation is two, without saying higher or lower, so the test is two-tailed. The sample variance is 1.4952. Test at the 5 percent level.
Write the hypotheses
Why: not two points both ways.
\[ H_0: \sigma^2 = 2^2, \quad H_a: \sigma^2 \ne 2^2 \]
Compute the statistic
Why: fourteen degrees of freedom, claimed variance 4.
\[ \chi^2 = \frac{14 \times 1.4952}{4} = 5.2333 \]
Choose the smaller tail
Why: 5.23 is far below the degrees of freedom, 14, so the left tail.
\[ P(\chi^2_{14} < 5.2333) = 0.0177 \]
Why double? Before the data, the friend would have counted a sample far more spread out than two just as much as one far less spread out. The p-value has to include both kinds of surprise, and doubling the observed tail is how the book and software do it.
Double it
Why: a result as extreme on the other side would also count.
\[ p = 2 \times 0.0177 = 0.0354 \]
Figure (svg): A chi-square curve with 14 degrees of freedom from 0 to 35. Both 2.5 percent tails are shaded red: below 5.63 and above 26.12. The statistic 5.23 is marked in yellow inside the left red region; the area below it, 0.0177, is shaded blue, and the two-tailed p-value is twice that, 0.0354.
Decision: 0.0354 is below 0.05, so reject. In context: there is sufficient evidence that the standard deviation of fish per 20-gallon tank is not two; the tanks are more consistent than claimed. The book prints 5.2094 and 0.0346 because it rounded s to 1.22 before squaring; from the data the values are 5.2333 and 0.0354, with the same decision.
Check against the critical values
Why: on 14 degrees of freedom the 2.5 percent cutoffs are 5.63 and 26.12, and 5.23 is below the lower one.
\[ 5.23 < 5.63 \quad \checkmark \]
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 608; answer p. 615 — exercise 126
Prediction
Here is a question that tests whether the left tail has landed. Take one chi-square value, 5.67 on 24 degrees of freedom, and put it into two different tests from this chapter.
Predict first
A goodness-of-fit test on 24 degrees of freedom gives 5.67, and Example 11.11's left-tailed variance test gives 5.67 on 24 degrees of freedom. What does each value say about its null?
Correct: goodness of fit: strong support for the null; variance: strong evidence against it
Why: A goodness-of-fit test is right-tailed: its p-value is the area to the right of 5.67, which is almost all of the curve, so the data fit the claimed distribution very well. The variance test here is left-tailed, so its p-value is the tiny area to the left, and a statistic so far below its mean is strong evidence of less spread.
\[ P(\chi^2_{24} > 5.67) = 0.99996 \qquad P(\chi^2_{24} < 5.67) = 0.00004 \]
The number on its own means nothing. What it means depends on what the statistic measures and which tail the alternative names. That is the whole reason this section asks you to choose the tail from the wording before you compute.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.2 and §11.6 — right-tailed goodness of fit; left-tailed Example 11.11
Comparison
Fill in the blanks to finish the comparison. Each blank is one word or one short formula.
Comparison matrix
| goodness of fit (§11.2) | single variance (§11.6) | |
|---|---|---|
| kind of data | categorical counts | quantitative |
| null hypothesis | in words: the data fit | sigma^2 = value |
| degrees of freedom | k − 1 | n-1 |
| tail | right | any |
| condition | every E >= 5 | normal population |
Every blank in the right-hand column is something this deck derived rather than stated: measurements, because there are no expected counts; an equation, because there is a parameter; n minus one, from the deviations summing to zero; any tail, from the ratio having a middle.
Read the table as two different tools that happen to share a curve. The goodness-of-fit statistic is built from counts and always measures misfit, so it only ever looks right. The variance statistic is built from measurements and measures a ratio, so it can look either way.
The degrees of freedom row is the other quiet difference. In goodness of fit they come from the number of categories, so a thousand people in six categories still have five. Here they come from the number of measurements, so every extra observation adds one.
The condition row is the one with the sharpest consequence. Expected counts of at least five can be fixed by collecting more data; non-normality cannot, as the simulation showed.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.2, §11.5 and §11.6 — the chi-square tests compared
Section
Part 6
Pattern
Every test in this section ran through the same sequence. The arithmetic is a single line; the decisions around it are where the marks are.
Figure (svg): A flow diagram. A box for the claim about a standard deviation or variance leads to a box saying square it into sigma squared. Next, a check box asks whether the population is roughly normal; a red arrow labelled no leads to a box saying the test is not trustworthy. A green arrow labelled yes leads to choosing the tail from the alternative's wording, then to the statistic n minus one times s squared over sigma squared on n minus one degrees of freedom, then to the p-value in the chosen tail, and finally to a conclusion about spread in context.
\[ \chi^2 = \frac{(n-1)s^2}{\sigma_0^2}, \quad df = n - 1 \]
\[ p = P(\chi^2 < x), \quad P(\chi^2 > x), \quad \text{or twice the smaller} \]
Run the post office through it once more as a test of the pattern: a claim of lower variation, 7.2 squared in the null, normal waits granted by the problem, the left tail from the word lower, 5.67 on 24 degrees of freedom far below 24, a p-value of 0.000042, and a conclusion that waits vary less, not that they are shorter.
Most wrong answers here are right arithmetic on the wrong thing: standard deviations used unsquared, a tail picked from the data, a skewed population tested anyway, or a conclusion about spread rewritten as one about the average. Each has its one-line check in the pattern above.
Check
Square first, then use the degrees of freedom, then divide by the claim.
Practice exercises 62 to 64 give the data: a school's height standard deviation is 0.81, and a sample of 50 students has a standard deviation of 0.96.
Check your understanding
A school's standard deviation of student heights is 0.81. A sample of 50 students has a standard deviation of 0.96. What is the test statistic for a test of a single variance?
Answer: A
Why: Square both standard deviations: 0.9216 and 0.6561. Multiply the sample variance by 49 degrees of freedom to get 45.158, then divide by 0.6561 to get 68.83, on 49 degrees of freedom.
Work it before you look: square both standard deviations, multiply the sample variance by 49, divide by the claimed variance. Then compare your answer with 49, the degrees of freedom, to see which side of the curve it lands on.
Each wrong option skips or changes one move of the formula. The yardstick catches the first two: the variance ratio is 1.40, so the statistic should be about 1.4 times 49, which is 68.8.
In context: the statistic is 68.83 on 49 degrees of freedom, with a right-tail p-value of 0.0323, so at 5 percent there would be evidence that heights at this school vary more than 0.81.
Check
Read the claim's direction word, not the data.
The scuba instructor of Try It 11.10 believes the depth standard deviation is three feet; his assistant thinks it is less. Suppose the sample came out with a standard deviation of 3.4 feet.
Check your understanding
For the assistant's claim that the standard deviation of depths is less than three feet, with a sample standard deviation of 3.4 feet, which setup is correct?
Answer: A
Why: The alternative comes from the assistant's claim, less, so it is left-tailed, whatever the sample shows. A sample standard deviation above three simply gives a statistic above its mean and a large p-value: no evidence for the assistant.
Two of the options use the right parameter and the right null. They differ only in the alternative, and the alternative is a translation of the assistant's sentence, word for word.
This is the calculator-price lesson again. A sample pointing the wrong way does not flip the test; it produces a large p-value, and the honest conclusion is that the data do not support the claim.
Choosing the tail after looking would make a 5 percent test reject about 10 percent of the time when the null is true, because you would be using whichever tail the data favoured.
Check
Decide what the test can establish before reading the options.
Try It 11.11 gave a statistic of 16.39 on 14 degrees of freedom and a right-tail p-value of 0.2902, tested at the 1 percent level.
Check your understanding
For Try It 11.11, with p-value 0.2902 at the 1 percent level, which conclusion is correct?
Answer: A
Why: The p-value is far above 0.01, so do not reject. The conclusion is about spread, in context, and it is phrased as a lack of evidence, not as proof that the null is true.
Two questions decide the right option: was the null rejected, and is the sentence about the same parameter the test was about? A conclusion that passes both and is phrased as evidence, not proof, is the one to choose.
Each wrong option is one of this deck's traps: proving the null, drifting from spread to centre, and reading the p-value as the probability of the null.
A full answer adds the numbers that justify it: 16.39 on 14 degrees of freedom, only a little above the curve's mean, with p equal to 0.29.
Explain it to yourself
The left tail is the single idea that separates this section from the rest of the chapter. Explaining it in your own words is the best test of whether it has landed.
Discussion prompt
In two or three sentences, explain why a test of a single variance can be left-tailed when a goodness-of-fit test is always right-tailed.
A strong answer names what each statistic measures: misfit for one, a ratio for the other. A very strong one adds where the null sits on each scale, at the end for goodness of fit and in the middle for a variance, since that is the geometric reason one test has two possible tails and the other has one.
If your answer mentioned only that the alternative uses a less-than sign, push one step further: why is a less-than alternative even meaningful here, when it would not be for a fit?
Exit ticket
The book's Homework exercise 127: the chef at Frenchies claims the standard deviation of a ten-ounce order of fries is at most 1.5 ounces. The manager weighs 49 random orders: mean 11 ounces, standard deviation 2 ounces.
Discussion prompt
Write the hypotheses, compute the statistic and its degrees of freedom, find the p-value, and state a conclusion at the 5 percent level in context.
Check yourself with the yardstick: the variance ratio is 4 over 2.25, about 1.78, so the statistic should be about 1.78 times 48, and the 5 percent cutoff on 48 degrees of freedom is 65.17. A statistic of 85.33 is well beyond it.
If you got 64, you used the standard deviations unsquared; if you got 87.1, you multiplied by 49 instead of 48. Both slips appear in this deck's traps.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6 Homework, p. 608 — exercise 127
Recap
A test of a single variance asks whether a population's spread matches a claimed value. It uses quantitative data, a null about a parameter, the degrees of freedom n minus one, and a tail chosen by the alternative, and it assumes the population is normal.
| idea | formula | read it as |
|---|---|---|
| hypotheses | H₀: σ² = σ₀² (or ≤, ≥) | square a claimed standard deviation |
| statistic | χ² = (n − 1)s² / σ₀² | df times the variance ratio |
| degrees of freedom | df = n − 1 | one spent on the sample mean |
| where it lands | near df if the claim is right | below: less spread; above: more |
| tail | <: left, >: right, ≠: both | from the claim's wording, never the data |
| two-tailed p | 2 × the smaller tail | the curve is skewed: no symmetry |
| condition | the population is normal | a large n does not fix it |
| conclusion | about spread, in context | never about the average |
The book's examples carried all of it: Example 11.10's hypotheses about five exam points squared; the post office's 5.67 on 24 degrees of freedom, a left-tailed p-value of 0.000042 and less variable waits, not shorter ones; and the homework's babies, fish and fries, each decided in its own tail.
The Introductory Business Statistics text treats the same test in its §11.2, with business contexts, if you want more practice in a different setting. Chapter 12 turns from a single variance to the relationship between two quantitative variables.
OpenStax Introductory Statistics 2e, §11.6 Test of a Single Variance §11.6, pp. 582-584 — the whole section
OpenStax Introductory Business Statistics 2e, §11.2 Test of a Single Variance §11.2 Test of a Single Variance — the same test in business contexts
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.