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

Hypothesis test for difference in proportions | AP Statistics | Khan Academy


6m read
·Nov 11, 2024

We're now going to explore hypothesis testing when we're thinking about the difference between proportions of two different populations.

So here it says, here are the results from a recent poll that involved sampling voters from each of two neighboring districts: District A and District B. Folks were asked whether they support a new law or not. From each district, we took a sample of 100 voters, and then we were able to calculate the proportion from that sample that supported the law. Here we have the combined data, including the combined proportion, and we're asked, does this suggest a significant difference between the two districts?

This is asking for a hypothesis test, and the way we would do that is we would set up our null hypothesis. Remember, our null hypothesis is the one that we would assume that there is no difference. So we would assume that the true proportion of folks in District A that support the new law is equal to the proportion in District B that support the law. Another way to think about it is that the difference would be equal to zero. Our alternative hypothesis is that the absolute difference between the proportions is not equal to zero.

If we were doing an all-out hypothesis test, we would set a significance level, which we usually denote with an alpha. Oftentimes it might be a ten percent significance level or a five percent significance level. Let's say we set it at a five percent significance level. What we would do is say, all right, let's assume that the null hypothesis is true. Assuming the null hypothesis is true, what is the probability of getting a difference between our sample proportions this extreme or more? If that probability is less than our significance level, then we reject the null hypothesis, which would suggest the alternative.

Now, before we go deeper into our inference, we want to test our conditions for inference. We've seen these many times before. You have the random condition, where you would need to feel good that both of these samples are truly random. You would have your normal condition, which is that you would have at least 10 successes and failures in each of these samples. We see that we do indeed have at least 10 successes and at least 10 failures in each of those samples.

Then you have your independence condition. In the independence condition, you are either sampling with replacement, or you need to feel good that each of these sample sizes are no more than 10% of the entire population. So, I guess we will assume that there's at least a thousand folks in District A and at least a thousand folks in District B. That would allow us to meet the independence condition.

With that out of the way, let's assume the null hypothesis and start thinking about the sampling distribution of the difference between the sample proportions, assuming that null hypothesis. The first thing I want to think about is what is going to be the standard deviation of the difference in the sampling distributions?

Well, we have seen in a previous video when we talked about differences of proportions that we could think about the variance. The variance of the sampling distribution—there's a lot of notation here—so the variance is going to be equal to the variance of the sampling distribution of the sample proportion from District A plus the variance of the sampling distribution of the sample proportion from District B.

Now, in general, you can figure out the variance of the sampling distribution of a sample proportion with the following formula. We've seen this before. The variance of the sampling distribution of the sample proportion is going to be equal to our true proportion times 1 minus our true proportion, all of that over your sample size.

In either situation, we don't know the true proportions for District A or District B. That's why we're in this; that's why we're even doing this hypothesis test to begin with. But we can try to estimate it. Remember, we're assuming that the true proportions are equal, even though we might not know what they are. What is going to be our best estimate of that true proportion? If we assume that District A and District B have no difference in terms of the number of people who support the new law, the best estimate would actually be the combined sample, the combined sample proportion right over here.

To estimate these values, we use this combined sample proportion in the place of p over here. So we could say that this is going to be our combined sample proportion times 1 minus our combined sample proportion, all of that over our sample size. Since we're assuming that there's no difference between District A and District B, this would also apply to that, right over there.

So let me rewrite this again. The standard deviation of the sampling distribution of the difference of the sample proportions from District A and District B is going to be roughly, remember we weren't able to calculate it exactly, but we're using this combined proportion as our best estimate. Let me do a big square root right over here, a big radical.

So underneath that, we're going to have our estimate of this, which is 0.55 times 1 minus 0.55, so 0.45 over 100, plus our estimate of this, which is 0.55—it's the same thing again—times 0.45. Remember that's because we're assuming the null hypothesis is true, all of that over this sample size, all of that over 100.

Now we can get our calculator out to actually calculate it. So we get the square root of 0.55 times 0.45 divided by 100. Now, I could add that whole thing again, or I could just multiply by 2. So times 2 is equal to approximately 0.07. So this is going to be approximately equal to 0.07.

Using this, we can calculate a z-score and then we can think about what's the probability of getting a z-score that extreme or more. Our z-score or our z-value would be equal to the difference that we got (p hat sub A - p hat sub B) all of that over our estimate of the standard deviation of the sampling distribution of this difference between the sample proportions, so all of that over zero point.

Now, this up here in yellow, it's 0.58 minus 0.52. This is going to be equal to 0.06 over 0.07. We can get our calculator out for this again. So we have 0.06 divided by 0.07 is going to be approximately 0.86.

So this is approximately 0.86. Now, what's the probability of getting something this extreme or more extreme? Let me just make sure we can visualize it properly. So if this is our sampling distribution of the difference between our sample proportions and we're assuming the null hypothesis, the mean of our sampling distribution is going to be 0. It’s going to be 0 right there.

We just got a result that is less than a standard deviation above the mean. So we just got a result that puts us right there. If we ask ourselves what's the probability of getting a result at least that extreme, we would say, okay, it would be what’s the probability of getting a result—all of this area right over here—and it would also be what’s this area on the other side of the mean.

We know that this is over 30 because even if you just exclude one standard deviation above and below the mean, if you see anything more extreme than that—so if you put this area and this area—you’re thinking you're looking at roughly 31 or 32 percent.

So the probability of getting something at least this extreme is going to be over 30. It's definitely going to be higher than our significance level. It's actually completely reasonable to get a difference this extreme if we assume the null hypothesis is true.

In future videos, we can go even deeper, where we can actually just look this up on a z-table to calculate these areas more precisely, and we can compare them to the significance level. But here, it's not even close. We're nowhere close to being able to reject the null hypothesis.

So to answer the question, does this suggest a significant difference between the two districts? No, no, it doesn't.

More Articles

View All
The world depends on a collection of strange items. They're not cheap
Part of this video was sponsored by Google Domains. This is a US government warehouse that sells almost anything you can imagine: blueberries, steel, cigarettes, limestone, a standard bullet, and even some things you don’t want to imagine. I also see you …
NERD WARS: Bowser VS The Hulk: Who Would Win? -- Wackygamer
[Music] Superheroes versus videogame characters: The Incredible Hulk vs. King Koopa. Here’s my reason why Koopa would win. Sure, the Hulk is big and strong; Koopa’s not really strong, he’s just big. But he could shoot fireballs, and the Hulk is not immune…
DISTORTIONS
Hey, Vsauce. Michael here. I am distorted. The pixels you are watching have been time displaced. They’ve been mapped onto a gradient, and the darker the region they’re mapped to, the further behind they lag. The effect is really fun, but it’s certainly no…
3 Stoic Ways Of Letting Go
Life can be extremely stressful at times. And this is basically because we’re holding on to illusions of control and because our minds are overthinking and ruminating all the time. In most cases, holding on to things is a waste of energy, and overdoing it…
Will the stock market crash again?
Hey guys, welcome back to the channel! In this video, we’re going to be doing a bit of an update video on my thoughts around where the market is at the moment and whether we might see some poorer market conditions going out into the future. You probably …
Visually dividing unit fraction by a whole number
We’re asked to figure out what is one-seventh divided by four. They help us out with this diagram. We have a whole divided into seven equal sections; each of those is a seventh. We have one of those sevenths filled in, so this is one-seventh right over he…