Back to homeMathematics · 1st Bach. Social Sciences · Change subject
Start for free
BAC1 ss · Mathematics
Statistics · Statistics

Contingency tables

Until now you have cross-tabulated two numerical variables. But often what is being cross-tabulated is qualitative: gender and favourite sport, qualifications and employment status, streaming platform and account type. The contingency table organises these data and lets you answer the key question: does one variable influence the other, or are they independent?

Before you start, make sure you know: Two-variable distributions (4th ESO)
Before you start, make sure you know: Frequency tables (3rd ESO)

Joint and marginal frequencies

Visual diagram of a contingency table highlighting an interior joint-frequency cell and the marginal totals in the row and column. n₁₁ joint column marginal ↓ row marginal →
Practice★☆☆Not started
In a secondary school, a survey was conducted among the $100$ Year 12 students about their preferred extracurricular activity. The data have started to be organised in…

In a secondary school, a survey was conducted among the $100$ Year 12 students about their preferred extracurricular activity. The data have started to be organised in the following contingency table, but some values are missing.

Sport Music Total
Girls $35$ $55$
Boys $20$
Total $100$

Copy the table into your exercise book and complete it by finding the missing absolute frequencies.

Sport Music Total Girls Boys Total 35 55 20 100 ? ? ? ? ?
Solve
Practice★☆☆Not started
A video game shop registered its sales from this morning according to console type and game format. $12$ Nintendo Switch games were sold in physical format and $8$ in…

A video game shop registered its sales from this morning according to console type and game format. $12$ Nintendo Switch games were sold in physical format and $8$ in digital format. For the PlayStation 5, $15$ were sold in physical format and $10$ in digital format.

Organise this information in a two-way (contingency) table including the marginal frequencies (the total for each row and column).

Solve

Relative frequencies: to the total, by rows, by columns

Illustrative diagram of the three types of relative frequencies in a contingency table: relative to the grand total, by rows and by columns. Divide by what? ÷ Nto the total ÷ row totalby rows ÷ col. totalby columns each one answersa different question
Practice★☆☆Not started
A group of $50$ people were asked whether they regularly play sport and whether they are smokers. The results are shown in the following table: | | Plays sport | Does…

A group of $50$ people were asked whether they regularly play sport and whether they are smokers. The results are shown in the following table:

Plays sport Does not play sport Total
Smoker $5$ $15$ $20$
Non-smoker $25$ $5$ $30$
Total $30$ $20$ $50$

Calculate the table of joint relative frequencies. (Express each value as the result of dividing the absolute frequency by the sample total $N=50$).

Solve
Practice★★☆Not started
A video game company wants to know whether the type of console users own is related to their subscription to premium services. $300$ users are analyzed: | Subscription |…

A video game company wants to know whether the type of console users own is related to their subscription to premium services. $300$ users are analyzed:

Subscription Console A Console B Console C
Premium $45$ $60$ $15$
Basic $75$ $90$ $15$

a) Obtain the table of relative frequencies conditioned by columns (type of console).

b) Based on the results of the previous part, on which console is it most common to find a user with a Premium subscription?

c) Represent the distribution of the subscription by type of console using a stacked bar chart.

You can do it on paper and send a photo with your answer.

Solve

Conditional frequencies

Visual comparison between the conditional and the marginal frequency to check graphically whether there is statistical dependence. P(public | city) = 40/60 ≠ P(public) = 50/100 conditional0,67 marginal0,50 they differ → there is dependence
Practice★☆☆Not started
A courier company analyses the mode of transport used by its workers according to their place of residence: | | Lives in city | Lives outside | Total | |---|---|---|---|…

A courier company analyses the mode of transport used by its workers according to their place of residence:

Lives in city Lives outside Total
Public Transport $40$ $10$ $50$
Own Vehicle $20$ $30$ $50$
Total $60$ $40$ $100$

If we randomly choose a worker who lives in the city, what is the relative frequency that they use public transport? (Calculate the conditional frequency).

Solve
Practice★★☆Not started
To investigate the relationship between using Artificial Intelligence (AI) to do homework and academic performance, $150$ students were surveyed. The data show that $60$…

To investigate the relationship between using Artificial Intelligence (AI) to do homework and academic performance, $150$ students were surveyed. The data show that $60$ students use AI frequently, of which $15$ have excellent marks. On the other hand, of the students who do not use AI, $45$ have excellent marks.

a) Construct the table of relative frequencies with respect to the total.

b) Calculate the distribution of the variable "AI use" conditional on having "Excellent marks".

c) Can we state that the variables are independent? Justify your answer by comparing a joint relative frequency with the product of the corresponding marginal frequencies.

You can do it on paper and send a photo with your answer.

Solve

Independence between variables

Visual representation of the criterion for statistical independence by comparing conditional and marginal relative frequencies. 40 % urban 30 % marginal 10 % rural far from the marginal in both cases → dependence
Practice★★☆Not started
A study was conducted on the preference for type of diet (Omnivorous or Vegetarian) depending on the area of residence (Urban or Rural). The following data were…

A study was conducted on the preference for type of diet (Omnivorous or Vegetarian) depending on the area of residence (Urban or Rural). The following data were obtained:

Residence Omnivorous Vegetarian Total
Urban $120$ $80$ $200$
Rural $90$ $10$ $100$
Total $210$ $90$ $300$

a) Calculate the row relative frequency table.

b) Is there a dependency between the area of residence and the type of diet? Compare the conditional distributions of diet for urban and rural residents.

c) What value should the frequency of "Rural-Vegetarian" have for the variables to be independent, maintaining the marginal totals for residence?

Solve
Practice★★☆Not started
A secondary school wants to analyse whether the use of public transport to travel to school depends on the distance from the school. $120$ students are classified as…

A secondary school wants to analyse whether the use of public transport to travel to school depends on the distance from the school. $120$ students are classified as "Near" ($< 2$ km) and "Far" ($\geq 2$ km).

a) Complete the table knowing that $25\%$ of the students live near, and that of the students who live far, $80\%$ use public transport. Furthermore, no students living near use public transport.

b) Obtain the relative frequency table with respect to the total.

c) Calculate the relative frequency of "living far" given "not using public transport".

Transport Distance Public Other Total Near Far Total ? ? ? ? ? ? ? ? 120
Solve

Back to the start: To answer whether two qualitative variables, such as the platform and the account type, influence each other, compare their conditional frequencies with the marginal ones: if they coincide in all cells the variables are independent, but if they differ, there is an association between them.

Summary

See all the exercises in this section