Contingency tables
Imagine a secondary school in Galway where 5th and 6th Year students are asked whether they would rather join a sport club or a music club. Do the two year groups choose differently? So far you have worked with numerical variables and scatterplots, but here both variables are categories: year group and club choice, county and favourite sport (hurling, camogie, Gaelic football or rugby), or travel to school and year group. The contingency table organises these data and lets you answer the key question: does one variable influence the other, or are they independent?
Joint and marginal frequencies
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.
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).
A study has been carried out on the use of glasses in a class of $30$ students. We know that there are $16$ girls, of whom $4$ wear glasses. We also know that there are…
A study has been carried out on the use of glasses in a class of $30$ students. We know that there are $16$ girls, of whom $4$ wear glasses. We also know that there are $10$ students in total (boys and girls) who wear glasses.
Complete the contingency table and determine how many boys do not wear glasses.
Relative frequencies: to the total, by rows, by columns
To show a table with a diagram, draw a compound bar chart: one bar per category, using the row (or column) relative frequencies so that groups of different sizes can be compared fairly.
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$).
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.
In a sports club, $60\%$ of the members are men and $40\%$ are women. It is known that $30\%$ of the men swim, while $55\%$ of the women swim. The remaining members play…
In a sports club, $60\%$ of the members are men and $40\%$ are women. It is known that $30\%$ of the men swim, while $55\%$ of the women swim. The remaining members play tennis.
a) If the club has a total of $500$ members, construct the contingency table of absolute frequencies.
b) Calculate the marginal relative frequency of members who play tennis.
c) What is the majority profile in the club (combination of gender and sport)?
You can do it on paper and send a photo with your answer.
Conditional frequencies
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).
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.
In a health centre, the relationship between competitive sports participation and the type of injuries sustained in young people is investigated. We have the following…
In a health centre, the relationship between competitive sports participation and the type of injuries sustained in young people is investigated. We have the following table of relative frequencies conditional on columns (type of sport):
| Injury / Sport | Basketball ($D_1$) | Football ($D_2$) | Athletics ($D_3$) |
|---|---|---|---|
| Muscular ($L_1$) | $0.30$ | $0.55$ | $0.40$ |
| Bone ($L_2$) | $0.70$ | $0.45$ | $0.60$ |
If we know that $40\%$ of the young people in the sample play football, $35\%$ play basketball and the rest do athletics:
- a) Obtain the joint relative frequency table.
- b) Calculate the probability that a young person chosen at random plays basketball given that they have suffered a bone injury.
- c) In which sport is it most likely to suffer a muscular injury? Does the answer change if we analyse absolute frequencies with respect to the total population? Justify your answer.
Independence between variables
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?
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".
A technology consulting firm analyzes the relationship between the use of Artificial Intelligence (AI) for studying and the average grade in a sample of students. It is…
A technology consulting firm analyzes the relationship between the use of Artificial Intelligence (AI) for studying and the average grade in a sample of students. It is known that:
-
$30\%$ of the students never use AI.
-
$25\%$ of the students have an average grade of "Outstanding".
-
The total sample size is 400 students.
-
It has been observed that the events "Having an Outstanding grade" and "Never using AI" are independent.
Calculate:
- a) The number of students who never use AI and have an Outstanding grade.
- b) The probability that a student regularly uses AI given that their grade is not Outstanding.
- c) Complete the contingency table by dividing the sample into two usage categories (AI / No AI) and two grade categories (Outstanding / Other).
Back to the start: To answer whether two qualitative variables, such as year group and club choice, 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.