[SOUND] We often are correcting, reporting, or reading about the proportions of two populations. Here are a couple of examples. Employment rate is reported as the proportion of individuals in the nation who are unemployed. So when you look at the unemployment rate of April 2016. You see that it is 5%. You may want to know if that number is significantly differ than April of 2015. When it was 5.4%. Another example, is when we hear news about how political candidates may win a certain contest. For example, if 40% are expected to vote for Hillary Clinton and 46% for Bernie Sanders. Does this mean that Hillary Clinton is expected to lose? Or does it mean that this is a toss up, and either one can win. In political arena we often hear the phrase they are in a dead heat, which is not a statistical term at all. But to public it implies that the candidates are within the margin of error from each other. Thus we can't predict the outcome. In the case of West Virginia primary election if margin of error was 6%. That would be the case. But if the margin of error was 4%. Then even if Hillary Clinton gets the upper bound of 44%, and Bernie Sanders gets the lower bound of 42%. We can still predict that Bernie Sanders will win the contest. But of course, we can only be 95% confident about these confidence intervals. In this lesson, we will learn how to compare proportions for two samples from two independent populations. As before, we can be testing for two proportions being the same as opposed to being different, which would a two-tailed test. Or testing for one proportion being equal or greater than the other, or equal or less than the other, which will result in one-tailed test. Consider this very common concern. Can and do girls do as well as boys in math? One study showed that both girls and boys do equally well on math tests. A school district takes a random sample of 400 boys and another random sample of 360 girls in grade 11. And looks at their most recent standardized test scores. The math score of 315 of the boys and 280 of the girls were at the proficient level. At 5% level of significance, can the school district claim that the boys and the girls do equally well on math tests? Let's call sample one for the boys, and sample two for the girls. This will be the hypothesis we will be testing at 5% level of significance. Now we need to find the p-value. To find a p value, we need to find how far is the difference in the proportion we observe in the two samples from the hypothesized proportion differences. The test statistics based on our sample is denoted by z and is calculated by using this formula. The numerator is the difference we observe among the two samples minus hypothesized difference. This is then divided by the standard error. The standard error itself is calculated by this formula. Now, luckily we can automate this with excel. However, Excel does not provide the built in function when it comes to population proportion and hypothesis testing. I have provided a worksheet where you can enter your sample information and then you get the results. I will use the output from that to discuss the concepts. And as before of course, you can watch the Excel videos. And you should later on to see how exactly I got the results that I'm sharing with you here. Here sample one is for the boys, and 315 out of 400, or about 78.75%. And sample two are for the girls, where 280 out of 360, or about 77.78% scored a proficient level. We are testing at 5% above significance and quality for the two groups. So we will use the output for the two-tail test. The p-value is then 0.745. Since the p-value is more than 0.05. We don't reject the null hypothesis, which means our samples of boys and girls from this school district also perform equally well on the math test. Now let's consider this example. Where a fast food chain is testing a revised workflow. If the redesign is effective. Then the process for all locations will be revised. For this decision data has been collected in one location under the current design and one location under the new design. To make the new design standard the difference in the proportion of customer orders completed within four minutes or less should be 20% higher than it is right now. The data has been collected and for the current design 7,600 orders out of 10,000 were completed within four minutes. Under the new design, 5,400 out of 6,000 were completed within four minutes. What is your conclusion at the 5% level of significance. If p1 is the proportion for sample one, and p2 is the proportion for sample two for orders that completed within four minutes. Then the null hypothesis is that these two designs are not more than 20% different. And the alternate will be stated such. That by using the sample data could end up changing our current belief. Here's the output from our analysis. Here we enter the value of 20% as the hypothesized difference. And we get the p-value of one, which is more than 0.05. And thus, we will not reject the null hypothesis. Therefore, it has not been shown that the new design will improve the proportion of customers served under four minutes by at least 20%. The management is disappointed with the results. And wants to know what exactly is that 95% confidence interval for proportion increases for the new design as compared to the current design. The confidence interval is calculated by taking the difference we see in the two sample proportions plus or minus the margin of error. For sample proportion the equation used is shown here. We can use the Excel output we have to calculate this interval. The difference between p1 and p2 here is in the output and that is 14%. Z of alpha over two for 95% of confidence interval is here and that is about 1.96. Using the two-tail, since this is a continuous role that you are developing. The last term is the standard error, and we find it here. Which is 0.0057. Now we can substitute values to get the confidence interval for the proportion differences. Using the values from the output, we get confidence interval of 12.8% to 15.13% . Here they have compared the current design to the new design. The proportion of orders completed within four minutes under the current design is less than the proportion for the new design. How much less? By as much as 15.13% to 12.8%. The management wanted better than 20% improvement. Clearly, the best scenario we get based on our study is about 15% increase in the proportion. As before, sample size matters when we talk about proportion comparisons. Here I am showing the election results from March 1, 2016, known as Super Tuesday. Comparing the two candidates in the democratic party. At this point in time, Hilary Clinton had 56.5% of the votes. Or as shown in the headline, she had 15% more than Bernie Sanders. This is a fairly big lead. Yet, no one can say that she will win the state. Why? Because the margin of error will be too high, and that's because we are basing this analysis on 108 voters only. And here's the difference when we have 185,000 votes counted. Now the difference between Sanders and Clinton is significant. And even though this is not 100% of all votes, we can be fairly certain that Bernie Sanders has a higher proportion of votes than Hillary Clinton. Thus, he's the winner. So when comparing proportions be mindful of the sample size used. Some seemingly big differences are negligible, at least statistically speaking, when the sample size is small. Let's practice. An article appeared in the news gazette, our local newspaper here in Champaign Urbana. That claims a 1% decrease in number of students who have accepted their admission offer to the University of Illinois. Reports like this are presented all the time. Whether or not the information they are reporting has any significance. So I'd like to go through this example with you. Here is the data presented in the article. The reporter claims that going from 8,805 students who accepted their offer in 2015 to 7,969 in 2016 represents a 1% drop. Let's analyze this and see if indeed the difference is statistically significant and worthy of coverage. Please start by stating the null and the alternate hypothesis. Using p1 for proportion of admitted students accepting their offer in 2015 and p2 for the proportion of admitted students accepting their offer in 2016. In this article the reporter is implying that the proportion of admitted students who accepted their offer in 2015 is higher than the proportion of students who have accepted their offer in 2016. So that's actually your alternate. And then the null here is then the complement. So now let's test this claim by running our data. Here's the Excel data. What do you think? Is the reporter correct in claiming that the observed decline in the proportion of admitted students who accepted their offer is something which is newsworthy? P-value here is 0.08236 and that is greater than 0.05. Assuming that to be our significance level, which means we will not reject the null hypothesis. In another word, what we have seen in 2016 enrollment doesn't show any significant changes from 2015. These are random variations that are well within bounds of what we call noise and don't signal anything of importance. I hope you see what I'm trying to show you here. That is not everything you read or here is really the right conclusion. What is a significant change and what is noise, is what the hypothesis testing allows us to do.