If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Categorical data example

We can explore the relationship between two categorical variables with two-way tables to see if there is an association between the variables. In this example, we see if data from a sample suggests an associate between video games and violence. Created by Sal Khan.

Want to join the conversation?

Video transcript

Lucio wants to test whether playing violent video games makes people more violent. He asks his friends whether they play violent video games and whether they have been in a fight in the last month. He recorded the results in the table shown below. Fill in the table to show the fraction of each group of students who have been in a fight. Then decide whether there is an association between violent video games and getting in a fight amongst Lucio's friends. So let's see what they're doing here. So students who play video games-- fractions who have been in a fight, fraction who haven't. Students who don't play violent video games-- fraction who have been in a fight, fraction who haven't. So let's answer the first part of this. Students who play violent video games. So let's look at those students. So the students who play violent video games-- it looks like Ellen plays violent video games. Actually, let me just focus on the data that we care about. So Ellen. So let's look at all the people who play violent video games. So let's see. This column is violent video games. So we have a yes here. So actually, we have both of these right over here. And then we have down here. And then that's all of them. There's 1, 2, 3, 4, 5 people who play violent video games. Now what fraction of them have been in a fight? Well, it looks like 1 out of the 5 have been in a fight. The rest of them have not been in a fight. So we could say 1/5-- let's just write that down. So 1/5 have been in a fight. Fraction who haven't-- 4/5. So that's all these other nos. They play violent video games, but they haven't been in a fight. 1, 2, 3, 4-- 4/5. So students who don't play violent video games. Well, that's everyone else. And let's see how many data points that is. That is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. So there's a total of 15 students. And how many of them have been in a fight? So let's see. We have 1. And then let's see, 1, and 2, and 3. So 3 out of the 15 have been in a fight. So 3 out of 15 is the same thing as 1 out of 5. Those are equivalent fractions. And then the fraction who haven't? Well, that's just going to be everyone else. That's going to be 12 out of 15 or 4 out of 5. So based on Lucio's data-- and this wasn't a huge sample size, obviously. He only found 5 kids who were playing violent video games. And 1 of them had gotten into a fight. So this isn't a super rigorous study. But at least based on his data, if we're trying to decide whether there's an association between violent games and getting into a fight amongst Lucio's friends, it doesn't seem like there is. It seems like relatively, whether or not they play violent video games or not, 1/5 of them have been in a fight in the last month. So it really doesn't seem any difference. If this number was, I don't know, 4/5, or 5/5, or all of them, then I'd say, hey, even with Lucio's fairly small sample, I would say, hey, maybe there is some type of a strong association between playing violent video games and fighting. But here you really don't see any difference.