Main content

### Course: Statistics and probability > Unit 1

Lesson 2: Two-way tables- Two-way frequency tables and Venn diagrams
- Two-way frequency tables
- Read two-way frequency tables
- Create two-way frequency tables
- Two-way relative frequency tables
- Create two-way relative frequency tables
- Analyze two-way frequency tables
- Interpreting two-way tables
- Interpret two-way tables
- Categorical data example
- Analyzing trends in categorical data
- Trends in categorical data
- Two-way relative frequency tables and associations
- Two-way tables review

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Two-way tables review

Two-way tables organize data based on two categorical variables.

## Two way frequency tables

Two-way frequency tables show how many data points fit in each category.

Here's an example:

Preference | Male | Female |
---|---|---|

Prefers dogs | ||

Prefers cats | ||

No preference |

The columns of the table tell us whether the student is a male or a female. The rows of the table tell us whether the student prefers dogs, cats, or doesn't have a preference.

Each cell tells us the number (or frequency) of students. For example, the $36$ is in the $36$ males who preferred dogs in this dataset.

**male column**and the**prefers dogs row.**This tells us that there areNotice that there are

**two variables**—gender and preference—this is where the**two**in**two**-way frequency table comes from.*Want a review of making two-way frequency tables? Check out this video.*

*Want to practice making frequency tables? Check out this exercise.*

*Want to practice reading frequency tables? Check out this exercise*

## Two way relative frequency tables

Two-way relative frequency tables show what percent of data points fit in each category. We can use row relative frequencies or column relative frequencies, it just depends on the context of the problem.

For example, here's how we would make column relative frequencies:

**Step 1: Find the totals for each column.**

Preference | Male | Female |
---|---|---|

Prefers dogs | ||

Prefers cats | ||

No preference | ||

Total |

**Step 2: Divide each cell count by its column total and convert to a percentage.**

Preference | Male | Female |
---|---|---|

Prefers dogs | ||

Prefers cats | ||

No preference | ||

Total |

Notice that sometimes your percentages won't add up to $100\mathrm{\%}$ even though we rounded properly. This is called round-off error, and we don't worry about it too much.

Two-way relative frequency tables are useful when there are different sample sizes in a dataset. In this example, more females were surveyed than males, so using percentages makes it easier to compare the preferences of males and females. From the relative frequencies, we can see that a large majority of males preferred dogs $(78\mathrm{\%})$ compared to a minority of females $(41\mathrm{\%})$ .

*Want a review of making two-way relative frequency tables? Check out this video.*

*Want to practice making relative frequency tables? Check out this exercise.*

*Want to practice reading relative frequency tables? Check out this exercise*

## Want to join the conversation?

- even tough I am an experienced engineer, i had to spend some time (more than 4 repeats to get 3/4 score) on the last "Trends in categorical data" practice test. I had to learn tendencies by trial and error; "is it probable? is it more probable?".

and also when to use row or column percentages was a bit dependent on the language itself: "dog lovers among men!" or "men among dog lovers!"

It would be better to give extra information about these during the course to let newcomers learn better.(107 votes)- I am by no means close to any of you, but yes I agree that language at times is either confusing or too concise, or perhaps is just my inexperience with the material.(14 votes)

- Why would someone have the columns add up to 100% instead of having the rows add up to 100%?(4 votes)
- It depends on what you would like to compare. In the example above, if you want to know "Of dog lovers, what proportion are male?" Adding the rows up to 100 would be appropriate. If you wanted to know "Of males, what proportion are dog lovers?" adding the columns up to 100 would be more appropriate.(32 votes)

- “From the relative frequencies, we can see that a large majority of males preferred dogs (78%) compared to a minority of females (41%)”

I still don’t understand what can and cannot be compared. Since this a column relative frequency table shouldn’t you only be allowed to compare data points that are in the COLUMN? How can you here compare between those two genders as the above quoted statement does?

Shouldn’t you only be able to say that males are more likely to prefer dogs over cats and that females are more likely to prefer cats over dogs?(8 votes)- Your understanding is correct. When dealing with a column relative frequency table, you should primarily compare within each column since the percentages are calculated based on the total within each column.

So, if you have a table displaying the preferences of males and females for dogs, cats, or having no preference, the percentages within the "Male" column should be compared with each other, and the percentages within the "Female" column should be compared with each other.

For example, you could say "Within the male population, 78% preferred dogs, 15% preferred cats, and 7% had no preference." Similarly, "Among females, 41% preferred dogs, 38% preferred cats, and 21% had no preference."

However, it is not appropriate to directly compare the percentages across columns. Saying, "A large majority of males preferred dogs (78%) compared to a minority of females (41%)" might be misleading, as these percentages represent different base populations (males and females) and are not directly comparable.(2 votes)

- why is this stuff so difficult and confusing?(6 votes)
- please help me with the trends in cat data test!

i will allways upvote the first person to answer(2 votes)- 8 Male prefer cats while 26 female prefer cats. So in total (8+26) 34 prefer cats. Here we considered the row 'prefer cats' data. Now we can find the percentage. Out of all those who prefer cats, there are (8/34 * 100) ~= 24% Male(approx.) and (26/34 * 100) ~= 76% Female(approx.).

As mentioned in this article, we can use row relative frequencies or column relative frequencies, it just depends on the context of the problem.

I hope you have got better clarity now.

Good Luck. Happy Learning.(2 votes)

- I am trying to analyze a two-way table that involves data in the form of scores out of 10 rather than frequencies. How could I analyze this with conditional or marginal distributions?(2 votes)
- Convert it into a number you can work with.(1 vote)

- Is there an individual in two way tables(2 votes)
- Yes, there's always an individual. In real-life, the
**table caption**usually gives you the individual. Imagine the table on this page has the caption*Pet preferences among students in my class*. Then*student in my class*would be the individual.

If there is no caption, you have to look at the two variables and infer what kind of subject they have in common. In this case we have variables for gender and pet preference, so we can infer that the individual must be a person, human, interviewee, study subject, or whatever we choose to call it.(0 votes)

- How do we figure out B?(1 vote)
- how do you solve two way tables?(1 vote)
- To solve a two-way table, first, understand its structure by identifying the variables represented in rows and columns. Read the entries in each cell, representing counts, frequencies, or percentages. Identify marginal totals, which are sums at the end of rows and columns. Calculate row and column percentages if needed by dividing cell counts by corresponding totals. Interpret the data, looking for patterns or trends. Answer specific questions by comparing values across categories. Check for associations between variables, and consider external factors for a comprehensive understanding. Finally, draw conclusions based on your analysis to gain insights into the relationships within the categorical data.(1 vote)