OttoLearn

L-REG-4: Chi-Square Test of Independence

Module 5 · Regression & Association

Section 1: Introduction

▾

A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

Was Berkeley biased against women? In autumn 1973, 4,526 people applied to the six largest graduate departments of the University of California, Berkeley. The university’s own records (which classify applicants as men and women) show that 44.5% of the men were admitted, but only 30.4% of the women.

AdmittedRefusedAppliedAdmitted (%)
Men1,1981,4932,69144.5%
Women5571,2781,83530.4%
Total1,7552,7714,52638.8%

The counts are the published totals from Bickel, Hammel and O’Connell’s study in Science (1975). Before you learn any method, make a prediction. Nothing is scored.

Predict first · not scored

Is this gap evidence that the university was biased against women?

The gap is 14 percentage points. Whether it says anything about the university depends on three questions this lesson answers one at a time. Could a gap this size arise by chance (C7)? How strong is the link (C9)? And what happens when you look inside the departments, where the admission decisions were actually made (C10)?

The tool is the chi-square test of independence. It compares the counts you observed with the counts you would expect if the two variables had nothing to do with each other, and asks whether the difference is too large to be chance.

After this lesson, you will be able to:

  • Read a two-way table by comparing row percentages, and build the table of expected counts a no-link world would produce.
  • Compute the chi-square statistic and its degrees of freedom, and decide with the chi-square table at a stated significance level.
  • Check that every expected count is at least 5, and say what to do when one is not.
  • Measure the strength of a link with Cramér’s V, and explain why a significant result need not be a strong one.
  • State a conclusion as association, not causation, unless the study design supports more.
  • Choose between a chi-square test and correlation or regression from the types of the two variables.

Section 2: Prerequisites

▾

A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

What you need coming in, and why it matters today:

  • Variable types (L-DS-1): a categorical variable places each person in a group; a quantitative one measures an amount. Numbers that only label a group (a postal code, a jersey number) are categorical. Today both variables are categorical.
  • Independent events (L-PR-2): and are independent when . That one rule builds today’s expected counts.
  • The five-step test (L-INF-5): hypotheses, conditions, test statistic, p-value or critical value, conclusion in context. Every test today follows it.
  • The decision rule (L-INF-5, L-INF-6): reject when . Failing to reject is not accepting: a large p-value means “not enough evidence”, never “no effect”.

Quick check: can you recall these?

A survey asks each student whether they smoke () and whether they exercise weekly (). If smoking and exercise were independent, which statement would hold?

A survey records each respondent’s postal code (for example, H2X 1Y4) to study shopping habits by area. What kind of variable is the postal code?

A researcher has 40 students’ daily screen time: h and h. She tests whether the mean differs from a benchmark of 6.5 h, with no direction in mind. Which hypotheses are correct?

Bridge to today: In L-INF-5 and L-INF-6, named one number (a mean or a proportion ), and the test could look in either tail. Today is a claim about a whole table: “the two variables are independent”. The statistic adds up squared gaps between observed and expected counts, so it can only be large, and the test is always right-tailed.

Section 3: Core Concepts

▾

A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

Eleven concepts, in four groups:

  • C1–C2: what “no link” looks like in a table, and the expected counts it predicts.
  • C3–C5: the statistic , its degrees of freedom, and when the test may run.
  • C6–C8: the five steps, the decision, and how to word the conclusion (Berkeley, part 1).
  • C9–C11: strength (Berkeley, part 2), association versus cause (Berkeley, part 3), and when to use a χ² test rather than correlation.

C1 — Reading a Two-Way Table

A contingency table (also called a two-way table) counts how a sample splits on two categorical variables at once. Rows are the groups of one variable, columns the groups of the other, and each cell holds an observed count .

Contingency Table

A table with rows and columns whose cells hold observed counts. The row totals, column totals and grand total are its margins.

Two variables are independent (not linked) when knowing a person’s row tells you nothing about their column. In a table, that means every row splits in the same proportions.

Colour key for this lesson’s figures: a dashed black line is always a reference to compare with (the split a no-link world would show, or a critical value); orange is always evidence against “no link” (a cell’s contribution to , or a p-value area). In the Berkeley figures, blue is men and green is women.

Try it before the figure. Both tables below cross-classify adults by whether they own a car and whether they have a pet. Which table shows no link?

Predict first · not scored

Table P
Has a pet No pet
Car owner 24 56
No car 36 84
Table Q
Has a pet No pet
Car owner 40 40
No car 60 40

Which table shows no link between owning a car and having a pet?

Mosaic plot of the selected two-way table Table P: car owners and non-owners. Both bars split at the same height: 30% of each row has a pet, the same as the whole sample, so there is no link even though the counts are very unequal.
    Figure 1: Each bar is one row of the table, as wide as its share of the sample and split by where that row's people fall. The dashed lines show how the whole sample splits. With no link, every bar splits at the dashed lines, whatever the counts.

    Table P is the one with no link. Its counts are very unequal (84 against 24), but 30% of car owners and 30% of non-owners have a pet: the rows split the same way, so the tiles line up with the dashed line. Table Q looks even, yet 50% of one row and 60% of the other have a pet. Reading a table means comparing row percentages, not looking for equal cells.

    “No link” does not mean “equal counts”. A table can have very unequal cells and no link at all, as long as every row splits in the same proportions. Under independence the expected counts follow the margins, and margins are rarely equal.


    If the two variables were independent, the chance that a person lands in row and column would be the product of the two separate chances, as in L-PR-2: . Estimate each chance by its share of the sample and multiply by :

    Expected Count

    The count a cell would hold if the two variables were independent, given the table’s margins:

    Mini-example (Berkeley): 2,691 men applied and 1,755 people were admitted, out of 4,526.

    If sex and admission were unrelated, about 1,043 men would have been admitted. The records show 1,198.

    In the figure, the whole sample is a square. The column shares cut it one way and the row shares the other, so each rectangle’s area is a product of two shares, which is exactly the expected count. Before you click: in the “Unequal rows” preset, which cell has the largest expected count, and why?

    Area model of the expected counts Expected-count area model
    Figure 2: Each rectangle's area is its expected count if the two variables were unrelated: the row share times the column share times n, the product rule for independent events from L-PR-2. Two perpendicular cuts multiply; they can never add. Select a cell to see its product, and show the observed counts to see where the real table departs from the no-link table.

    The largest expected count sits where the largest row meets the largest column: area is row share times column share. Check your work: the expected counts in each row add up to that row’s total, and each column to its column total.


    C3 — The Chi-Square Statistic

    Chi-Square Test Statistic

    Each cell adds its squared gap from the no-link table, scaled by what that cell expected. , and only when every equals its .

    Dividing by matters: a gap of 10 is large in a cell that expected 20 and small in a cell that expected 1,000. A large means the table is far from what no link would produce.

    Two slips in the formula: forgetting to square, (the positive and negative gaps then cancel), and dividing by the observed count, . The denominator is : the reference is the no-link table.

    Beyond the rule: for tables some software applies Yates’ continuity correction, which subtracts 0.5 from each before squaring and gives a slightly smaller . This lesson uses the uncorrected formula, so a calculator may differ a little on a table.

    The heatmap breaks into its cells and stacks them against the critical value. Before you open it: in the 3×3 preset, which cell do you think contributes most to ? Then look at the Berkeley preset.

    Each cell's contribution to chi-square Chi-square contribution heatmap
    Table
    Selected
    Decision
    Figure 3: The darker a cell, the more it adds to χ², (O − E)²/E. The bar on the right stacks the cells; when it passes the dashed critical value (α = 0.05), the test rejects. Select a cell to see its share. A large count whose O is close to its E adds almost nothing. Berkeley's counts are the published 1973 totals (Bickel, Hammel & O'Connell, 1975).

    In the 3×3 preset the four corners carry the association; the centre cell, where , adds nothing. In the Berkeley table the women-admitted cell alone carries about 36% of : 557 women were admitted where no link predicts about 712.


    C4 — Degrees of Freedom

    Degrees of Freedom for a Test of Independence

    where is the number of rows and the number of columns. A table has , a table , a table .

    Where does the formula come from? Try it first: a 2×3 table has its row totals and column totals fixed. How many cells can you fill in freely before the totals force the rest?

    Chosen freely Forced by the totals

    A 2 by 3 table with fixed totals: two cells are chosen freely, four are forced
    LibraryHomeCafé Row total
    First year 41 free 37 free 19 = 97 − 41 − 37 97
    Upper year 47 = 88 − 41 67 = 104 − 37 27 = 46 − 19 141
    Column total 8810446 238

    2 free choices, everything else forced: df = (2 − 1)(3 − 1) = 2, not n − 1 = 237 and not the 6 cells.

    Figure 4: Once the row and column totals are fixed, choose two cells of the first row and every other cell is forced. The free cells form a block of (r − 1) × (c − 1) cells: that count is the degrees of freedom. (Survey of 238 students: year of study and main study place.)

    Once you choose two cells of the first row, the third is forced by the row total, and the whole second row is forced by the column totals. The free cells form an block, so , not and not the number of cells.

    Even Pearson got this wrong. Karl Pearson, who invented the χ² test in 1900, used the wrong degrees of freedom for tables; R. A. Fisher showed in 1922 that the right count is .


    C5 — Conditions for the Test

    Before computing , check two things:

    1. Independent observations from a random process: a random sample (each person counted once), or random assignment in an experiment.
    2. Every expected count is at least 5. Compute all the values; if any is below 5, the chi-square curve misstates the p-value.

    The condition is on the expected counts, not the observed ones. A cell can hold and still be fine if its is at least 5, and a table with every can still fail when a rare category gives some .

    When an expected count is below 5, do not run the test as it stands. Either combine categories that genuinely belong together (neighbouring age groups, say), which changes the question, so report it; or use an exact test, such as Fisher’s exact test for a table, which computes the p-value without the chi-square curve.

    Beyond the rule: “every ” is the cautious rule this course uses. Cochran’s more permissive guideline allows the test when no is below 1 and at most 20% of the cells have .


    C6 — The Five Steps for a Test of Independence

    The structure is the one from L-INF-5:

    StepAction
    1: the two variables are independent in the population. : they are not independent. Choose before looking at the data.
    2Check the conditions: a random process, and every expected count at least 5.
    3Compute and .
    4Compare with the critical value , or find the right-tail p-value.
    5Decide, and state the conclusion in context.

    There is no two-sided or left-sided version: only a large is evidence against independence.


    C7 — Critical Values and p-Values

    The chi-square table gives the critical value , which cuts off a right-tail area of :

    Chi-Square Distribution Table

    Critical values (χ²) for given degrees of freedom (df) and upper tail probability (p).

    Chi-Square Distribution Table
    df \ p 0.995 0.99 0.975 0.95 0.90 0.10 0.05 0.025 0.01 0.005
    1 0.0000.0000.0010.0040.0162.7063.8415.0246.6357.879
    2 0.0100.0200.0510.1030.2114.6055.9917.3789.21010.597
    3 0.0720.1150.2160.3520.5846.2517.8159.34811.34512.838
    4 0.2070.2970.4840.7111.0647.7799.48811.14313.27714.860
    5 0.4120.5540.8311.1451.6109.23611.07012.83315.08616.750
    6 0.6760.8721.2371.6352.20410.64512.59214.44916.81218.548
    7 0.9891.2391.6902.1672.83312.01714.06716.01318.47520.278
    8 1.3441.6462.1802.7333.49013.36215.50717.53520.09021.955
    9 1.7352.0882.7003.3254.16814.68416.91919.02321.66623.589
    10 2.1562.5583.2473.9404.86515.98718.30720.48323.20925.188
    11 2.6033.0533.8164.5755.57817.27519.67521.92024.72526.757
    12 3.0743.5714.4045.2266.30418.54921.02623.33726.21728.300
    13 3.5654.1075.0095.8927.04219.81222.36224.73627.68829.819
    14 4.0754.6605.6296.5717.79021.06423.68526.11929.14131.319
    15 4.6015.2296.2627.2618.54722.30724.99627.48830.57832.801
    16 5.1425.8126.9087.9629.31223.54226.29628.84532.00034.267
    17 5.6976.4087.5648.67210.08524.76927.58730.19133.40935.718
    18 6.2657.0158.2319.39010.86525.98928.86931.52634.80537.156
    19 6.8447.6338.90710.11711.65127.20430.14432.85236.19138.582
    20 7.4348.2609.59110.85112.44328.41231.41034.17037.56639.997
    21 8.0348.89710.28311.59113.24029.61532.67135.47938.93241.401
    22 8.6439.54210.98212.33814.04130.81333.92436.78140.28942.796
    23 9.26010.19611.68913.09114.84832.00735.17238.07641.63844.181
    24 9.88610.85612.40113.84815.65933.19636.41539.36442.98045.559
    25 10.52011.52413.12014.61116.47334.38237.65240.64644.31446.928
    26 11.16012.19813.84415.37917.29235.56338.88541.92345.64248.290
    27 11.80812.87914.57316.15118.11436.74140.11343.19546.96349.645
    28 12.46113.56515.30816.92818.93937.91641.33744.46148.27850.993
    29 13.12114.25616.04717.70819.76839.08742.55745.72249.58852.336
    30 13.78714.95316.79118.49320.59940.25643.77346.97950.89253.672
    40 20.70722.16424.43326.50929.05151.80555.75859.34263.69166.766
    50 27.99129.70732.35734.76437.68963.16767.50571.42076.15479.490
    60 35.53437.48540.48243.18846.45974.39779.08283.29888.37991.952
    70 43.27545.44248.75851.73955.32985.52790.53195.023100.425104.215
    80 51.17253.54057.15360.39164.27896.578101.879106.629112.329116.321
    90 59.19661.75465.64769.12673.291107.565113.145118.136124.116128.299
    100 67.32870.06574.22277.92982.358118.498124.342129.561135.807140.169

    Decision rule: reject when , which is the same as . Otherwise, fail to reject. At the critical values for to 4 are about 3.841, 5.991, 7.815 and 9.488.

    Predict before the figure: as goes from 1 to 4, does the critical value rise or fall? Then press the Berkeley button.

    Chi-square curve with the critical value and the p-value Chi-square distribution explorer
    Critical value
    p-value
    Decision
    Figure 5: The chi-square curve for the chosen degrees of freedom. The dashed line is the critical value at α = 0.05; the orange area beyond the observed statistic is its p-value. The curve lives only on positive values and the test uses only the right tail. Berkeley's χ² ≈ 92.2 lies far beyond the edge of the axis.

    The critical value rises with : a bigger table has more cells, so it piles up more by chance, and more is needed to call a pattern unusual.

    Berkeley, part 1. The pooled table is , so and the critical value is 3.841. Its statistic is , so far into the tail that the curve cannot show it: . Chance cannot explain a gap like this. That settles one question, and only one.


    C8 — Wording the Conclusion

    A conclusion has four parts: the decision, how strong the evidence is, the two variables in context, and what the design allows.

    A conclusion, built part by part (Berkeley, pooled):

    ” is above the critical value 3.841, so we reject . There is enough evidence of an association between applicant sex and admission in these records. Because these are observational records, the association does not by itself show why the rates differ.”

    If had been below the critical value: “we fail to reject ; there is not enough evidence of an association”, never “the variables are independent”.

    After failing to reject, do not write “the variables are independent”. The data are compatible with independence, but a weak link in a small sample can easily go undetected. Write “not enough evidence of an association”.

    After rejecting, do not write “one variable causes the other” unless the study randomly assigned one of them. A chi-square test detects association; in an observational study a lurking variable, or causation running the other way, can produce the same table.


    C9 — Cramér’s V: How Strong?

    A tiny p-value says the link is unlikely to be chance. It does not say the link is strong: with a large sample, even a weak link gives a huge . Cramér’s V measures strength on a scale from 0 to 1, whatever the sample size.

    Cramér's V

    Strength
    Negligible
    Small
    Medium
    Large

    For any table with two rows or two columns, and . These bands (Cohen’s guidelines) are approximate, and are meant for ; for larger tables they shift down (Challenge 2).

    Do not forget the square root. alone is not V, and it understates the strength.

    Predict first: a survey of 200 people gives and . If the survey were doubled to 400 people with the same percentages, what happens to ? To ?

    Chi-square and Cramér's V as the sample grows Weak link, 30% against 50%: chi-square equals n divided by 24 and rises in a straight line, crossing the critical value 3.841 at about n = 92; Cramér's V stays at 0.204, in the small band, for every n.

    Figure 6: The percentages in the table are held fixed; only the sample size changes. Top: χ² (the evidence) grows in proportion to n and crosses the critical value. Bottom, on its own axis: Cramér's V (the strength) does not move. A significant result can mean a strong link, or just a large sample.

    Doubling doubles but leaves where it was: grows with the sample, while describes the table’s shape. With a negligible link (48% against 52%), crosses the critical value at about : “significant” then only means “the sample was large”.

    Berkeley, part 2. : a real but small association. The enormous came from the large number of applicants, not from a strong link.


    C10 — Association Is Not Causation

    A significant says the two variables are associated in the population, if the conditions hold. It does not say which one, if either, causes the other. Three explanations can produce the same table:

    • Cause: one variable affects the other. Only a randomized experiment can show this directly.
    • A lurking variable: a third variable affects both. Hot weather raises both ice-cream sales and the number of swimmers.
    • Reverse causation: the “effect” drives the “cause”. Students who are already struggling sign up for tutoring, so tutoring and failing go together.

    A lurking variable can even reverse a pattern when groups are pooled. This is Simpson’s paradox, and it is what happened at Berkeley. Decide before you look: in which of the six departments do you expect the biggest gap against women?

    Berkeley 1973 admission rates, pooled and by department Pooled over six departments, men were admitted 44.5% of the time and women 30.4%. Switch to all six departments to see the rates inside each one.

    Berkeley 1973 admission rates by department (published totals)
    Group Men applied Men admitted Women applied Women admitted Chi-square (df = 1)
    All six 2691 44.5% 1835 30.4% 92.21
    Dept A 825 62.1% 108 82.4% 17.25
    Dept B 560 63.0% 25 68.0% 0.25
    Dept C 325 36.9% 593 34.1% 0.75
    Dept D 417 33.1% 375 34.9% 0.30
    Dept E 191 27.7% 393 23.9% 1.00
    Dept F 373 5.9% 341 7.0% 0.38

    Share of applications to departments A and B: 51.5% of men, 7.2% of women.

    Figure 7: Admission rates of men and women at Berkeley in 1973, pooled over the six largest departments and inside each one. Dot area shows how many applied. Inside the departments the pooled gap vanishes or reverses: most women applied to departments that admitted few applicants of either sex. Data: published totals from Bickel, Hammel & O'Connell (1975), Science 187, 398–404 (R's UCBAdmissions).

    Berkeley, part 3. Inside the departments the gap disappears. Women’s admission rates were higher than men’s in four of the six departments. Only Department A shows a significant difference (, ), and it favours women: 82% against 62%. The pooled gap comes from where people applied: 51.5% of the men but only 7.2% of the women applied to Departments A and B, which admitted most of their applicants, while most women applied to departments that admitted few applicants of either sex. Department was a lurking variable. The study found no evidence of bias against women in departments’ decisions (if anything, a small difference in their favour); it raised a different question, about why women applied where they did.


    C11 — Chi-Square or Correlation? Choosing the Analysis

    A χ² test needs two categorical variables. Correlation and regression (L-REG-1 to L-REG-3) need two quantitative ones. So the first question is about the variables, not the method. Try it before the figure: a survey records each customer’s postal code and the grocery chain they prefer. Which analysis fits, and why?

    Bold border: this lesson's boxes Gold bar, “new”: a question no earlier lesson asked
    1. ⓪ One variable or two? new how many does the question link?
      • one variable → go to ①
      • two variables → ask what type each one is
    2. For two variables What type is each variable? new a postal code is a category, not a number
      • both categorical → χ² test of independence, both categorical · L-REG-4
      • both quantitative → r and regression, both quantitative · L-REG-1 to L-REG-3
      • one of each → Not this module: one of each kind
    3. ① Estimate or test a claim? is there a claimed value to test?
      • estimate → Interval (L-INF-2 to L-INF-4), no H₀, SE from the data
      • test a claim → go to ②
    4. ② Mean or proportion? measured amount vs. yes/no count
      • mean μ → go to ③ for a mean
      • proportion p → go to ③ for a proportion
    5. For a mean ③ Is σ known? not “is n small?”
      • σ known → z-test for μ, SE = σ/√n
      • s only → t-test for μ, SE = s/√n, df = n − 1
      • either test → then ④
    6. For a proportion ③ np₀ ≥ 10 and n(1 − p₀) ≥ 10? counts from the claim p₀, not p̂
      • yes → z-test for p, SE = √(p₀(1 − p₀)/n)
      • no → Stop: too few expected counts
    7. Both mean tests ④ Shape OK for this n? look for strong skew or outliers when n is small
      • OK → run the test
      • not OK → Stop: collect more data or use another method
    Figure 8: Which procedure? Start at ⓪: how many variables does the question link? One variable leads to the four questions of L-INF-3 to L-INF-6; two variables lead to their types. A number that only labels a group, such as a postal code, is a category. A stop means the methods of this course do not apply as they stand.

    Both are categorical: the postal code names an area, so a χ² test of independence fits. A number in the data is not enough to make a variable quantitative; ask whether its arithmetic means anything.

    Section 4: Worked Examples

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Example 1 — Fully Worked: Smoking and Exercise (2×2)

    A health researcher draws a simple random sample of 100 adults and asks whether smoking status and exercise are independent, at .

    ExercisesDoes not exerciseRow total
    Smoker153550
    Non-smoker252550
    Column total4060100

    I notice the column totals are unequal (40 against 60), so the expected counts will differ by column even though the rows are the same size. Comparing rows: 30% of smokers exercise against 50% of non-smokers.

    Step 1 — Hypotheses:

    • : smoking status and exercise are independent in the population.
    • : they are not independent.

    Step 2 — Conditions and expected counts:

    The non-smoker row has the same totals, so its expected counts are also 20 and 30. The sample is random and every .

    Step 3 — Statistic and degrees of freedom:

    .

    Step 4 — Critical value: , and ().

    Step 5 — Conclusion: We reject . There is enough evidence at the 0.05 level of an association between smoking and exercise in this population. The data come from a survey, so they do not show that smoking causes people to exercise less.

    Strength:

    A small association.


    Example 2 — Commuting by Age (2×3, Unequal Totals)

    A city surveys a random sample of 260 commuters about their main way to work. Test at whether age group and travel mode are associated.

    CarTransitBike or walkRow total
    Under 35526127140
    35 and over74388120
    Column total1269935260

    Compute every expected count, check the condition, then find , and the decision. Every total is different, so every cell needs its own expected count.

    Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.

    Show Solution

    Expected counts, , to two decimals:

    CarTransitBike or walk
    Under 3567.8553.3118.85
    35 and over58.1545.6916.15

    For example, . The smallest is , and the sample is random: the test may run.

    Contributions , to three decimals:

    CarTransitBike or walk
    Under 353.7011.1103.528
    35 and over4.3181.2954.116

    Adding the unrounded contributions gives (the rounded ones add to 18.068; either is fine). , and .

    Since , we reject (). There is enough evidence of an association between age group and main way to work. The biggest contributions are in the car and bike columns: younger commuters bike or walk more and drive less than no link would predict. This is a survey, so it shows association, not that age causes the choice.

    : a small association.


    Example 3 — Cramér’s V from a Reported Result

    A report gives for a table with . Compute and classify it.

    Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.

    Show Solution

    This falls in the medium band ().


    Example 4 — Find the Error: A Test That Should Not Have Run

    A researcher reports the following analysis of a random sample of 50 people.

    Outcome AOutcome BRow total
    Group 1325
    Group 2271845
    Column total302050

    ” with , so . We fail to reject : the variables are independent.”

    Identify both errors.

    Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.

    Show Solution

    Error 1 — the test should not have run. and , both below 5. The chi-square approximation is unreliable here: combine categories (if Group 1 can sensibly join another group) or use Fisher’s exact test.

    Error 2 — “independent”. Even a valid test that fails to reject only gives “not enough evidence of an association”. With 5 people in Group 1, almost any link would go undetected.

    Section 5: Guided Practice

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Each item gives feedback as you go. The tables here have round totals; from Section 6 on they will not.

    Problem 1 — Reading a Two-Way Table (C1)


    Complete the table
    Fill in the table a no-link world would produce
    Fill in every empty cell, then check the whole table once. The cells depend on one another.

    Problem 3 — May the Test Run? How Many Degrees of Freedom? (C4 + C5)


    Problem 4 — Reading the Chi-Square Table (C7)

    Use the chi-square table for each question.

    Chi-Square Distribution Table

    Critical values (χ²) for given degrees of freedom (df) and upper tail probability (p).

    Chi-Square Distribution Table
    df \ p 0.995 0.99 0.975 0.95 0.90 0.10 0.05 0.025 0.01 0.005
    1 0.0000.0000.0010.0040.0162.7063.8415.0246.6357.879
    2 0.0100.0200.0510.1030.2114.6055.9917.3789.21010.597
    3 0.0720.1150.2160.3520.5846.2517.8159.34811.34512.838
    4 0.2070.2970.4840.7111.0647.7799.48811.14313.27714.860
    5 0.4120.5540.8311.1451.6109.23611.07012.83315.08616.750
    6 0.6760.8721.2371.6352.20410.64512.59214.44916.81218.548
    7 0.9891.2391.6902.1672.83312.01714.06716.01318.47520.278
    8 1.3441.6462.1802.7333.49013.36215.50717.53520.09021.955
    9 1.7352.0882.7003.3254.16814.68416.91919.02321.66623.589
    10 2.1562.5583.2473.9404.86515.98718.30720.48323.20925.188
    11 2.6033.0533.8164.5755.57817.27519.67521.92024.72526.757
    12 3.0743.5714.4045.2266.30418.54921.02623.33726.21728.300
    13 3.5654.1075.0095.8927.04219.81222.36224.73627.68829.819
    14 4.0754.6605.6296.5717.79021.06423.68526.11929.14131.319
    15 4.6015.2296.2627.2618.54722.30724.99627.48830.57832.801
    16 5.1425.8126.9087.9629.31223.54226.29628.84532.00034.267
    17 5.6976.4087.5648.67210.08524.76927.58730.19133.40935.718
    18 6.2657.0158.2319.39010.86525.98928.86931.52634.80537.156
    19 6.8447.6338.90710.11711.65127.20430.14432.85236.19138.582
    20 7.4348.2609.59110.85112.44328.41231.41034.17037.56639.997
    21 8.0348.89710.28311.59113.24029.61532.67135.47938.93241.401
    22 8.6439.54210.98212.33814.04130.81333.92436.78140.28942.796
    23 9.26010.19611.68913.09114.84832.00735.17238.07641.63844.181
    24 9.88610.85612.40113.84815.65933.19636.41539.36442.98045.559
    25 10.52011.52413.12014.61116.47334.38237.65240.64644.31446.928
    26 11.16012.19813.84415.37917.29235.56338.88541.92345.64248.290
    27 11.80812.87914.57316.15118.11436.74140.11343.19546.96349.645
    28 12.46113.56515.30816.92818.93937.91641.33744.46148.27850.993
    29 13.12114.25616.04717.70819.76839.08742.55745.72249.58852.336
    30 13.78714.95316.79118.49320.59940.25643.77346.97950.89253.672
    40 20.70722.16424.43326.50929.05151.80555.75859.34263.69166.766
    50 27.99129.70732.35734.76437.68963.16767.50571.42076.15479.490
    60 35.53437.48540.48243.18846.45974.39779.08283.29888.37991.952
    70 43.27545.44248.75851.73955.32985.52790.53195.023100.425104.215
    80 51.17253.54057.15360.39164.27896.578101.879106.629112.329116.321
    90 59.19661.75465.64769.12673.291107.565113.145118.136124.116128.299
    100 67.32870.06574.22277.92982.358118.498124.342129.561135.807140.169

    (a) What is ?

    (b) What is ?

    (c) A test gives with . What is the decision at , and at ?

    (d) For with , between which two right-tail areas does the p-value lie?


    Problem 5 — The Full Five-Step Test

    Section 6: Independent Practice

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    From here on you work first and get help after. Totals are untidy, so expected counts carry decimals; the significance level changes from problem to problem and is stated before the data; and sometimes the test may not run at all. Steps open if you ask for them.


    Problem 2 — What May the Report Say? (C7 + C8 + C10)

    Read how the data were collected: it decides the last blank.

    Build the Conclusion
    Build the conclusion
    Choose a phrase for each blank so that the sentence states the correct conclusion.

    Problem 3 — Find the Error (C3–C8)

    A second analysis, this time of its conclusion:


    Problem 4 — How Strong? (C9)


    Problem 5 — Which Analysis Fits? (C11)

    Sort into groups
    Which analysis does each question call for?

    Sort each research question by the analysis it calls for. Classify both variables first: a number that only labels a group is categorical.

    Drag an item into its group, or select it and then choose the group. On a keyboard: select an item and press the group’s number (1–3); 0 sends it back to Unsorted. Each item also has its own “move” buttons.
    Unsorted

    Problem 6 — Association or Cause? (C10)


    Problem 7 — Pooled or Split? (C10)


    Problem 8 — Synthesis: Physical Activity and Stress

    A wellness director reads the result and says: “The test is significant, so we should require vigorous exercise for every high-stress employee.” Build the reply.

    Build the Conclusion
    What the result supports
    Choose a phrase for each blank so that the sentence states the correct conclusion.

    Mixed Review — Retrieval from Earlier Lessons

    These problems draw on earlier lessons. Attempting them without re-reading is the point: retrieval strengthens memory more than re-reading does.

    Review Problem 1 — z-Test for a Mean (L-INF-5)


    Review Problem 2 — Proportion Test (L-INF-6)

    Section 7: Mastery Check

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Question 1 — Feynman Test

    A colleague says: “We ran a chi-square test and got a highly significant result (). The association between the two variables is therefore very strong.”

    In a short paragraph, explain what is wrong with this reasoning and what they should report instead.

    Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.

    Compare with a model answer

    A small p-value is evidence against independence, assuming the design and conditions are sound. It says nothing about the strength of the association. grows in proportion to the sample size, so with a large sample even a negligible association produces a tiny p-value (Figure 6). The colleague should report Cramér’s V beside the p-value: Berkeley’s pooled table had but , a small association.


    Question 2 — Expected Counts, and May the Test Run?

    Complete the table
    Expected counts
    Fill in every empty cell, then check the whole table once. The cells depend on one another.

    A different table: check the condition yourself.


    Question 3 — The Statistic and Its Degrees of Freedom


    Question 4 — The Conclusion

    Build the Conclusion
    Build the conclusion
    Choose a phrase for each blank so that the sentence states the correct conclusion.

    Question 5 — Which Analysis?


    Self-Assessment

    Still confusedReady for the Boss Fight

    If you are below the midpoint, return to C1 and C2 in Section 3, then redo Guided Practice Problems 2 and 3: the no-link table, and whether the test may run. If you are in the middle, revisit C3 and C4 (the statistic and its degrees of freedom), then retry Mastery Questions 3 and 4 with a fresh table. If you are near the upper end, choose a Boss Fight path and write out your whole attempt before opening any step.

    Section 8: Boss Fight

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Choose one of two equally demanding missions. Neither tells you which method to use: choosing the tool is part of the fight. Each starts with your own complete attempt; open the steps only if you need to find where it went wrong. Lose, and the rematch brings fresh numbers.

    🏛️ The Admissions Audit

    A college’s admission gap, pooled and by programme. Is it bias, and where?

    🔎 The Fact-Checker

    Three claims land on your desk. Find what each one gets wrong, and fix it.

    Section 9: Challenge Problems

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Optional stretch. These cold-transfer problems go beyond the lesson objectives.

    Challenge 1 — The Same Percentages, a Bigger Survey

    Among smokers 30% exercise; among non-smokers, 50%. Keep those percentages and scale the survey up. Fill in and for each sample size (three decimals). The first row is done.

    Complete the table
    Same percentages, four sample sizes
    Fill in every empty cell, then check the whole table once. The cells depend on one another.

    On paper: what does this tell you about using , or its p-value, as a measure of how strong a link is?

    Compare with a model answer

    measures evidence, and evidence grows with the amount of data: quadruple the sample and quadruples, even though the link is exactly as strong as before. Strength must be read from Cramér’s V, which stays at 0.204. Always report both.


    Challenge 2 — A 3×3 Table and Two Ways to Read V

    A sociologist draws a simple random sample of 300 adults, without replacement, from a population of more than 3,000 and classifies each by highest degree (High school / Bachelor’s / Graduate) and job sector (Public / Private / Nonprofit).

    PublicPrivateNonprofitRow total
    High school6025590
    Bachelor’s605010120
    Graduate30253590
    Column total15010050300

    (a) State and . (b) Compute all nine expected counts and check the condition. (c) Find . (d) Compute . (e) Decide at . (f) Compute Cramér’s V and read it two ways: with the standard bands 0.1 / 0.3 / 0.5, and with the bands for , roughly 0.07 / 0.21 / 0.35.

    Show Solution

    (a) : degree and job sector are independent in the population. : they are not.

    (b) Every total is different, so each cell needs its own count, for example :

    PublicPrivateNonprofit
    High school453015
    Bachelor’s604020
    Graduate453015

    The sample is random and under 10% of the population; the smallest expected count is 15. The test may run.

    (c) .

    (d) The contributions are 5.000, 0.833, 6.667 / 0.000, 2.500, 5.000 / 5.000, 0.833, 26.667. Adding the exact values:

    (e) , and is far beyond it: reject . The Graduate/Nonprofit cell (35 observed, 15 expected) carries half of .

    (f) , so

    With the standard bands, 0.296 is small. With the bands for , it is medium. Same data, two readings: a report should say which convention it uses.


    Challenge 3 — The Lady Tasting Tea

    In the 1920s a colleague of the statistician R. A. Fisher claimed she could taste whether milk had been poured into the cup before the tea or after. Fisher used the claim to design a test: 8 cups, 4 of each kind, served in random order, and she is told there are 4 of each. Suppose she labels all 8 correctly.

    (a) Lay out the results as a table (true order × her answer). What are the expected counts under “she is guessing”? May a χ² test run?

    (b) If she were guessing, she would simply be choosing 4 of the 8 cups to call “milk first”. What is the probability she picks exactly the right 4? (Counting, L-PR-3.)

    (c) What do you conclude at ?

    Pause and write. Record your answer and reasoning on paper or in your notes before continuing. Even if you are unsure, committing your thinking helps you see what you understood and what you need to revisit.

    Show Solution

    (a) Every row and column total is 4, so every expected count is , below 5. A χ² test may not run: this is exactly the case for an exact test.

    (b) There are equally likely ways to choose 4 cups, and only one is entirely right:

    (c) : guessing is an unlikely explanation, so there is evidence she can tell the difference. This is Fisher’s exact test, from his 1935 book The Design of Experiments.


    Beyond the Lesson — Independence or Homogeneity?

    The same arithmetic answers two slightly different questions. If you draw one sample and classify each person on two variables, you are testing independence: are the variables related in the population? If you fix the group sizes by design (say, 100 adults under 40 and 100 adults 40 and over) and compare how each group splits, you are testing homogeneity: do the groups have the same distribution? The expected counts, , and the decision rule are identical; only the wording of the hypotheses and the conclusion changes. Tables with equal, round group totals (like Example 1’s 50 smokers and 50 non-smokers) usually come from the second design.

    Section 10: Solutions Reference

    ▾

    A tag such as (C2 + C3) after a title names the Core Concepts parts the problem draws on, so you know where to look back.

    Complete solutions for Sections 5–9 are on the solutions page, with every expected count, every statistic and the reasoning behind each decision.

    View Full Solutions →

    If you’re stuck: re-read the relevant Core Concept. Build the no-link table first (C2): every expected count is row total times column total over . Check that every is at least 5 before computing anything else (C5). Read the critical value in the row and the column of the stated (C4, C7). Report strength with V (C9), and claim cause only when the design assigned one variable at random (C10).

    Quick-Reference Formulas

    FormulaPurpose
    Expected count if the variables were independent
    Test statistic; always ; right-tailed
    Degrees of freedom
    Cramér’s V: strength, from 0 to 1

    Common Pitfalls

    PitfallWhat goes wrongCorrection
    “No link = equal counts”Expecting every cell to hold divided by the number of cellsUnder independence each row splits like the column totals:
    Conditions skippedThe test is run with an expected count below 5Compute every first; combine categories or use an exact test
    O and E swappedThe denominator is always
    Wrong df or the number of cells
    Significant = strongReading the p-value as strengthReport Cramér’s V beside it
    Independence claimed“The variables are independent” after failing to reject“Not enough evidence of an association”
    Causation claimed“A causes B” from an observational tableAssociation only, unless one variable was randomly assigned
    Codes treated as numbersCorrelation on postal codes or jersey numbersCodes are categories: use a χ² test