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 5 Golden Rules of Real Estate Investing
What’s up, you guys? It’s Graham here. So I’ll just get right into it. These are the five real estate investing tips to live by and keep in mind. And this is coming from somebody who owns five investment properties already and someone who’s been in real e…
Encountering an Anaconda | Primal Survivor: Escape the Amazon | National Geographic
So how far are you coming from? I come from south. Okay, all the way south? Yeah. Coming and going to? Heading north. Heading north? Okay. Okay. Yeah, we are rounding up these horses. Oh yeah? Yeah, my horses had strayed from this wapan Roundup. T…
Part-to-whole relationships in text structure | Reading | Khan Academy
Hello readers. Today we’re going to be talking about how smaller sections of text work together to support the whole text. But first, let us consider Voltron. It is a giant robot made up of five smaller robots, each one piloted by a person. Five friends, …
Impedance vs frequency
In this video, we’re going to continue talking about AC analysis and the concept of impedance as the ratio of voltage to current in an AC situation. Just as a reminder of the assumptions we’ve made for AC analysis, we’ve assumed that all of our signals ar…
Modal verbs | The parts of speech | Grammar | Khan Academy
Hello grammarians! Today we’re going to talk about a class of auxiliary or helper verbs called the modal verbs. These are verbs that have special properties and help other verbs. But what is modality? My fellow grammarian, I am so glad you asked! Modalit…
Rare Ghost Orchid Has Multiple Pollinators | Short Film Showcase
The swamp itself is steeped in mystery, holding a wildness that is so increasingly rare in modern life. There’s this very like ghost-like thing dancing off the edge of a tree; it just deepens the mystery. It deepens the power of those places. There’s just…