Monday, November 25, 2019
Hypothesis Test for Comparing Two Proportions
Hypothesis Test for Comparing Two Proportions In this article we will go through the steps necessary to perform a hypothesis test, or test of significance, for the difference of two population proportions.Ã This allows us to compare two unknown proportions and infer if they are not equal to each other or if one is greater than another. Hypothesis Test Overview and Background Before we go into the specifics of our hypothesis test, we will look at the framework of hypothesis tests.Ã In a test of significance we attempt to show that a statement concerning the value of a populationÃ parameter (or sometimes the nature of the population itself) is likely to be true.Ã We amass evidence for this statement by conducting a statistical sample.Ã We calculate a statistic from this sample.Ã The value of this statistic is what we use to determine the truth of the original statement.Ã This process contains uncertainty, however we are able to quantify this uncertainty The overall process for a hypothesis test is given by the list below: Make sure that the conditions that are necessary for our test are satisfied.Clearly state the null and alternative hypotheses. The alternative hypothesis may involve a one-sided or a two-sided test.Ã We should also determine the level of significance, which will be denoted by the Greek letter alpha.Calculate the test statistic. The type of statistic that we use depends upon the particular test that we are conducting.Ã The calculation relies upon our statistical sample.Ã Calculate the p-value. The test statistic can be translated into a p-value.Ã A p-value is the probability of chance alone producing the value of our test statistic under the assumption that the null hypothesis is true. The overall rule is that the smaller the p-value, the greater the evidence against the null hypothesis.Draw a conclusion. Finally we use the value of alpha that was already selected as a threshold value.Ã The decision rule is that If the p-value is less than or equal to alpha, then we reject t he null hypothesis. Otherwise we fail to reject the null hypothesis. Now that we have seen the framework for a hypothesis test, we will see the specifics for a hypothesis test for the difference of two population proportions.Ã The Conditions A hypothesis test for the difference of two population proportions requires that the following conditions are met:Ã We have two simple random samples from large populations.Ã Here large means that the population is at least 20 times larger than the size of the sample. The sample sizes will be denoted by n1 and n2.The individuals in our samples have been chosen independently of one another.Ã The populations themselves must also be independent.There are at least 10 successes and 10 failures in both of our samples. As long as these conditions have been satisfied, we can continue with our hypothesis test. The Null and Alternative Hypotheses Now we need to consider the hypotheses for our test of significance.Ã The null hypothesis is our statement of no effect.Ã In this particular type of hypothesis test our null hypothesis is that there is no difference between the two population proportions.Ã We can write this as H0: p1 p2. The alternative hypothesis is one of three possibilities, depending upon the specifics of what we are testing for:Ã Ha:Ã p1 is greater than p2. This is a one-tailed or one-sided test.Ha: p1 is less than p2. This is also one-sided test.Ha: p1 is not equal to p2. This is a two-tailed or two-sided test. As always, in order to be cautious, we should use the two-sided alternative hypothesis if we do not have a direction in mind before we obtain our sample.Ã The reason for doing this is that it is harder to reject the null hypothesis with a two-sided test. The three hypotheses can be rewritten by stating how p1 - p2 is related to the value zero.Ã To be more specific, the null hypothesis would become H0:p1 - p2 0.Ã The potential alternative hypotheses would be written as: Ha:Ã p1 - p2Ã 0 is equivalent to the statement p1 is greater than p2.Ha:Ã p1 - p2Ã Ã 0 is equivalent to the statement p1 is less than p2.Ha:Ã p1 - p2Ã Ã Ã¢â° 0 is equivalent toÃ the statement p1 is not equal to p2. This equivalent formulation actually shows us a little bit more of what is happening behind the scenes.Ã What we are doing in this hypothesis test is turning the two parameters p1 and p2Ã into the single parameter p1 - p2.Ã We then test this new parameter against the value zero.Ã The Test Statistic The formula for the test statistic is given in the image above.Ã Ã An explanation of each of the terms follows: The sample from the first population has size n1.Ã The number of successes from this sample (which is not directly seen in the formula above) is k1. The sample from the second population has size n2.Ã The number of successes from this sample is k2.The sample proportions areÃ p1-hat k1 / n1Ã and p2-hat Ã k2 / n2 .We then combine or pool the successes from both of these samples and obtain:Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã Ã p-hat ( k1 k2) / ( n1 n2). As always, be careful with order of operations when calculating.Ã Everything underneath the radical must be calculated before takingÃ the square root. The P-Value The next step is to calculate the p-value that corresponds to our test statistic. We use a standard normal distribution for our statistic and consult a table of values or use statistical software.Ã The details of our p-value calculation depend upon the alternative hypothesis we are using: For Ha: p1 - p2Ã 0, we calculate the proportion of the normal distribution that is greater than Z.For Ha: p1 - p2Ã Ã 0, we calculate the proportion of the normal distribution that is less than Z.For Ha: p1 - p2Ã Ã Ã¢â° 0, we calculate the proportion of the normal distribution that is greater than |Z|, the absolute value of Z.Ã After this, to account for the fact that we have a two-tailed test, we double the proportion.Ã Decision Rule Now we make a decision on whether to reject the null hypothesis (and thereby accept the alternative), or to fail to reject the null hypothesis.Ã We make this decision by comparing our p-value to the level of significance alpha. If the p-value is less than or equal to alpha, then we reject the null hypothesis. This means that we have a statistically significant result and that we are going to accept the alternative hypothesis.If the p-value is greater than alpha, then we fail to reject the null hypothesis. This does not prove that the null hypothesis is true. Instead it means that we did not obtain convincing enough evidence to reject the null hypothesis.Ã Special Note The confidence interval for the difference of two population proportions does not pool the successes, whereas the hypothesis test does.Ã The reason for this is that our null hypothesis assumes that p1 - p2 0.Ã The confidence interval does not assume this.Ã Some statisticians do not pool the successes for this hypothesis test, and instead use a slightly modified version of the above test statistic.