A short section introducing the distribution the whole chapter runs on. A chi-square random variable with k degrees of freedom is the sum of k independent squared standard normal variables, and every property the book lists follows from that definition. Because the terms are squares the statistic is never negative; because there are k of them the mean is k and the standard deviation is the square root of twice k; and because it is a sum of many independent quantities, the central limit theorem makes the curve approximately normal once the degrees of freedom exceed about ninety. The curve is nonsymmetrical and skewed to the right, there is a different curve for every degrees of freedom, and the mean sits just to the right of the peak. How the degrees of freedom are counted depends on which of the chapter's three tests is being run.
Subject: Statistics · 65 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 11 — The Chi-Square Distribution
Squared z-scores, added up: one definition and the five facts that follow from it
Objectives
Chapter 11 runs three different hypothesis tests on one new distribution, the chi-square. This short section is about the distribution itself: where it comes from, what its curves look like, and how to read a number against one. Everything in the book's list of facts follows from a single definition, so the definition comes first.
The arithmetic in this section is light: a mean, a square root, a subtraction. What takes care is the reading. A chi-square value of 12 can be shocking or perfectly ordinary depending on the curve it sits on, and by the end you should be able to say which at a glance.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, pp. 563-565 — the chapter introduction and the section this deck covers
Warm-up
Chapter 6 gave you the standard normal variable Z, with mean 0 and standard deviation 1, and the empirical rule. This whole chapter is built from one operation on Z: squaring it. So start there.
Discussion prompt
Let Z be a standard normal variable. What values can Z squared take? And what is the probability that Z squared is less than 1?
Notice the move: a question about Z squared became a question about Z, which you already know how to answer. The chi-square distribution is what you get when you keep asking questions about squared z-scores, and add several of them together.
Hold on to 0.6827. It reappears on the third slide of Part 1, read off a simulation of two thousand squared z-scores, and it is your first evidence that the chi-square curves are not mysterious.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §6.1, the standard normal and the empirical rule — background from chapter 6
Section
Part 1
Concept
The chapter opens with three questions. Are lottery numbers evenly spread, or do some come up too often? Do people of different ages prefer different kinds of movie? Does a coffee machine dispense about the same amount every time? Each is a hypothesis test, and none of them is about a single mean.
What the three have in common is that each measures a disagreement by squaring it. Squaring stops positive and negative errors cancelling, and it makes large errors count heavily. Add up enough squared, standardised errors and the total follows one family of curves, the chi-square distributions.
So before any test, you need to know how a sum of squared standard normals behaves: where it is centred, how spread out it is, and what its curve looks like. That is all this section does.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 introduction, p. 563 — the three major applications
Concept
Take k independent standard normal variables, each with mean 0 and standard deviation 1. Square each one and add the squares. The total is a chi-square random variable with k degrees of freedom.
\[ \chi^2 = (Z_1)^2 + (Z_2)^2 + \cdots + (Z_k)^2 \]
The book writes the distribution like this, with the degrees of freedom as a subscript. Here df is k, the number of squared z-scores being added.
\[ X \sim \chi^2_{\text{df}} \]
Two small points. First, the random variable is written chi-square in the book, but it may be any upper-case letter, so X is fine. Second, the chapter's summary on page 589 prints the definition with the last plus sign missing; the sum above is the correct one, with a plus between every pair of terms.
chi-square random variable — The sum of k independent squared standard normal variables. Its distribution is named by k, its degrees of freedom, and k is the only number needed to draw its curve.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the notation and the definition
Notation
Every symbol in the definition has a consequence. Hover over each one before you go on, because each of the five facts later in the deck traces back to one of these labels.
Annotate
On: \( X \sim \chi^2_{\text{df}}, \qquad \chi^2 = (Z_1)^2 + \cdots + (Z_k)^2 \)
Say it as a sentence: a chi-square with k degrees of freedom is what you get by adding up k independent squared z-scores. If you remember that sentence, you can rebuild every fact on the list rather than memorising it.
In later sections the degrees of freedom are not the number of z-scores you can point to; they are counted from the shape of the data. The definition tells you what the curve is; the test tells you which curve to use.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the definition and the notation
Picture it
Before adding anything, look at what squaring does to a single z-score. On the upper line are six z-scores, three negative and three positive. Follow each arrow down to its square.
Figure (svg): Two number lines. The upper one runs from minus 3 to 3 and is labelled z; the lower one runs from 0 to 9 and is labelled z squared. Arrows carry minus 2 and 2 both to 4, minus 1.5 and 1.5 both to 2.25, and minus 0.5 and 0.5 both to 0.25. The band from minus 1 to 1 on the upper line, holding 68.27 percent of a standard normal, lands on the band from 0 to 1 on the lower line.
Minus 2 and 2 both land on 4; minus 0.5 and 0.5 both land on 0.25. The negative half of the line is folded onto the positive half, so the squared values all live at zero or above.
The fold also explains the warm-up. The band from minus 1 to 1, which holds 68.27 percent of a standard normal, lands exactly on the band from 0 to 1. So 68.27 percent of squared z-scores are less than 1.
Notice the spacing too. Near zero the squares bunch up: 0.5 goes to 0.25. Out in the tails they spread apart: 2 goes to 4 and 3 would go to 9. Squaring crowds the common values against zero and flings the rare ones far to the right. That is the right skew, before a single sum has been taken.
Worked example
Suppose three independent standard normal values come out as 1.2, minus 0.5 and 2.0 (made-up values, chosen to be easy to square). Build the chi-square value they produce, say how many degrees of freedom it has, and compare it with the centre of its distribution.
The plan is the definition, line by line: square each value, then add. The degrees of freedom are simply how many squares went into the sum.
Square the first value
Why: a positive number squared.
\[ (1.2)^2 = 1.44 \]
Square the second value
Why: the minus sign disappears when you square.
\[ (-0.5)^2 = 0.25 \]
Square the third value
Why: the largest z-score gives by far the largest square.
\[ (2.0)^2 = 4.00 \]
Add the three squares
Why: the definition is a sum.
\[ \chi^2 = 1.44 + 0.25 + 4.00 = 5.69 \]
Count the terms for the degrees of freedom
Why: three squared z-scores were added.
\[ \text{df} = 3 \]
Look at where the total came from: 4 of the 5.69 is the single z-score of 2. One large deviation dominates a chi-square sum, because squaring magnifies big values far more than small ones.
That is exactly what the chapter's tests want. A single category or cell that is badly off should be able to push the statistic up on its own, and squaring guarantees it. Small, harmless deviations, like the minus 0.5 here, barely register.
Check it against the centre of its curve
Why: the mean of a chi-square is its df, 3, and its standard deviation is the square root of 6, about 2.45. So 5.69 is a little over one standard deviation above the centre: unremarkable, which is right for three ordinary z-scores.
\[ \frac{5.69 - 3}{\sqrt{6}} = \frac{2.69}{2.449} = 1.10 \]
Intuition
A definition is easier to trust once you have watched it work. Here are 2000 simulated standard normal values, each squared, gathered into a histogram. The smooth curve is the chi-square curve with one degree of freedom.
Figure (svg): A histogram of 2000 simulated squared standard normal values, in bins a quarter wide from 0 to 6. The first bar is by far the tallest and the bars fall away quickly to the right. The chi-square curve with one degree of freedom runs along the tops of the bars. 1372 of the 2000 values are below 1.
Count the evidence. Of the 2000 squares, 1372 are below 1, which is 68.6 percent: the warm-up promised 68.27 percent, and the simulation agrees to within a fraction of a percent. The first bar towers over the rest because most z-scores are close to zero, and their squares are closer still.
Now the average. The 2000 squares average 0.9905, very close to 1. That is not a coincidence, and the next worked example proves it must be exactly 1 in the long run.
The shape is extreme: the curve shoots up at zero and has a long tail on the right. A chi-square with one degree of freedom is the most lopsided member of the family. Adding more squares will smooth it out, as the end of this part shows.
Worked example
Show that a squared standard normal has mean 1, and use that to find the mean of a chi-square variable with k degrees of freedom.
The tool is the shortcut formula for a variance from chapter 4: the variance is the mean of the square minus the square of the mean. For a standard normal you already know both the variance and the mean, so you can solve for the mean of the square.
Write the variance shortcut
Why: variance equals the mean of the square minus the square of the mean.
\[ \text{Var}(Z) = E(Z^2) - \left[E(Z)\right]^2 \]
Substitute the standard normal's values
Why: its variance is 1 and its mean is 0.
\[ 1 = E(Z^2) - 0^2 \]
Solve for the mean of the square
Why: zero squared is zero.
\[ E(Z^2) = 1 \]
Add k of them
Why: the mean of a sum is the sum of the means.
\[ E(\chi^2) = E(Z_1^2) + \cdots + E(Z_k^2) = 1 + 1 + \cdots + 1 \]
Count the ones
Why: there are k terms, each contributing 1.
\[ \mu = k = \text{df} \]
This is the book's statement that the population mean is the degrees of freedom, and now you can see why: each squared z-score contributes one on average, and df of them are added.
Notice that independence was not needed for this step; the means of any variables add. Independence matters for the next slide, where the variances are added, and for the normal approximation in Part 3.
Check against the simulation
Why: the 2000 simulated squares averaged 0.9905, within about one percent of 1, and the 2000 simulated sums of three squares averaged 3.00, close to 3.
\[ \bar{x}_{Z^2} = 0.9905 \approx 1, \qquad \bar{x}_{\text{sum of 3}} = 3.00 \approx 3 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the population mean is df
Concept
The book's second formula is the spread. Its derivation needs one fact you can take on trust at this level: the average of Z to the fourth power is 3. Then the variance shortcut gives the variance of one squared z-score.
\[ \text{Var}(Z^2) = E(Z^4) - \left[E(Z^2)\right]^2 = 3 - 1^2 = 2 \]
Each squared z-score has variance 2. The terms are independent, and for independent variables the variances add, just as the means did. So k terms give a variance of 2k.
\[ \sigma^2 = 2k, \qquad \sigma = \sqrt{2\,\text{df}} \]
Read the two formulas side by side. The mean grows like df itself, but the standard deviation grows only like the square root of df. Double the degrees of freedom and the centre doubles, while the spread grows by a factor of only about 1.41.
That mismatch will matter twice in this deck: it is why the curves flatten and spread as df grows, and it is why the skew gradually disappears. Relative to its own centre, a chi-square curve gets narrower and narrower.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the population standard deviation is the square root of 2 df
Notation
The two formulas are short, but each symbol carries a reason. Hover over each piece; the third formula, the ratio, is the one that explains how the shape changes.
Annotate
On: \( \mu = \text{df}, \qquad \sigma = \sqrt{2\,\text{df}}, \qquad \frac{\sigma}{\mu} = \sqrt{\frac{2}{\text{df}}} \)
Check the ratio at the two ends of the book's examples. At df 2 it is exactly 1, the spread as large as the centre. At df 1000 it is about 0.045, the spread under a twentieth of the centre. One formula, two completely different shapes.
Keep the variance and the standard deviation apart in your head. Twice df is the variance, in squared units; the standard deviation is its root, in the same units as the statistic itself, and it is the standard deviation you use to say how far a statistic is from df.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — μ = df and σ = √(2 df)
Worked example
If the number of degrees of freedom for a chi-square distribution is 25, what are the population mean and standard deviation?
Both answers come straight from df, with no data. The only things that can go wrong are taking the square root of df instead of twice df, or forgetting the square root altogether.
Read off the degrees of freedom
Why: given in the question.
\[ \text{df} = 25 \]
The mean equals df
Why: each of the 25 squared z-scores contributes 1 on average.
\[ \mu = 25 \]
Double the df
Why: the variance is twice the degrees of freedom.
\[ 2\,\text{df} = 2(25) = 50 \]
Take the square root for the standard deviation
Why: the standard deviation is the root of the variance.
\[ \sigma = \sqrt{50} = 7.0711 \]
In context: a chi-square statistic computed on 25 degrees of freedom will typically land within about 7 of 25, so values from roughly 18 to 32 are ordinary. The book's printed answer, 7.0711, agrees.
Those two numbers are already enough to sketch the curve: a hump peaking at 23, two units left of the mean, with a longer tail on the right than on the left. Whenever you are given df, sketch first; a statistic is much easier to judge once the curve is on paper.
Check by squaring back
Why: the standard deviation squared must return the variance, twice df.
\[ (7.0711)^2 = 50.00 = 2(25) \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 practice, p. 590 — Exercise 1, answer on p. 609
Fill the middle
Fill in the mean and the standard deviation for each curve. These two were picked so that twice df is a perfect square, so the roots come out whole.
Fill in the blanks
\text18 = 18: \; \mu = 6, \; \sigma = \sqrt50 = 10; \qquad \text___ = 50: \; \mu = ___, \; \sigma = \sqrt___ = ___
Why: The mean is always the degrees of freedom, so 18 and 50. Twice 18 is 36, whose root is 6; twice 50 is 100, whose root is 10.
Compare the two curves. The df 50 curve is centred almost three times further right than the df 18 curve, but its spread is only 10 against 6, less than twice as wide. That is the square root at work: the centre runs ahead of the spread.
A quick sense check worth making a habit: the standard deviation of a chi-square is always smaller than its mean once df is above 2. If you ever get a spread larger than the centre for a big df, you have doubled the wrong thing.
Trap
Homework 70 asks whether this is true. A first attempt reads the formula loosely and says yes, so for df 8:
\[ \sigma = 2(8) = 16 \]
Wrong. That doubles df and stops, forgetting the square root.
Twice df is the variance. The standard deviation is its square root.
\[ \sigma = \sqrt{2(8)} = \sqrt{16} = 4 \]
So the statement is false: for df 8 the spread is 4, half the mean, not twice it. A spread of 16 would put zero only half a standard deviation below a centre of 8, a curve far more lopsided than any chi-square.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 homework, p. 596 — Exercise 70
Prediction
You compute a chi-square statistic for a test, and your calculator shows minus 2.4. Before reading the options, think about the definition: what is every term in the sum?
Predict first
What does a chi-square value of minus 2.4 tell you?
Correct: An arithmetic or entry error has been made
Why: Every term in a chi-square sum is a square, or in later sections a square divided by a positive number, so the total can never be negative. A negative value is always a mistake, most often a lost square or a subtraction in place of an addition.
\[ \chi^2 = (Z_1)^2 + \cdots + (Z_k)^2 \ge 0 \]
This is the book's third fact: the test statistic for any chi-square test is always greater than or equal to zero. It costs nothing to use as a check. Before you look up a p-value, glance at the sign; a negative statistic has nowhere to sit on the curve, which starts at zero.
The other options describe real readings of real statistics, and Part 5 meets them. An unusually good fit shows up as a statistic well below df, and a bad fit as one far above it; neither ever crosses below zero.
Intuition
One squared z-score piles up against zero. Watch what happens when you add three of them. Here are 2000 simulated sums, each of three independent squared z-scores, with the chi-square curve for three degrees of freedom drawn over them.
Figure (svg): A histogram of 2000 simulated sums of three squared standard normals, in bins half a unit wide from 0 to 14. The bars rise from near zero to a peak around 1 and then fall away slowly to the right. The chi-square curve with three degrees of freedom runs along their tops. A dashed line marks the mean, 3.
The tallest bars are no longer at zero. For the sum to be close to zero, all three z-scores would have to be close to zero at the same time, and that is rare. So the pile lifts off zero and its peak moves to about 1.
The simulated sums average 3.00, close to the theoretical mean of 3, and 94 of the 2000 exceed 8. The long right tail is still there: one large z-score in the three is enough to push the sum far out.
This is the general pattern. Every extra squared z-score shifts the curve right by about one, widens it a little, and makes it a little less lopsided. Part 2 shows the whole family at once.
Section
Part 2
Concept
The book's first two facts are about shape. The curve is nonsymmetrical and skewed to the right, and there is a different chi-square curve for each value of df. Here are five of them, drawn from the formula for the density.
Figure (svg): Five chi-square curves on one set of axes, x from 0 to 30. The df 1 curve shoots up at zero; the df 2 curve starts at height one half and falls; the df 4 curve peaks at 2; the df 8 curve peaks at 6; the df 15 curve peaks at 13 and is the lowest and widest. Each is labelled near its peak.
Read the family from left to right. With df 1 the curve shoots up at zero. With df 2 it starts at height one half and only falls. From df 3 on, it starts at zero, rises to a hump and falls away with a long right tail.
As df grows the hump moves right, because the mean is df. It gets lower and wider, because the spread grows and the area must stay one. And it gets less lopsided. The book's Figure 11.2 shows two of these, df 2 and df 24, which are the two ends of that story.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — facts 1 and 2, and Figure 11.2
Tweak it
Here is the chi-square density with df on a slider. Before you move it, predict where the peak will be for df 10, and whether the curve at df 40 will look closer to a bell than the curve at df 4.
Parameter explorer
Slide df from 1 to 40. For each value, read off roughly where the peak is and compare it with df. When does the curve stop touching its highest point at zero, and how does its height change as df grows?
\[ \text{df} = {k}: \quad \mu = {k}, \quad \sigma = \sqrt{2 \times {k}} \]
What to notice: from df 3 onwards the peak sits two units left of df, at 2 for df 4, at 8 for df 10, at 38 for df 40. The readout's mean is always two units to the right of the peak you see.
Notice the height as well. At df 4 the peak is about 0.18; at df 40 it is under 0.05. The area must stay exactly one, so a curve that spreads wider has to sink lower. That trade-off is the same one you saw for normal curves with a larger standard deviation.
Concept
Fact 1 says the curve is skewed to the right. The definition explains why in one line: the variable cannot go below zero, but it has no upper limit. So the left side of the curve runs into a wall and the right side is free.
You can measure how close the wall is. Zero sits a certain number of standard deviations below the mean, and that number is the mean divided by the standard deviation:
\[ \frac{\mu - 0}{\sigma} = \frac{\text{df}}{\sqrt{2\,\text{df}}} = \sqrt{\frac{\text{df}}{2}} \]
For df 2 that is exactly 1: zero is one standard deviation below the mean, so the curve has almost no room on the left. For df 50 it is 5. For df 1000 it is about 22.4, and the wall has stopped mattering.
\[ \sqrt{2/2} = 1, \qquad \sqrt{50/2} = 5, \qquad \sqrt{1000/2} \approx 22.4 \]
A normal curve has nearly all of its area within three standard deviations of its centre, on both sides. A chi-square curve with the wall closer than about three standard deviations cannot be symmetric: the left side gets cut short and the right side stretches out.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — fact 1: nonsymmetrical and skewed right
Worked example
The book's Practice 2 asks what the distribution is when df is above 90, and what it is when df is 15. Take the second half: show by numbers that the chi-square curve with 15 degrees of freedom is still noticeably skewed.
The plan is to find the wall's distance in standard deviations, then compare how far the curve reaches on each side of its centre, using the exact 5th and 95th percentiles from technology.
The mean and standard deviation
Why: the mean is df and the standard deviation is the root of twice df.
\[ \mu = 15, \qquad \sigma = \sqrt{30} = 5.477 \]
How far below the mean is zero?
Why: divide the mean by the standard deviation.
\[ \frac{15}{5.477} = 2.74 \text{ standard deviations} \]
Look up the exact outer percentiles
Why: the chi-square 5th and 95th percentiles for df 15.
\[ x_{0.05} = 7.261, \qquad x_{0.95} = 24.996 \]
Distance from the mean on each side
Why: subtract in each direction.
\[ 15 - 7.261 = 7.74, \qquad 24.996 - 15 = 10.00 \]
Figure (svg): The chi-square curve with 15 degrees of freedom, solid, and the normal curve with mean 15 and standard deviation 5.48, dashed, for x from 0 to 35. The exact 5th percentile, 7.26, and 95th percentile, 25.00, are marked with yellow lines. The normal's matching points, 5.99 and 24.01, are marked with grey dashes.
In context: at df 15 the curve reaches 10 units above its centre to cover the top 5 percent, but only 7.74 below it for the bottom 5 percent. So Practice 2 answers itself: above df 90 the distribution is approximately normal; at df 15 it is a chi-square, still skewed right, and must be treated as one.
Check against the normal's prediction
Why: a normal curve would put both percentiles 1.645 standard deviations from the centre, the same distance each way.
\[ 1.645(5.477) = 9.01 \text{ on both sides, against } 7.74 \text{ and } 10.00 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 practice, p. 590 — Exercise 2
Concept
The book's fifth fact is that the mean is located just to the right of the peak. You met the reason in Chapter 2: in a right-skewed distribution, the long right tail pulls the mean out past the most common values.
For the chi-square the gap can be made exact. From df 3 onwards, the peak of the curve, its mode, is at df minus 2:
\[ \text{peak} = \text{df} - 2, \qquad \mu = \text{df} \]
So the mean is always exactly two units to the right of the peak. Two units is a lot when df is 4, where the peak is at 2 and the mean at 4. It is almost nothing when df is 1000. That is the sense of the book's word just.
Two small cases sit outside the rule. For df 1 and df 2 the highest point of the curve is at zero itself, so the mean, 1 or 2, is still to the right of the peak, but the peak is the wall rather than a hump.
The median falls between the two. That gives the order you should expect on any right-skewed curve, and the next figure draws it for df 24, the curve from the book's own Figure 11.2.
\[ \text{peak} < \text{median} < \text{mean} \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, pp. 564-565 — fact 5 and Figure 11.3
Worked example
True or false: the mean and the median of the chi-square distribution are the same if df is 24.
Twenty-four degrees of freedom is a fairly large number, and the curve in the book's Figure 11.2 looks almost symmetric. The question is whether almost is enough. Find all three centres and compare.
The mean
Why: equal to df.
\[ \mu = 24 \]
The peak
Why: two less than df.
\[ \text{peak} = 24 - 2 = 22 \]
The median, from technology
Why: the 50th percentile of the chi-square with df 24.
\[ \text{median} = 23.34 \]
Compare
Why: the three are close but in a strict order.
\[ 22 < 23.34 < 24 \]
The median has no closed-form formula, which is why it comes from technology. A useful approximation for df of a few or more is df times the cube of one minus 2 over 9 df; for df 24 it gives 23.34, matching the exact value to two decimals.
Figure (svg): The chi-square curve with 24 degrees of freedom, drawn for x from 5 to 50. Three dashed vertical lines sit close together under the hump: the peak at 22 in orange, the median at 23.34 in blue, and the mean at 24 in yellow. The area to the left of the median is shaded faint blue.
In context: the statement is false. The median is about two thirds of a unit below the mean. The curve still leans right at df 24, just as the book's first fact says every chi-square curve does. The answer key on page 611 agrees: false.
Check with the area to the left of the mean
Why: if the mean were the median, exactly half the area would lie below 24. The actual area there is more than a half, so the median must sit below 24.
\[ P(X < 24) = 0.538 > 0.5 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 homework, p. 596 — Exercise 71, answer on p. 611
Worked example
The book's Figure 11.13 shows a chi-square curve that is highest at the vertical axis and falls steadily to the right, with no hump at all. Is it more likely that df is 90, 20 or 2?
You do not need a table here. Use what you know about where each curve's highest point is: from df 3 on it is at df minus 2, and for df 2 it is at zero. Then match the description.
Where would df 90 peak?
Why: two less than df.
\[ \text{peak} = 90 - 2 = 88 \]
Where would df 20 peak?
Why: two less than df.
\[ \text{peak} = 20 - 2 = 18 \]
Where does df 2 peak?
Why: for df 2 the curve is highest at zero and only falls.
\[ f(x) = \tfrac{1}{2}e^{-x/2}, \quad f(0) = \tfrac{1}{2} \]
Figure (svg): Three panels, each a chi-square curve on its own axes. Left, df 2: the curve is highest at zero, height one half, and falls steadily. Middle, df 20: a lopsided hump peaking at 18. Right, df 90: a nearly symmetric hump peaking at 88.
In context: the pictured curve is highest at zero, so df is 2, the book's answer. A curve with df 20 has a clear hump at 18, and one with df 90 is a near-symmetric bell around 88. Strictly, df 1 also has its highest point at zero, but it was not among the choices.
Check the formula against the picture
Why: the density for df 2 should start at one half and fall by a factor of e every 2 units, which is what the left panel shows.
\[ f(2) = \tfrac{1}{2}e^{-1} = 0.184, \quad f(4) = \tfrac{1}{2}e^{-2} = 0.068 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 practice, p. 590 — Exercise 5 and Figure 11.13, answer on p. 609
Ranking
Four landmarks of the chi-square curve with 24 degrees of freedom have come up or are easy to find. Put them in order from smallest to largest, reasoning from the facts rather than guessing.
Put in order
Order these values for the chi-square distribution with df 24, from smallest to largest.
Why: On a right-skewed curve the peak comes first, then the median, then the mean, which the long tail pulls furthest right. The 95th percentile is far out in that tail, about two standard deviations of 6.93 beyond the mean.
\[ \sigma = \sqrt{48} = 6.93, \qquad \frac{36.42 - 24}{6.93} = 1.79 \]
The 95th percentile is 1.79 standard deviations above the mean. On a normal curve it would be 1.645. The extra distance is the right tail stretching, the same skew you met at df 15, now smaller but still there.
This ordering, peak then median then mean, is worth remembering as a pattern rather than a fact about chi-square alone. You saw it for exponential waiting times in Section 5.3 and for skewed data in Chapter 2.
Sorting
Every fact on the book's list traces back to one of two features of the definition: the terms are squares, or there are df of them added together. Sort each fact by the feature that explains it.
Sort into buckets
Sort each fact about the chi-square distribution by the feature of the definition that explains it.
Skew is the one to think about. It comes from the floor at zero, which comes from squaring. The fold picture in Part 1 showed it before any sum was taken: squaring crowds small values against zero and flings large ones far right.
Summing works against it: the more terms you add, the further the curve moves from the floor and the more symmetric it becomes.
So the two features pull in opposite directions. Squaring makes each term lopsided; summing many terms smooths the total towards a bell. Which one wins depends on df, and that is the whole story of the family of curves.
Error analysis
Someone summarising the section writes four claims, numbered below. Two are wrong. Hover over each label to see which, and why.
Annotate
On: \( \begin{aligned} &(1)\; \text{df is always } n - 1 \\ &(2)\; \text{the peak is right of the mean} \\ &(3)\; \mu = \text{df} \\ &(4)\; \sigma = \sqrt{2\,\text{df}} \end{aligned} \)
Claim 1 is the error that does the most damage later. The book flags it in its first paragraph: use n minus 1 when you practise computing chi-square probabilities, but the three major uses each count degrees of freedom differently. Part 4 shows all three.
Claim 2 is a reversal you can catch with a sketch. Draw any right-skewed hump: the long side is on the right, and the balance point has to move towards the long side. For the chi-square you even know by how much: the mean is exactly two units right of the peak.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the note on df and fact 5
Estimation
Take a chi-square with 4 degrees of freedom, mean 4. Before computing anything, estimate how much of the area lies to the right of the mean.
Predict first
Roughly what fraction of a chi-square distribution with df 4 lies above its mean of 4?
Correct: About 0.41
Why: The mean is to the right of the median, so less than half the area lies above it. For df 4 the exact value is 0.406. The long right tail drags the mean out, so most values fall below it.
| df | 1 | 2 | 4 | 15 | 24 | 90 | 1000 |
|---|---|---|---|---|---|---|---|
| area above the mean | 0.317 | 0.368 | 0.406 | 0.451 | 0.462 | 0.480 | 0.494 |
The table shows the pattern. At df 1 under a third of the area lies above the mean. As df grows the fraction climbs towards one half, because the curve is becoming symmetric, but it never quite gets there.
The df 2 entry, 0.368, may look familiar. It is e to the minus 1, the fraction of an exponential above its mean from Section 5.3. That is because the chi-square with two degrees of freedom is an exponential distribution, which Part 5 uses.
Section
Part 3
Concept
The book's fourth fact is that when df is greater than 90, the chi-square curve approximates the normal distribution, with the same mean and standard deviation:
\[ \text{df} > 90: \qquad X \sim \chi^2_{\text{df}} \;\text{ is approximately }\; N\left(\text{df}, \sqrt{2\,\text{df}}\right) \]
You already own the reason. A chi-square variable is a sum of df independent pieces, each a squared z-score with mean 1 and variance 2. The central limit theorem from Chapter 7 says that a sum of many independent pieces with the same distribution is approximately normal, whatever the shape of each piece.
Each piece here is very lopsided, as the df 1 histogram showed. That is why it takes a lot of them, around 90 by the book's rule, before the sum looks convincingly normal. With more symmetric pieces the theorem kicks in much sooner.
normal approximation to the chi-square — For a large number of degrees of freedom, roughly more than 90, a chi-square variable is approximately normal with mean df and standard deviation the square root of 2 df, by the central limit theorem.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — fact 4
Worked example
For X with a chi-square distribution on 1000 degrees of freedom, find the mean and standard deviation, and state the approximating normal distribution.
This is the book's own example of fact 4. The steps are the same as for any df; the new last step names the normal curve that stands in for the chi-square, and the check tests how good that stand-in is.
The mean
Why: equal to df.
\[ \mu = 1000 \]
Twice df
Why: the variance.
\[ 2(1000) = 2000 \]
The standard deviation
Why: the root of the variance.
\[ \sigma = \sqrt{2000} = 44.72 \]
State the approximation
Why: df is well above 90, so use the normal with the same mean and spread.
\[ X \sim N(1000,\; 44.7) \text{ approximately} \]
In context: a chi-square statistic on 1000 degrees of freedom will almost always fall between about 870 and 1130, three standard deviations either side. The book's printed values, 1000 and 44.7, agree.
Why would anyone meet 1000 degrees of freedom? A test of independence on a large table gets there quickly: a 26 by 41 table already has 25 times 40, which is 1000. Chi-square tables stop long before that, so the normal curve is what you would actually use.
Check the approximation with an exact percentile
Why: the chi-square's exact 95th percentile from technology should be close to the normal's, the mean plus 1.645 standard deviations. They differ by about 1 unit in 1000, a tenth of a percent.
\[ 1000 + 1.645(44.72) = 1073.6 \quad \text{against exact } 1074.7 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — fact 4: X ~ N(1000, 44.7)
Picture it
Here is that comparison as a picture. The solid curve is the exact chi-square with 1000 degrees of freedom; the dashed curve is the normal with mean 1000 and standard deviation 44.7.
Figure (svg): The chi-square curve with 1000 degrees of freedom, solid, and the normal curve with mean 1000 and standard deviation 44.7, dashed, drawn for x from 850 to 1150. The two curves are almost indistinguishable; the solid one leans very slightly to the right.
The two curves lie almost on top of each other. Look closely at the hump and you can see the solid curve sitting a hair to the left of the dashed one: the peak is at 998, two units left of the mean, exactly as fact 5 predicts. That is all that remains of the skew.
\[ \frac{\mu}{\sigma} = \frac{1000}{44.72} = 22.4 \]
The reason the skew has vanished is the number above. The wall at zero is 22.4 standard deviations below the centre, so far away that no part of the curve comes anywhere near it. With nothing cutting off its left side, the sum is free to take the bell shape that the central limit theorem promises.
Out in the far tails the two still disagree a little. Above 1100 the exact chi-square area is 0.0146 and the normal gives 0.0127. For everyday percentiles the approximation is excellent; for extreme tail areas, use the exact curve.
Worked example
The book draws the line at 90. How good is the normal approximation exactly there? Compare the two tail areas two standard deviations either side of the mean.
If the curve were truly normal, the two tails would be equal, 0.0228 each. Any difference between them measures the skew that is left. Before computing, predict which tail will be bigger: the skew is to the right, so the right tail should hold more.
The mean and standard deviation
Why: df and the root of twice df.
\[ \mu = 90, \qquad \sigma = \sqrt{180} = 13.42 \]
Two standard deviations either side
Why: add and subtract twice the spread.
\[ 90 \pm 2(13.42) = 63.17 \text{ and } 116.83 \]
Exact right tail, from technology
Why: the chi-square area above 116.83.
\[ P(X > 116.83) = 0.0302 \]
Exact left tail, from technology
Why: the chi-square area below 63.17.
\[ P(X < 63.17) = 0.0142 \]
Figure (svg): The chi-square curve with 90 degrees of freedom, solid, and the normal curve with mean 90 and standard deviation 13.42, dashed, for x from 40 to 150. The two curves are close but the solid one peaks slightly to the left and has a slightly heavier right tail. The tail beyond 116.83 is shaded orange and labelled 0.0302; the tail below 63.17 is shaded blue and labelled 0.0142.
In context: at df 90 the right tail is about twice the left. The approximation gets the total of the two tails roughly right, 0.044 against the normal's 0.046, but it misplaces the area between them. For a right-tailed test, which all of Sections 11.2 to 11.4 are, the normal slightly understates the tail.
Check against the normal's prediction
Why: the normal gives the same area on both sides, and the exact values straddle it, one above and one below.
\[ 0.0142 < 0.0228 < 0.0302 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — fact 4: the threshold df > 90
Picture it
Why does the skew fade as df grows? One ratio carries the answer: the standard deviation divided by the mean. Here it is, plotted against df.
\[ \frac{\sigma}{\mu} = \frac{\sqrt{2\,\text{df}}}{\text{df}} = \sqrt{\frac{2}{\text{df}}} \]
Figure (svg): A falling curve of the standard deviation divided by the mean, the square root of 2 over df, for df from 1 to 120. Dots mark df 2 at 1.00, df 15 at 0.37, df 90 at 0.15. A dashed line marks df 90.
At df 2 the ratio is 1: the spread is as big as the centre, and the curve is crushed against zero. At df 15 it is 0.37, and the curve has a visible hump with a long tail. At df 90 it is 0.15, and the curve is close to a bell.
The ratio never reaches zero, which is why the book's threshold is a rule of thumb rather than a theorem. It falls steeply at first and then slowly. By df 90 most of the fall is over, and doubling df to 180 would shrink the ratio only from 0.15 to 0.11.
This is the same square-root law that runs through Chapter 7: the spread of a sum grows like the square root of the number of terms, while the sum itself grows like the number of terms. Relative to its size, a long sum is very predictable.
Trap
For df 15, a first attempt finds the 95th percentile with the normal approximation:
\[ 15 + 1.645(5.477) \]
\[ = 24.01 \]
Wrong. Fifteen is far below 90; the curve is still skewed.
Use the exact chi-square percentile from a table or technology:
\[ x_{0.95} = 25.00 \]
The normal value is a whole unit too small, so a statistic of 24.5 would be wrongly called significant. In the other tail the normal gives 5.99 against the exact 7.26.
Below df 90, always use the chi-square table or a calculator.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — fact 4 applies only for df > 90
Fill the middle
A chi-square has 200 degrees of freedom, well past the book's threshold. Fill in the approximating normal distribution.
Fill in the blanks
\chi^2_400 \;\text20\; N\left(200,\; \sqrt___}\right) = N(200,\; ___)
Why: Twice 200 is 400, the variance, and its square root is 20, the standard deviation. The mean stays at 200, so the approximating normal has mean 200 and standard deviation 20.
Test it the same way as for df 1000. The normal's 95th percentile is 200 plus 1.645 times 20, which is 232.9. The exact chi-square value is 234.0. The approximation is good, but notice the exact value is again a little further out: the faint right skew never quite disappears.
\[ 200 + 1.645(20) = 232.9 \quad \text{against exact } 234.0 \]
At df 1000 the gap was about one unit in 1074; at df 200 it is about one unit in 234. Smaller df, larger relative error, which is the ratio picture from two slides ago in numbers.
Edge cases
The normal approximation is honest about its own limits if you push it far enough. Try it where it should fail badly, at df 2.
Discussion prompt
Use the normal approximation for a chi-square with df 2: mean 2 and standard deviation 2. What probability does it give to the chi-square being negative, and why does that show the approximation has broken down?
This is the clearest possible failure: an answer that is not merely inaccurate but impossible. It shows exactly what goes wrong at small df. The normal curve has two tails of equal length, and the chi-square has room for only one.
Where does the spill-over become negligible? A normal puts about 0.00003 beyond four standard deviations. The wall reaches four standard deviations below the mean when the square root of df over 2 equals 4, at df 32. The book's 90 is more cautious, because a curve can be skewed long before it spills over the wall.
Comparison
You now have three continuous families that the book uses for inference. Fill in the blanks; each comes from a fact on an earlier slide.
Comparison matrix
| distribution | values it can take | shape | centre | set by |
|---|---|---|---|---|
| standard normal Z | all real numbers | symmetric bell | 0 | nothing: one curve |
| t distribution | all real numbers | symmetric, heavier tails | 0 | df = n − 1 |
| chi-square | 0 and up | skewed right | df | df, counted per test |
Read the last column carefully. The t distribution's df is always n minus 1 in Chapters 8 and 9. The chi-square's df is counted differently in each test, which is why Part 4 is devoted to it.
Read the shape column too. The normal and t are symmetric about zero, so a test can use either tail. The chi-square starts at zero and is centred at df, so a large statistic means something different from a small one, the subject of Part 5.
Section
Part 4
Concept
The book is explicit: df depends on how chi-square is being used, and the degrees of freedom for the three major uses are each calculated differently. Here are the three rules you will use in Sections 11.2 to 11.6.
| test | data | degrees of freedom |
|---|---|---|
| goodness of fit (11.2) | one variable in k categories | df = k − 1 |
| independence (11.3), homogeneity (11.4) | a table of r rows and c columns | df = (r − 1)(c − 1) |
| single variance (11.6) | n measurements | df = n − 1 |
One principle sits behind all three, and you met it in Section 8.2 with the t distribution. The degrees of freedom count the values that are free to vary. Every constraint the data must satisfy fixes one value and costs one degree of freedom.
For goodness of fit, the k expected counts must add up to the same total as the observed counts: one constraint, so k minus 1. For a table, the row totals and column totals are fixed, which pins down a whole row and a whole column. For a variance, the n deviations from the sample mean must add to zero: one constraint, so n minus 1.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — df depends on how chi-square is being used
Notation
The three rules look like three unrelated formulas. Read each piece as a count of values, minus a count of constraints, and they become one idea.
Annotate
On: \( k - 1, \qquad (r - 1)(c - 1), \qquad n - 1 \)
Notice which letter is missing from the first two rules: n. In a goodness-of-fit test or a table test, the number of people or objects sampled never enters the degrees of freedom. What counts is how many numbers the statistic adds up and how many of them are tied down.
The third rule is the familiar one from the t distribution, and it is the only one of the three that depends on the sample size. That familiarity is exactly why it gets misapplied to the other two tests.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 formula review, pp. 589-590 — df for each test
Worked example
Faculty expected 100 students to miss class as follows: 0 to 2 absences, 50; 3 to 5, 30; 6 to 8, 12; 9 to 11, 6; 12 or more, 2. A survey observed 35, 40, 20, 1 and 4. How many degrees of freedom does the goodness-of-fit test have?
Count categories, but only after checking the condition the book's note sets: every expected count must be at least five. If one is too small, categories are combined first, and the count changes.
Check every expected count
Why: the 12-or-more category expects only 2, below five.
\[ E_{12+} = 2 < 5 \]
Combine it with its neighbour
Why: merge 9 to 11 with 12 or more, as the book does.
\[ E_{9+} = 6 + 2 = 8, \qquad O_{9+} = 1 + 4 = 5 \]
Count the categories that remain
Why: 0 to 2, 3 to 5, 6 to 8, and 9 or more.
\[ k = 4 \]
Subtract one
Why: the expected counts must total the same 100 students as the observed counts.
\[ \text{df} = k - 1 = 4 - 1 = 3 \]
Figure (svg): A paired bar chart for four absence categories: 0 to 2, 3 to 5, 6 to 8, and 9 or more. Blue bars are the faculty's expected counts, 50, 30, 12 and 8; orange bars are the observed counts, 35, 40, 20 and 5. Each pair is labelled with its two numbers.
In context: the test of whether absenteeism fits faculty perception uses the chi-square curve with 3 degrees of freedom, not 4 and not 99. Combining categories happened before counting, so the five categories in the original table are not the ones that count.
Check the constraint and the condition
Why: both columns still total 100, and every expected count is now at least five.
\[ 50 + 30 + 12 + 8 = 100 = 35 + 40 + 20 + 5, \quad \min E = 8 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.2, pp. 565-566 — Example 11.1, Tables 11.1 to 11.4
Concept
For a two-way table the rule is rows minus one times columns minus one. Here is why it is a product rather than a sum. Take a table with 3 rows and 4 columns, with all the row and column totals already fixed.
Figure (svg): A grid of 3 rows and 4 columns with dashed boxes for the row totals on the right and the column totals underneath. The top-left block of 2 rows by 3 columns is shaded blue and each of its 6 cells says free. The last row and the last column are shaded orange and each of their cells says forced.
Fill in the blue block, 2 rows by 3 columns, however you like. Now each cell in the last column is forced: it is whatever its row still needs to reach its total. Each cell in the last row is forced the same way by its column total.
\[ \text{df} = (r - 1)(c - 1) = (3 - 1)(4 - 1) = 2 \times 3 = 6 \]
So of the 12 cells, only 6 are genuinely free. The free cells form a rectangle with one row fewer and one column fewer than the table, and the area of a rectangle is a product. That is the whole reason for the formula.
The bottom-right cell is forced twice, by its row and by its column, and both give the same value because the grand total is consistent. That double forcing is why you subtract one row and one column, not one cell.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 formula review, p. 590 — df = (number of columns − 1)(number of rows − 1)
Worked example
The standard deviation of waiting times in a doctor's office is claimed to be 3.4 minutes. A random sample of 30 patients has a standard deviation of 4.1 minutes. How many degrees of freedom does the test of a single variance use, and what is its test statistic?
This is the one chapter test where the sample size sets the degrees of freedom, exactly as for a t test. The statistic is a scaled ratio of the sample variance to the claimed variance; Section 11.6 explains it, and here you only compute and place it.
Count the degrees of freedom
Why: n measurements, one constraint from the sample mean.
\[ \text{df} = n - 1 = 30 - 1 = 29 \]
Write the statistic from the formula review
Why: sample variance over claimed variance, scaled by df.
\[ \chi^2 = \frac{(n - 1)s^2}{\sigma^2} = \frac{29(4.1)^2}{(3.4)^2} \]
Square the two standard deviations
Why: variances, in minutes squared.
\[ (4.1)^2 = 16.81, \qquad (3.4)^2 = 11.56 \]
Multiply and divide
Why: numerator first.
\[ \chi^2 = \frac{29(16.81)}{11.56} = \frac{487.49}{11.56} = 42.17 \]
Figure (svg): The chi-square curve with 29 degrees of freedom, x from 0 to 70. A dashed line marks the mean at 29. A yellow line marks the statistic 42.17, and the tail to its right is shaded yellow and labelled 0.0542.
In context: the statistic, 42.17, sits on the chi-square curve with 29 degrees of freedom, whose centre is 29 and spread is 7.62. It is 1.73 standard deviations above the centre, with a right tail of 0.0542. Section 11.6 turns that into a conclusion about the doctor's claim.
Check that the statistic is placed sensibly
Why: if the sample spread equalled the claimed spread, the ratio would be 1 and the statistic would equal df. A sample spread above 3.4 must give a statistic above 29, and it does.
\[ \frac{4.1^2}{3.4^2} = 1.454 > 1 \;\Rightarrow\; 42.17 > 29 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 practice, p. 596 — Exercises 65-68
Matching
Each situation names its data. Work out which test it is first, then apply that test's rule. The sample size is a distraction in two of them.
Match the pairs
Why: The die has 6 categories, so 6 minus 1 is 5, whatever the number of rolls. The voters fill a 4 by 3 table, so 3 times 2 is 6. The coffee cups are a variance test, so 25 minus 1 is 24. The absences have 4 categories after combining, so 3.
The die is the book's Homework 72, and it is the cleanest example of the trap. One hundred and twenty rolls produce six counts, and only six counts enter the statistic. The number of rolls affects how big each count is, not how many there are.
For the voters, notice that 500 never appears in the answer. Neither does 12, the number of cells. Only the table's shape matters, and the shape gives 6 free cells.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 homework, p. 596 — Exercise 72, the die rolled 120 times
Trap
A goodness-of-fit test has 600 observations in 5 categories (a made-up case from the homework seeds). A first attempt reaches for the familiar rule:
\[ \text{df} = n - 1 \]
\[ = 600 - 1 = 599 \]
Wrong. That is the single-variance rule.
Goodness of fit counts categories, not observations:
\[ \text{df} = k - 1 = 5 - 1 = 4 \]
The two curves are worlds apart: one centred at 4, the other at 599. A statistic of 30 is extreme on the first and would look tiny on the second, so the wrong df turns a clear misfit into apparent agreement.
Ask what the statistic adds up: 5 terms, one per category.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — the three uses count df differently
Discrimination
Before any number, decide which of the three rules applies. Look at the shape of the data: one list of category counts, a two-way table, or a set of measurements with a claimed spread.
Sort into buckets
Sort each situation by the degrees-of-freedom rule it uses.
The two colleges are the subtle one. It sounds like comparing two separate lists, but the data form a table, colleges by majors, and Section 11.4's homogeneity test uses the same rule as independence.
The two variance questions are the only ones where you need the number of measurements. In the other four, the sample size could be anything at all and the degrees of freedom would not change.
Notice that the three questions from the chapter's opening page, the lottery, the movies and the coffee, land in three different buckets. The book chose them for exactly that reason.
Section
Part 5
Concept
In every chapter test, the statistic adds up squared differences between what was observed and what was expected. If the null hypothesis is true, those differences are just chance, and the statistic follows the chi-square curve, landing near its mean, df.
If the data really disagree with the claim, the differences are larger than chance allows, their squares are larger still, and the statistic is pushed out into the right tail. So the evidence against the null is always in the right tail, and the book says these tests are almost always right-tailed.
\[ \chi^2 \approx \text{df} \;\Rightarrow\; \text{typical}, \qquad \chi^2 \gg \text{df} \;\Rightarrow\; \text{poor fit} \]
The only reliable way to call a statistic large is to compare it with its own curve: how many standard deviations above df, or what area lies beyond it. A raw number with no df attached tells you nothing, as the next example shows.
The exception is the single-variance test, which may be left-, right- or two-tailed, because a spread can be too small as well as too big.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.2, p. 565 — the goodness-of-fit test is almost always right-tailed
Worked example
A chi-square statistic of 12 arises once on 4 degrees of freedom and once on 20 degrees of freedom. Which one indicates the poorer fit?
Place 12 on each curve. First in standard deviations from the mean, which you can do in your head, then by the exact right-tail area from technology, which is what a p-value will be.
The df 4 curve
Why: mean 4, standard deviation the root of 8.
\[ \mu = 4, \quad \sigma = 2.83, \quad \frac{12 - 4}{2.83} = 2.83 \]
The df 20 curve
Why: mean 20, standard deviation the root of 40.
\[ \mu = 20, \quad \sigma = 6.32, \quad \frac{12 - 20}{6.32} = -1.26 \]
Exact tail on df 4
Why: the area to the right of 12.
\[ P(\chi^2_4 > 12) = 0.0174 \]
Exact tail on df 20
Why: the area to the right of 12.
\[ P(\chi^2_{20} > 12) = 0.9161 \]
Figure (svg): Two panels. Left: the chi-square curve with 4 degrees of freedom, x from 0 to 25, with the small tail beyond 12 shaded red and labelled 0.0174. Right: the chi-square curve with 20 degrees of freedom, x from 0 to 45, with the large region beyond 12 shaded blue and labelled 0.9161. A yellow line marks 12 in both.
In context: on 4 degrees of freedom, 12 is nearly three standard deviations above the centre and only 1.7 percent of chance results are that large, so the fit is poor. On 20 degrees of freedom, 12 is below the centre and 92 percent of chance results exceed it, so the fit is, if anything, better than average.
Why should the same number mean such different things? A statistic on 20 degrees of freedom adds up twenty squared deviations, so it is expected to be bigger; a total of 12 spread over twenty terms means each term is small. On 4 degrees of freedom the same 12 comes from only four terms, each large.
Check with the means alone
Why: a statistic above its df leans towards poor fit and one below its df towards good fit, which agrees with both tail areas.
\[ 12 > 4 \;\text{(poor fit)}, \qquad 12 < 20 \;\text{(good fit)} \]
Worked example
For the combined absenteeism tables, the goodness-of-fit statistic adds up observed minus expected, squared, over expected, for each of the 4 categories. Compute it and place it on its curve. Section 11.2 runs the full test; here the goal is only to read the number.
Each term is a squared difference scaled by its expected count. Compute the four terms, one line each, then add, then compare with df 3.
0 to 2 absences
Why: observed 35, expected 50.
\[ \frac{(35 - 50)^2}{50} = \frac{225}{50} = 4.500 \]
3 to 5 absences
Why: observed 40, expected 30.
\[ \frac{(40 - 30)^2}{30} = \frac{100}{30} = 3.333 \]
6 to 8 absences
Why: observed 20, expected 12.
\[ \frac{(20 - 12)^2}{12} = \frac{64}{12} = 5.333 \]
9 or more absences
Why: observed 5, expected 8.
\[ \frac{(5 - 8)^2}{8} = \frac{9}{8} = 1.125 \]
Add the four terms
Why: the statistic is their sum.
\[ \chi^2 = 4.500 + 3.333 + 5.333 + 1.125 = 14.29 \]
Notice which terms are big. The 6 to 8 category is off by only 8 students, yet contributes the most, because dividing by its small expected count, 12, makes each missing or extra student count for more. A miss of 15 out of an expected 50 contributes less.
Figure (svg): The chi-square curve with 3 degrees of freedom for x from 0 to 18. A dashed line marks the mean at 3. A yellow line marks the statistic 14.29 far out in the right tail, where the curve has almost reached the axis; the tiny tail beyond it is shaded red and labelled 0.0025.
In context: on a curve with mean 3 and standard deviation 2.45, a statistic of 14.29 is 4.6 standard deviations out, with a right tail of only 0.0025. Actual absenteeism looks very different from what the faculty expected. Section 11.2 states this formally.
Check the sign and size of every term
Why: each term is a square over a positive count, so none can be negative, and the largest terms come from the categories where the bars in Part 4 differed most.
\[ 4.500, \; 3.333, \; 5.333, \; 1.125 \; \text{all} \ge 0 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.2, pp. 565-566 — Example 11.1, Tables 11.3 and 11.4
Worked example
The 5 percent right-tail cut-off for a chi-square with one degree of freedom is 3.841. Show where that number comes from, using only the standard normal.
With one degree of freedom the chi-square is a single squared z-score. So a question about its right tail can be turned back into a question about Z, exactly as in the warm-up.
Write df 1 as one squared z-score
Why: the definition with k equal to 1.
\[ \chi^2_1 = Z^2 \]
Translate the tail
Why: Z squared exceeds c exactly when Z is beyond the square root of c, on either side.
\[ P(Z^2 > c) = P(Z < -\sqrt{c}) + P(Z > \sqrt{c}) \]
Set the two normal tails to 0.025 each
Why: the two-sided 5 percent cut-off for Z is 1.96.
\[ \sqrt{c} = 1.96 \]
Square it
Why: undo the square root.
\[ c = (1.96)^2 = 3.8416 \]
The same trick turns any two-sided z cut-off into a df 1 chi-square cut-off. At the 1 percent level the z cut-off is 2.576, and its square, 6.635, is the table's df 1 entry for 0.01. The chi-square table's first row is the normal table, squared.
Figure (svg): Two panels. Left: the standard normal curve from minus 3.5 to 3.5 with both tails beyond minus 1.96 and 1.96 shaded red, each labelled 0.025. Right: the chi-square curve with one degree of freedom from 0 to 8 with the single tail beyond 3.841 shaded red and labelled 0.05.
In context: a two-sided z test at the 5 percent level and a one-degree-of-freedom chi-square test at the 5 percent level are the same test. Squaring folds the normal's two tails into the chi-square's one right tail, which is another reason the chapter's tests are right-tailed.
Check against the table value
Why: the chi-square table gives 3.841 for df 1 at 0.05; the small difference is rounding in 1.96, whose exact value is 1.95996.
\[ (1.95996)^2 = 3.8415 \approx 3.841 \]
Worked example
The chi-square with 2 degrees of freedom has density one half times e to the minus x over 2. Find its 5 percent right-tail cut-off without a table.
That density is the exponential density from Section 5.3, with decay parameter m equal to one half and mean 2. An exponential's right tail has a one-line formula, so the cut-off can be solved for directly.
Recognise the exponential
Why: m is one half, so the mean is 2, which is df, as it must be.
\[ f(x) = \tfrac{1}{2}e^{-x/2} = m\,e^{-mx}, \quad m = \tfrac{1}{2} \]
Write the right tail
Why: for an exponential, the area beyond c is e to the minus m c.
\[ P(X > c) = e^{-c/2} \]
Set the tail to 0.05
Why: the cut-off has 5 percent beyond it.
\[ e^{-c/2} = 0.05 \]
Take natural logarithms
Why: the logarithm undoes the exponential.
\[ -\frac{c}{2} = \ln(0.05) = -2.9957 \]
Multiply by minus 2
Why: solve for c.
\[ c = 2(2.9957) = 5.991 \]
This also confirms two facts from Part 2 at once. The curve is highest at zero, height one half, because an exponential density starts at its maximum m. And its standard deviation equals its mean, 2, which is the square root of twice df, the square root of 4.
Figure (svg): The chi-square curve with 2 degrees of freedom for x from 0 to 12. It starts at height one half at zero and falls steadily. The region beyond 5.991 is shaded red and labelled 0.05.
In context: a chi-square statistic above 5.991 on 2 degrees of freedom happens less than 5 percent of the time by chance. The table's entry for df 2 at 0.05 is 5.991, the same number, now with a reason behind it.
Check by substituting back
Why: the tail at the cut-off must be 0.05.
\[ e^{-5.991/2} = e^{-2.9957} = 0.0500 \]
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §5.3, p. 306 — the exponential right tail, used here for df 2
Counterexample
The chapter's tests look only at the right tail, so a small statistic always leads to not rejecting the null. That suggests a rule: the smaller the statistic, the better. Test the rule against a counterexample.
Discussion prompt
A researcher reports a goodness-of-fit statistic of 0.4 on 10 degrees of freedom. Explain why this result deserves suspicion rather than celebration, using the chi-square curve with df 10.
So the rule fails. The right tail is where the chapter's tests look for disagreement, but the left tail carries information too: agreement too good to be true. The book's Bringing It Together homework asks you what a left-tailed goodness-of-fit test would be testing; this is the answer.
A rough guide: a statistic within a couple of standard deviations of df, on either side, is unremarkable. Far above df suggests a real misfit; far below suggests the data deserve a second look.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11 homework, p. 608 — Exercise 130(b)
Real world
Articles often report a chi-square result in a compact form such as a statistic, its degrees of freedom and a p-value. You can check whether the three agree without recomputing anything from data.
Discussion prompt
A report says: chi-square on 4 degrees of freedom equals 2.1, with p equal to 0.03. Is this internally consistent? Use the mean and spread of the chi-square with df 4 to decide.
This check takes ten seconds and catches real errors in published work. The rule behind it is one you now know: any statistic below its df has a right-tail area above about a half, more precisely above the 0.41 to 0.49 you saw in the estimation table of Part 2.
The reverse check works too. A tiny p-value needs a statistic well above df: at least about two standard deviations out. If a report pairs p equal to 0.001 with a statistic near its df, something is wrong.
Section
Part 6
Pattern
Every question in this section ran through the same short sequence. In the later sections the arithmetic of the statistic grows, but these decisions stay the same, and they come first.
Figure (svg): A flow diagram. A box asks what the data look like. One arrow leads to one variable sorted into k categories, then to a goodness-of-fit test with df equal to k minus 1. A second arrow leads to a table of r rows by c columns, then to a test of independence or homogeneity with df equal to r minus 1 times c minus 1. A third leads to n measurements and a claimed variance, then to a test of a single variance with df equal to n minus 1.
\[ \mu = \text{df}, \qquad \sigma = \sqrt{2\,\text{df}}, \qquad \text{peak} = \text{df} - 2 \]
Most mistakes in the chapter are not arithmetic. They are the wrong df, usually n minus 1 used for a test that counts categories or cells, and a statistic read without its curve. The pattern puts both checks before any computation.
Use the diagram as the first step of every problem in Sections 11.2 to 11.6. Its three branches are the three tests, and each ends in that test's degrees of freedom. Once df is fixed, the other four steps on the list are the same for all three tests: sketch, place, find the area, interpret in context.
Interpreting in context means naming the population and the claim. Not just that the statistic is large, but that the absences of math students do not match what the faculty expected, with the evidence, a tail area of 0.0025, beside it.
Check
Use the two formulas from Part 1. Write down twice df before taking any square root.
Be careful with the order: double first, then take the root. The options include each of the common slips.
Check your understanding
A chi-square distribution has 32 degrees of freedom. What are its mean and standard deviation?
Answer: A
Why: The mean is the degrees of freedom, 32. Twice 32 is 64, the variance, and its square root is 8, the standard deviation. So the curve is centred at 32 with a spread of 8.
In context: a statistic on 32 degrees of freedom will usually fall within about 16 of 32, between roughly 16 and 48. Each wrong option is a real slip: stopping at the variance, forgetting to double, and halving the mean.
A sense check rules two out at once: the spread of a chi-square is always smaller than its mean once df is above 2, so a spread of 64 on a mean of 32 is impossible. And the mean is never anything but df, which removes the option that halves it.
Check
Decide which test the data call for before you count anything.
The question mentions three numbers. Only two of them belong in the answer.
Check your understanding
Five hundred shoppers are classified by store (4 stores) and by payment method (3 methods) to test whether the two are independent. How many degrees of freedom does the test have?
Answer: A
Why: A test of independence on a table with 4 rows and 3 columns uses rows minus one times columns minus one, which is 3 times 2, or 6. The number of shoppers changes the counts in the cells, not how many cells are free.
In context: the statistic for this test would be read on the chi-square curve centred at 6. A statistic of, say, 20 would then be about 4 standard deviations out, strong evidence that store and payment method are related.
Draw the free-cell rectangle if in doubt: 3 rows by 2 columns of free cells inside a 4 by 3 table. Swapping rows and columns changes nothing, because the product is the same either way.
The 500 shoppers do matter elsewhere: they make the expected counts large enough, at least five per cell, for the chi-square curve to describe the statistic at all.
Check
Compare the statistic with its own curve before choosing.
Start with the mean of the curve. Where does 3.2 sit relative to it, and what does that say about the right-tail area?
Check your understanding
A goodness-of-fit test gives a chi-square statistic of 3.2 on 10 degrees of freedom. Which statement is best supported?
Answer: A
Why: The curve with df 10 has mean 10 and standard deviation about 4.47. A statistic of 3.2 is below the mean, so most of the curve lies to its right: the exact right-tail area is 0.976. The data sit closer to expectation than a typical chance result.
In context: there is no evidence of misfit here. The left-tail area below 3.2 is 0.024, small but not extreme, so this agreement is close without being suspiciously so.
That second reading, the left tail, is the counterexample slide's point: a statistic very far below df would deserve a second look. At 3.2 on df 10 the data are close to expectation, but about one honest study in forty would land this low, so there is no reason for suspicion.
The quick route to the answer was the mean alone: a statistic below df always has a right-tail area above about 0.4, so it can never be evidence of misfit.
Explain it to yourself
The normal approximation is the one fact on the list that needs an earlier chapter to explain it. Putting the explanation in your own words is the best test of whether it has landed.
Discussion prompt
In two or three sentences, explain why a chi-square distribution with a large number of degrees of freedom is approximately normal, and why it takes as many as about 90 degrees of freedom before the book uses the approximation.
A strong answer names the sum and the central limit theorem. A very strong one adds why the threshold is high: the individual squared z-scores are far from normal, so convergence is slow.
If your explanation used the ratio of spread to centre, the square root of 2 over df, that is a third way to say the same thing.
Exit ticket
One last case, made up to pull the lesson together. A goodness-of-fit test with 51 categories gives a statistic of 75.
Discussion prompt
Give the degrees of freedom, the mean and the standard deviation of the curve, say how many standard deviations above the mean 75 lies, and decide whether the normal approximation should be used for the p-value. The exact right-tail area is 0.0126.
If you got df 51, you counted categories without subtracting the one constraint. If you got a spread of about 7.07, you took the root of df rather than of twice df.
And if you used the normal tail, notice the size of the error: a factor of two in the p-value. That is the right-skew of a df 50 curve, still very much present.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, p. 564 — facts 1 and 4
Recap
A chi-square random variable with df degrees of freedom is a sum of df independent squared standard normal variables. Every fact in the section comes from that one sentence: the squares give a floor at zero and a right skew, and the sum gives the mean, the spread and the eventual bell shape.
| idea | formula or fact | read it as |
|---|---|---|
| definition | χ² = Z₁² + Z₂² + … + Z_df² | squared z-scores, added |
| notation | X ~ χ²_df | one curve for every df |
| centre | μ = df | each square averages 1 |
| spread | σ = √(2 df) | each square has variance 2 |
| shape | skewed right, peak at df − 2 | peak < median < mean |
| never negative | χ² ≥ 0 | a negative value is an error |
| large df | df > 90: ≈ N(df, √(2 df)) | the central limit theorem |
| df by test | k − 1; (r − 1)(c − 1); n − 1 | counted from the data's shape |
To read a statistic, compare it with its own curve. Near df is ordinary; far above df is disagreement, which is where the chapter's tests look; far below df is agreement too close to be chance. Below df 90, get areas from the exact chi-square curve, not the normal.
The Introductory Business Statistics text covers the same facts in its own §11.1, with business contexts, if you want a second explanation. Section 11.2 now uses the chi-square curve for its first real test, the goodness of fit, starting with Example 11.1's absenteeism data.
OpenStax Introductory Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1, pp. 563-565 — the whole section
OpenStax Introductory Business Statistics 2e, §11.1 Facts About the Chi-Square Distribution §11.1 Facts About the Chi-Square Distribution — the same facts in business contexts
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.