yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Chi-square goodness-of-fit example | AP Statistics | Khan Academy


4m read
·Nov 11, 2024

In the game Rock Paper Scissors, Kenny expects to win, tie, and lose with equal frequency. Kenny plays Rock Paper Scissors often, but he suspected his own games were not following that pattern. So he took a random sample of 24 games and recorded their outcomes. Here are his results: out of the 24 games, he won four, lost 13, and tied seven times. He wants to use these results to carry out a chi-squared goodness of fit test to determine if the distribution of his outcomes disagrees with an even distribution.

What are the values of the test statistic, the chi-squared test statistic, and p-value for Kenny's test? So pause this video and see if you can figure that out.

Okay, so he's essentially just doing a hypothesis test using the chi-square statistic because it's a hypothesis that's thinking about multiple categories. So what would his null hypothesis be? Well, his null hypothesis would be that he has that all the outcomes are equal probability outcomes—equal, equal probability.

Then his alternative hypothesis would be that his outcomes have not equal probability. Remember, we assume that the null hypothesis is true, and then assuming if the null hypothesis is true, the probability of getting a result at least this extreme is low enough, then we would reject our null hypothesis. Another way to think about it is if our p-value is below a threshold, we would reject our null hypothesis.

What he did is he took a sample of 24 games, so n is equal to 24, and then this was the data that he got. Now, before we even calculate our chi-square statistic and figure out what's the probability of getting a chi-square statistic that large or greater, let's make sure we meet the conditions for inference for a chi-squared goodness-of-fit test.

You've seen some of them, but some of them are a little bit different. One is the random condition. I'll write them up here: the random condition would be that this is truly a random sample of games, and it tells us right here he took a random sample of his 24 games, so we meet that condition.

The second condition, when we're talking about chi-squared hypothesis testing, is the large counts condition. This is an important one to appreciate. This is that the expected number of each category of outcomes is at least equal to five. Now, you might say, "Hey, wait, I only got four wins," or "Kenny only got four wins out of his sample of 24," but that does not violate the large counts condition.

Remember, what is the expected number of wins, losses, and ties? Well, if we're assuming the null hypothesis where the outcomes have equal probability, so the expected... I could write right over here, it would be that it's one-third, one-third, one-third, and so one-third of 24 is 8, 8, and 8. That's what Kenny would expect, and since all of these are at least equal to 5, we meet the large count condition.

Then, the last condition is the independence condition. If we aren't sampling with replacement, then we just have to feel good that our sample size is no more than 10 percent of the population. He can definitely play more than 240 games in his life, so we would assume that we meet that condition as well.

So with that out of the way, we can actually calculate our chi-squared statistic and try to make some inference based on it. Our chi-squared statistic is going to be equal to... For each category, it's going to be the difference between the expected and what he got in that sample, squared, divided by the expected.

So the first category is wins; that's going to be 4 minus 8, squared, over an expected number of wins of 8, plus losses. That's 13 minus 8; 13 is how many he got—how many he lost—minus 8 expected, squared, all of that over 8.

So let's see, what is this? Four minus eight is negative four. You square that, you get sixteen. Thirteen minus eight is five; you square that, you get 25. Seven minus 8 is negative 1; square that, you get 1.

Sixteen divided by 8 is going to be 2. Twenty-five divided by 8 is going to be, let's see, that's 3 and 1/8, so that's 3.125. And then 1 divided by 8 is 0.125. You add these together; so let's see, it's going to be 2 plus 3.125, which is 5.125, plus another 0.125, so that's going to be 5.25.

So our chi-squared statistic is 5.25. Now, to figure out our p-value, our p-value is going to be equal to the probability of getting a chi-square statistic greater than or equal to 5.25. You could use a chi-squared table for that, and we always have to think about our degrees of freedom.

We have one, two, three categories, so our degrees of freedom is going to be one less than that, or three minus one, which is two. So our degrees of freedom is going to be equal to two, and that makes sense because, you know, for a certain number of games, if you know the number of wins and you know the certain number of losses, you can figure out the number of ties, or if you know any two of these categories, you can always figure out the third.

So that's why you have two degrees of freedom. Let's get out our chi-squared table. We have 2 degrees of freedom, so we are in this row, and where is 5.25? So 5.25 is right over there, and so our probability is going to be between 0.10 and 0.05.

So our p-value is going to be greater than 0.05 and less than 0.10, and so, for example, if ahead of time—and he should have done this ahead of time—he set a significance level of five percent, and our p-value here is greater than five percent, which we just saw, he would fail to reject in this situation the null hypothesis.

But they're not asking us that here; all they're asking us is what is our chi-squared value and what range is our p-value in? Well, let's see; 5.25 are both of these values, and we saw we got a p-value between 5 and 10, so it is choice A right over there.

More Articles

View All
2015 AP Calculus AB 6c | AP Calculus AB solved exams | AP Calculus AB | Khan Academy
Part C: Evaluate the second derivative of y with respect to x squared at the point on the curve where x equals negative one and y is equal to one. All right, so let’s just go to the beginning where they tell us that d y d x is equal to y over three y squ…
Identifying symmetrical figures | Math | 4th grade | Khan Academy
Which shapes are symmetrical? To answer this, we need to know what it means for a shape to be symmetrical. A shape is symmetrical if it has at least one line of symmetry. A line of symmetry, and now that answer is only helpful if we know what a line of sy…
Is the 2024 Gold Rush a Warning to the US Economy?
Have a look at this price chart over the last 2 years. Up 65% phenomenal growth! Now, with returns like that, you’d probably expect it to be some sort of up-and-coming tech stock, right? One with a foot in the door of the artificial intelligence Gold Min…
Dilations and properties
We are told that quadrilateral ABCD is dilated about point P. So, this is our quadrilateral that’s going to be dilated around point P, and then they ask us some questions: Are the coordinates of the vertices preserved? Are corresponding line segments on t…
Inside the Mission to Save the Rare Helmeted Hornbill From Poachers | National Geographic
This is about the second week of this expedition. We are at our third location here. My mission is to photograph the helmeted armbands. These hella nerd hornbills have been occupying these forests for thousands of years, but recently they’ve fallen prey t…
Venturing into the Heart of Manila | Podcast | Overheard at National Geographic
Picture Manila, the sprawling capital of the Philippines, and the center of a violent government crackdown on the drug trade. The city is awash with crime scenes. Neighbors come out of their homes to look at the victims and watch the authorities take them…