Hypothesis Testing for ProportionsAn example of a one-sample test for proportions:We could run a test of hypothesis to see if our data for Red M&M’s actually agrees with the advertised amount.In our experiment, we had an average of 10.7 or 19% Red.Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- Red | 83 10.73494 3.679489 3 22 pRed | 83 .1916867 .0651044 .05 .38 Total | 83 56.06024 2.96051 44 63 Using the Steps in Hypothesis Testing:1. State H0 (it ALWAYS has the = ) and HA (it’s sign depends on the question asked).The null hypothesis is the ‘status quo’, so here it would be M&M’s advertised percent. According to their web site, this is 20%. Since we just want to check this, we can test:H0: Red = 0.20 vs. HA: Red 0.202. Determine the appropriate -level (depending on the consequence of Type I and II errors).We’ll discuss Type I and II errors later. For now, let’s use the usual 5%. This means if our observed proportion would happen less than 5% of the time if the true proportion is 20%, then we’re going to claim the advertised amount is NOT 20%.3. Determine the appropriate test and calculate a p-value (use Labs=>Calculating Tests of Hypotheses and the flowchart to determine which Case).So far we’ve only talked about z-tests (we converted the sample proportion, p, to a z-score and then found the probability using the Z Table). There are many other types of tests that we will discuss soon. For this particular type of data, we will be using Case 6, the normal approximation for proportions. NOTE: You must verify if the Conditions for the normal approximation hold before running this test, however. We did this on HW#4.5.Case 6 says we need to give n and p. So, we put 0.05 in the box labelled alpha, 56 in the n box, 0.19 in the p box, 0.20 in the hyp value (hypothesized value, the number in H0) box, and finally click on Two-sided in the Test box. You just ignore the rest of the boxesbecause it isn’t used. The output and graphare:Two-Sided Test for 0-1 proportion pi(approximate): alpha = .05 Hypothesized value = .2 n = 56, p = .19 Z_calc = -.18708287 Critical values: -1.959964 , 1.959964 Fail to reject H_0 p-value = .85159566 4. State the conclusion (if p-value ,reject H0; otherwise, fail to reject) in terms of the hypothesis (answer the question asked).The p-value is given in the output (see the last line) and in the last line of the title of the graph.Since the p-value = 0.852 which is NOT < = 0.05, we cannot reject our null hypothesis. In other words, our data is quite consistent with the advertised percent of Red M&M’s. We cannot refute their claim.Another example of a one-sample test for proportions:What would happen if we only had one bag of M&M’s, and it was the bag of 60 with only 5 Red? Is this too few Red’s? Are there really less Red M&M’s than the advertised amount?Still using the Steps in Hypothesis Testing:1. State H0 (it ALWAYS has the = ) and HA (it’s sign depends on the question asked).Again, the null hypothesis is the advertised percent, 20%. Now, however, we want to know if the true proportion is really less than the stated amount, so we should test:H0: Red = 0.20 vs. HA: Red < 0.202. Determine the appropriate -level (depending on the consequence of Type I and II errors).Let’s stay with the standard 5% -level.3. Determine the appropriate test and calculate a p-value (use Labs=>Calculating Tests of Hypotheses and the flowchart to determine which Case).For this data, we will again use Case 6, the normal approximation for proportions. NOTE: 5 out of 60 is barely thenecessary amount.Case 6 says we need to give n and p.So, we put 0.05 in the box labelled alpha, 60 in the n box, 0.083 in the pbox, 0.20 in the hyp value(hypothesized value, the number in H0)box, and finally click on Left-sided inthe Test box. The output and graphare:Left-Sided Test for 0-1 proportionpi (approximate): alpha = .05 Hypothesized value = .2 n = 60, p = .083 Z_calc = -2.2656953 Critical value: -1.6448536 Reject H_0 p-value = .01173502 4. State the conclusion (if p-value , reject H0; otherwise, fail to reject) in terms of the hypothesis (answer the question asked).Since the p-value = 0.012 which IS < = 0.05, we reject our null hypothesis and state that there is sufficient evidence to conclude that the true proportion of Red M&M’s, Red, is actually LESS than 20%. We can say that Red is statisitically significantly less than 20%. In other words, our data disagrees with the advertised amount enough to dispute M&M’s claim. Why is there a difference? First, you need to think of what the significance level, , means and what a hypothesis test actually does. Remember, we said there was a distribution of Red M&M’s, or the proportion of Red M&M’s in a regular size bag. The significance level, = 5%, means that we will be ‘throwing out’ 5% of this distribution and therefore WRONG 5% of the time. In hypothesis testing, we assume that the center of our normal curve is the hypothesized value (here it’s 20%) and calculate where our data falls on this curve. We just happened to get a bag out there on the tail! Look at the interpretation of the p-value: If the true proportion of Red M&M’s, Red, is actually 20%, we would see 8.3% or less Red M&M’s only 1.2% of the time.This sample wouldn’t happen very often, but it is still possible.An example of a two-sample test for proportions:We could also test whether the proportions of Blue and Orange are the same as M&M claims. Our sample data says that there are only 4.9 Blue M&M’s and 6.6 Orange on average. Does this means the true proportions are different? Blue | 83 4.903614 2.588033 0 14 Orange | 83 6.566265 3.151433 0 14 pBlue | 83 .0872289
View Full Document