Maths4UBETA

Association and contingency tables

Use the margins to test independence and interpret association without overstating it.

Try the quick check →
Lesson 4 of 4

Section 1 of 6 · Core · about 6 min

What would independence predict?

Under independence the same column proportions apply in each row.

Worked example

Use the margins to predict one count

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20141413132727
20 to 39252512123737
40 or older111125253636
Total50505050100100

Find the expected frequency for Under 20 and Maps exactly.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsTotal
    Under 20272\frac{27}{2}272\frac{27}{2}2727
    20 to 39372\frac{37}{2}372\frac{37}{2}3737
    40 or older181818183636
    Total50505050100100
  2. X2=10039999,ν=(3−1)(2−1)=2X^2=\frac{10039}{999},\quad \nu=(3-1)(2-1)=2. The upper critical value is 5.9915.991.

  3. Evidence of an association.

Worked example

Use all three column totals

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201212161611113939
20 to 391818131314144545
40 or older10101717993636
Total404046463434120120

Find the expected frequency for 20 to 39 and Videos exactly.

Try it on paper first.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsVideosTotal
    Under 20131329920\frac{299}{20}22120\frac{221}{20}3939
    20 to 391515694\frac{69}{4}514\frac{51}{4}4545
    40 or older1212695\frac{69}{5}515\frac{51}{5}3636
    Total404046463434120120
  2. X2=61331955,ν=(3−1)(3−1)=4X^2=\frac{6133}{1955},\quad \nu=(3-1)(3-1)=4. The upper critical value is 9.4889.488.

  3. Insufficient evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201212161611113939
20 to 391818131314144545
40 or older10101717993636
Total404046463434120120

Find the expected frequency for 40 or older and Models exactly.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Section 2 of 6 · Core · about 7 min

What does one cell contribute?

Compare the observed count with the expected count for the same row and column.

Worked example

Find the contribution of one display choice

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20141413132727
20 to 39252512123737
40 or older111125253636
Total50505050100100

Find the exact contribution from 40 or older and Models.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsTotal
    Under 20272\frac{27}{2}272\frac{27}{2}2727
    20 to 39372\frac{37}{2}372\frac{37}{2}3737
    40 or older181818183636
    Total50505050100100
  2. X2=10039999,ν=(3−1)(2−1)=2X^2=\frac{10039}{999},\quad \nu=(3-1)(2-1)=2. The upper critical value is 5.9915.991.

  3. Evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20222217173939
20 to 39141422223636
40 or older2020552525
Total56564444100100

Find the exact contribution from 20 to 39 and Maps.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Section 3 of 6 · Core · about 7 min

Why do rows and columns determine the degrees?

With all margins fixed you cannot choose every count freely.

Worked example

Count the free cells in a rectangular table

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201717161618185151
20 to 391919131318185050
Total363629293636101101

Work out the degrees of freedom for the final table.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsVideosTotal
    Under 201836101\frac{1836}{101}1479101\frac{1479}{101}1836101\frac{1836}{101}5151
    20 to 391800101\frac{1800}{101}1450101\frac{1450}{101}1800101\frac{1800}{101}5050
    Total363629293636101101
  2. X2=10957492662200,ν=(2−1)(3−1)=2X^2=\frac{1095749}{2662200},\quad \nu=(2-1)(3-1)=2. The upper critical value is 5.9915.991.

  3. Insufficient evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201212161611113939
20 to 391818131314144545
40 or older10101717993636
Total404046463434120120

Work out the degrees of freedom for the final table.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Section 4 of 6 · Core · about 7 min

How can I pool a small expected cell?

Only combine complete rows or columns when the resulting group makes sense.

Worked example

Pool coherent age bands before calculating

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20334477
20 to 39121218183030
40 or older353528286363
Total50505050100100

Combine Under 20 and 20 to 39 into one row. Give its expected frequency in the Maps column and the final degrees of freedom.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsTotal
    Under 20 and 20 to 39372\frac{37}{2}372\frac{37}{2}3737
    40 or older632\frac{63}{2}632\frac{63}{2}6363
    Total50505050100100
  2. X2=700333,ν=(2−1)(2−1)=1X^2=\frac{700}{333},\quad \nu=(2-1)(2-1)=1. The upper critical value is 3.8413.841.

  3. Insufficient evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20443377
20 to 39141411112525
40 or older323236366868
Total50505050100100

Combine Under 20 and 20 to 39 into one row. Give its expected frequency in the Models column and the final degrees of freedom.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Section 5 of 6 · Core · about 7 min

Is an association the same as a cause?

A significant chi-squared statistic is evidence that the variables are associated in the population.

Worked example

Decide whether this difference is significant

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20222217173939
20 to 39141422223636
40 or older2020552525
Total56564444100100

Choose a conclusion at the 5% level.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsTotal
    Under 2054625\frac{546}{25}42925\frac{429}{25}3939
    20 to 3950425\frac{504}{25}39625\frac{396}{25}3636
    40 or older141411112525
    Total56564444100100
  2. X2=18242518018,ν=(3−1)(2−1)=2X^2=\frac{182425}{18018},\quad \nu=(3-1)(2-1)=2. The upper critical value is 5.9915.991.

  3. Evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 203030993939
20 to 39121226263838
40 or older8815152323
Total50505050100100

Choose a conclusion at the 5% level.

Conclusion

Section 6 of 6 · Extension · about 6 min

How do I present the full test?

Give the null assumption, expected frequencies, statistic, degrees of freedom and a decision.

Worked example

Run a test from a three-by-three table

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201212161611113939
20 to 391818131314144545
40 or older10101717993636
Total404046463434120120

Find the exact statistic and decide at the 5% level.

  1. Use the final row totals, column totals and grand total. Compute each expected cell as row total×column totalgrand total\frac{\text{row total}\times\text{column total}}{\text{grand total}}.

    GroupMapsModelsVideosTotal
    Under 20131329920\frac{299}{20}22120\frac{221}{20}3939
    20 to 391515694\frac{69}{4}514\frac{51}{4}4545
    40 or older1212695\frac{69}{5}515\frac{51}{5}3636
    Total404046463434120120
  2. X2=61331955,ν=(3−1)(3−1)=4X^2=\frac{6133}{1955},\quad \nu=(3-1)(3-1)=4. The upper critical value is 9.4889.488.

  3. Insufficient evidence of an association.

Your turn

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20443377
20 to 39141422223636
40 or older323225255757
Total50505050100100

Find the exact statistic and decide at the 5% level.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Conclusion

Worked examples

Practise the method

Core practice

Question 1 of 4

0 / 4 checked in this collection

Question list

Core practice

Fresh variants

Exam-style

All four expected cells

6 marks

Independent observations form the two-by-two table with rows (18,12)(18,12) and (12,18)(12,18). Under independence, give all four expected cells in row order, the statistic and ν.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Full answer-format guide

Exact numbers: 3/2, sqrt(5), 2-sqrt(3), pi/6, 3*pi/2. Sets: {1,4}. Intervals: (3,5]; a round bracket excludes the endpoint. Infinity: inf; union: U; no solutions: empty. Separate coordinate pairs or triples with semicolons. Expressions: 2x^2+3x-1; equations: x^2=3x+1 or the polynomial equal to zero. Factors: x-1 ; x+2. Parameter fraction: numerator ; denominator. List integer answers individually.

Review the method

Progress stays in this browser. Create an account to save it or sign in.

Extra practice from this lesson

Check an expected count in a two-by-three table

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsVideosTotal
Under 201717161618185151
20 to 391919131318185050
Total363629293636101101

Find the expected frequency for Under 20 and Videos exactly.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Reassess after a different age-band pool

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20333366
20 to 39181819193737
40 or older292928285757
Total50505050100100

Work out the degrees of freedom for the final table.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Check a smaller effect at the 1% level

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20222217173939
20 to 39141422223636
40 or older2020552525
Total56564444100100

Choose a conclusion at the 1% level.

Conclusion

Find a contribution in the last age band

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20141413132727
20 to 39252512123737
40 or older111125253636
Total50505050100100

Find the exact contribution from 40 or older and Maps.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Find an expected count from unequal row totals

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20222217173939
20 to 39141422223636
40 or older2020552525
Total56564444100100

Find the expected frequency for 20 to 39 and Models exactly.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Complete the test at the 10% level

An independent sample of visitors was recorded by age band and preferred display. The column labels give display types.

The null hypothesis is that the row and column classifications are independent.

GroupMapsModelsTotal
Under 20141413132727
20 to 39252512123737
40 or older111125253636
Total50505050100100

Find the exact statistic and decide at the 10% level.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Conclusion

Apply it · original exam-style problems

Show your working on paper and compare it with the worked solution and marking guidance.

Come back to what needs practice

Quick revision sheet (A4)

Your review plan starts after your first check.