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.

### Course: Statistics and probability>Unit 13

Lesson 1: Comparing two proportions

# Hypothesis test comparing population proportions

Once again, Sal continues the discussion of election results to run a hypothesis test comparing population proportions. Created by Sal Khan.

## Want to join the conversation?

• What is the difference between this video and the last one? In the last vid, we wanted to know how much more likely are men to vote for the candidate then women, and we figured the probability out. Wasn't the null hypothesis already rejected in the previous vid.?
• The result should indeed be the same.

The difference is that here, he is solving the problem by using the 'hypothesis' test. To solve a problem you can use several methods. Some methods can't be used for every problem (some are only good for one sided or one-tailed tests, etc).

It's just a different way of working, and depends on how you interpret the problem. Hope that helps a bit.
• Great video. But why didn't we calculate the standard deviation using the traditional method i.e. estimate each standard deviation with the help of their respective sample standard deviations divided by the square root of 1000 and then add them to get the sampling distributions variance?
• Sal utilized what is known as a "pooled" sample technique for determining what the sample proportion's mean would be if there is no meaningful difference between men and women votes in the example (i.e. the null hypothesis). The difference results because in the case of proportions we are dealing with a sample-statistic quantity (i.e. a sample represented as a binary proportions of the 2 wholes) rather than the physical values of each sample. Thus, in the case of binary statistics, when you want to assume that the binary statistics come from the same population, it is appropriate to "pool" together the two proportions when estimating that population's same mean (p).
• Why Sal used p1=p2 assumption while calculating standarad deviation, as in the data , p1=0.642 and p2=0.591, then y he assumed p1=p2 to calculate standarad deviation. Also if p1=p2 then p1-p2 must be equal to 0 and not 0.051. Also the standarad deviation clculated in this video(0.02187) is different from standarad deviation in last video (0.022). Please explain
• Sal was solving for the null hypothesis which was that there is no difference between the male and female voting preference, therefore meaning that the means (mu) should be the same. The null hypothesis should always describe that all events are independent and have no effect on each other.

As for the difference in the standard deviations, it should have to do with the fact that Sal was doing a hypothesis test, which assumes both means (mu) are the same which would change the standard deviation.

Please forgive me if this is not correct.
• how do you work this if the populations are two different amounts...say like 200 males and 250 females at a 5% significant level.
• Would calculating the proportions change now? Because the males would take up a larger proportion, and if you assume the null hypothesis, would that sample affect the average p more?
• why is standard deviation of sampling distribution for null hypothesis calculated differently in this video and video "hypothesis test for difference of means"?
• Because in the Hypothesis test for difference of means, we were comparing two means against each other, whereas in this video we are comparing two proportions.

However, the two expressions for the standard error in these two videos are actually equivalent, they're just expressed in different ways, because we're dealing with different types of data (numerical vs. categorical). Because of this, we use different statistics (sample mean vs. sample proportion), and hence the formulas look a little bit different.

If we coded the successes as 1 and failures as 0, then the sample proportion P would be equal to the sample mean, and if we calculated the standard deviation, it would be equal to the expressions that Sal uses (after we extend to two groups, as this case presents).
• When calculating the SD with p1=p2, why didn't he change the n from 1000 to 2000?
(1 vote)
• I wish I could draw this... Remember that to get the standard deviation of the difference, we had sqrt(p1*(1-p1)/n1 + p2*(1-p2)/n2)? I used n1 and n2 instead of 1000. You can use this with different population sizes, and I find it a little confusing that he uses 1000 for both.For this H0, we assumed p1 = p2, so we POOLED the data together and got a new p = 0.6165. That's the new p we are using rather than p1 and p2, but we change nothing else. Now I can simplify the standard deviation to:
sqrt(p*(1-p)*(1/n1 + 1/n2))

1/n1 + 1/n2 simplifies to 2/1000 in THIS problem, but it won't be so neat when you have different population sizes.
• Why did Sal use a two tailed distribution? If the difference from the mean is more than 1.96 less wouldn't that area also mean that there is a difference between how men and women vote, so shouldn't it just be the upper area of the standard deviation used to calculate the confidence level?
• A one-tailed test would be appropriate if the alternative hypothesis were directional. If the alternative hypothesis is that the two populations are different (but not in a particular direction), then it's more appropriate to use a two-tailed test.
• Is assuming the null hypothesis to be true, the same thing as saying the claim is being made in the alternative hypothesis?
• I'm not sure I follow what you mean, exactly. The null hypothesis means that you assume there is no relationship, no phenomenon, no connection. In other words, the "null hypothesis" just means assuming the data are due to chance.

Another way of putting it is that if there is no verifiable reason to assume there is some cause/effect relationship, you assume there is none.

All of modern science is based on this principle. It is the basis of parsimony.
• Why the std. dev (=0.0217) was not computing like Sqrt( 0.6165*(1-0.6165) / 2000) = 0.0108 ?
• no, the two formulas are different (although they seem similar at the final stage)
#one for proportion of voting of all population (sum of men and women)
#the other for standard deviation of difference (between men and women)

1. proportion_all
= (642+591) / (1000+1000)
= 0.6165

2. std_difference
= sqrt[std_men + std_men]
#std_men=p_men(1-p_men)/n_men (same for women)
= sqrt[p_men(1-p_men)/n_men + p_women(1-p_women)/n_women]
#p_men=p_woman=p_all by null hypothesis
= sqrt[p_all(1-p_all)/n_men + p_all(1-p_all)/n_women)]
#p_all=0.6165, n_men=n_women=1000
= sqrt[0.6165(1-0.6165)/1000 + 0.6165(1-0.6165)/1000]
#first and second term in [] are the same
= sqrt[2*0.6165(1-0.6165) / 1000]
~ 0.0217
#be careful not to multiply 2 with denominator too, or it will shrink std

in short, we "treated" our population as if they grew 2x to get the whole proportion. but we didn't. we cared them individually and then summed them up. but it happens for their sizes to be n_men=n_women=1000. this might be the cause of confusion, i believe. but a good news is we can use the formulas above for any sizes of populations (say n_men=1000, n_women=10000)
(1 vote)
• To be numerically correct should not the calculated sample variance be multiplied by 2000/1999 to make it an unbiased estimator of the population variance? i.e. by (n/n-1)