252solnB2 2/13/08 (Open this document in 'Page Layout' view!) 1. The Meaning of Hypothesis Testing Text 9.1-9.12 [9.1 – 9.12] (9.1 – 9.12), 9.16** [9.17], (9.17) 2. Steps for Testing a Hypothesis Applied to testing for a Population Mean Text 9.20, 9.28a, c, d, 9.29 a, c ,e [9.18, 9.26a,b,d,e, 9.27a,b,d,e], (9.18, 9.26a,b,d,e, 9.27a,b,d,e) Text 9.48-9.51, 9.59 [9.46 - 9.49, 9.52] (9.44 – 9.47, 9.50) 3. The Use of p-value instead of Significance Levels. Text 9.28b, 9.29b [9.26c, 9.27c], B7 (B6), Text 9.34-9.44 [9.32 – 9.39, 9.40*, 9.41*, 9.44] (9.26c, 9.27c, B6, 9.32 – 9.39, 9.40) [9.40* reads ‘Suppose that in a one-tail hypothesis test where you reject H 0 only in the lower tail, you compute the value of the test statistic z as 1.38, what is the p-value?’ 9.41 reads ‘In Problem 9.40, what would be your statistical decision if you tested the null hypothesis at the 0.01 level of significance?’] B8. Graded Assignment 2 will be posted. 4. Type One and Type Two Errors Text 9.82-9.86 [9.86 – 9.90] (9.81 – 9.85) 5. Hypotheses about a Proportion Text 9.66-9.69, 9.70**, 9.72**[9.62 – 9.64, 9.66*, 9.67*], (9.57 – 9.59) 6. The Sign Test B1*, B2, B3 (B1, B2) 7. Hypothesis Test for Means - Rare Events B4, B5 (B3, B4) 8. Hypothesis Tests for a Variance. Text 12.45[9.80] (9.75), B6 (B5) ------------------------------------------------------------------------------------------------------------------ Section 3 is in this document. Finding p-values. Exercise 9.28b [9.26c in 9th] (9.26c in 8th edition): Manufacturer’s specifications say breaking strength is 70 lbs. with a std. deviation of 3.5 lbs. A sample of 49 pieces gives sample mean breaking strength of 69.1 lbs. Is there evidence that machine is not meeting specifications? In b) find a p-value for the null hypothesis. (a) Recall the following from 252solnB1: H 0 : 70 , H 1 : 70 Given: 0 70, 3.5, n 49 , x 69.1 and .05 . x The Test Ratio was z b (c) x 0 x n 3.5 0.5. . 49 x 70 69 .1 70 1.80 0.5 0.5 A p-value is a measure of the credibility of the null hypothesis and is defined as the lower low probability that a test statistic or ratio as extreme as or more extreme than the high higher observed statistic or ratio could occur, assuming that the null hypothesis is true. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) This is a 2-sided test, so we want the probability that a sample mean as extreme or more extreme than x 69.1 could occur if the population mean is 70. You can represent this by a Normal curve with a mean at 70 with the areas shaded below 69.1 and above 70.9. (70.9 is the same distance above 70 as 69.1 is below it.) Fortunately, since we already know that z 1.80 , we don’t need this diagram. Make a diagram showing a Normal curve with a mean at 0 and shade the areas below 1.80 and below 1.80. The probability that x is as extreme or more extreme than 69.1 is thus p value 2Pz 1.80 2Pz 1.80 2.5 .4641 2.0359 .0718 . From the Instructor’s Solution Manual: Interpretation: The probability of getting a sample of 49 pieces that yield a mean strength that is farther away from the hypothesized population mean than this sample is 0.0718 or 7.18%. Note the following: The rule on p-value: If the p-value is less than the significance level (alpha) reject the null hypothesis. If the p-value is greater than or equal to the significance level, do not reject the null hypothesis. Since we set the significance level at .05 , we would not reject H 0 : 1.00 . Exercise 9.29b [9.27c in 9th] (9.27c in 8th edition): Manufacturer’s specs say mean amount of paint in can is 1 gal. with std deviation of 0.2 gal. For a sample of 50 cans the mean is 0.995 gal. Is there evidence that mean amount is different from 1? In b find a p-value for the null hypothesis. Recall the following: (a) H 0 : 1.00 , H 1 : 1.00 . Given: 0 1.00, 0.02 , n 50, x 0.995 . x Test Ratio: z b (c) x 0 x n 0.02 0.002828 . 9.27 50 x 1.00 0.995 1.00 1.768 0.002828 0.002828 p value 2Pz 1.77 2Pz 1.77 2.5 .4616 .0768 . Decision: Since Zcalc = – 1.77 is between the critical bounds of 2.58, do not reject H0. There is not enough evidence to conclude that the average amount of paint per one-gallon can differs from one gallon. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) Problem B7: Test the following using (i) a test ratio with a p-value, (ii) a confidence interval for the sample mean and (iii) a critical value for the sample mean. .05 . a. H 0 : 5, H 1 : 5 when n 49 , x 8.40 and x 5.92 . b. H 0 : 5, H 1 : 5 when n 49 , x 8.40 and x 5.92 . c. H 0 : 5, H 1 : 5 when n 49 , d. H 0 : 5, H 1 : 5 when n 49 , e. H 0 : 5, H 1 : 5 when n 49 , f. H 0 : 5, H 1 : 5 when n 49 , Solution: From the formula table. Interval for Confidence Interval Mean ( x z 2 x Known) Mean ( Unknown) x t 2 s x x 8.40 and x 5.92 . s x 8.40 and x 5.92 . s x 8.40 and x 5.92 . s x 8.40 and x 5.92 . Hypotheses Test Ratio H0 : 0 z H1 : 0 H0 : 0 t x 0 x x 0 sx Critical Value xcv 0 z 2 x xcv 0 t 2 s x H1 : 0 DF n 1 A p-value is a measure of the credibility of the null hypothesis and is defined as the probability that a test lower low statistic or ratio as extreme as or more extreme than the observed statistic or ratio could occur, high higher assuming that the null hypothesis is true. The rule on p-value: If the p-value is less than the significance level (alpha) reject the null hypothesis. If the p-value is greater than or equal to the significance level, do not reject the null hypothesis. For the following 3 sections x x n 8.40 49 1.20 , z x 0 x 5.92 5 0.7667 1.20 a) H 0 : 5, H 1 : 5 when n 49 , x 8.40 and x 5.92 . Solution: This is a one-sided problem where the 'reject' zone is to the right. (i) Test ratio: We already know that z 0.7667 , In this right-sided problem pval Px 5.92 Pz 0.77 Pz 0 P0 z 0.77 .5 .2794 .2206 . Make diagrams. A diagram for the standardized Normal distribution has zero in the middle. For the pvalue shade the area above 0.77. We already know that is .2206. Since .2206 is above .05, do not reject the null hypothesis. A diagram for the conventional test would show a shaded 'reject' zone above z z .05 1.645 . Since 0.7667 does not fall in this region, do not reject the null hypothesis. (ii) The confidence interval has the same direction as the alternate hypothesis, so it has the form x z x 5.92 1.645 1.20 3.946 . Make a diagram. Put x 5.92 in the middle and shade the area above 3.946. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) Since we are afraid that the mean may be above 5, the critical value for the sample mean must be above 5. The formula we use is xcv 0 z x 5 1.645 1.20 6.974 . Make a diagram. Shade the area above 6.974. Since x 5.92 does not fall in this 'reject region, do not reject the null hypothesis. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) b) H 0 : 5, H 1 : 5 when n 49 , x 8.40 and x 5.92 . Solution: This is a one-sided problem where the 'reject' zone is to the left. (i) Test ratio: We already know that z 0.7667 , In this left-sided problem pval Px 5.92 Pz 0.77 Pz 0 P0 z 0.77 .5 .2794 .7206 . Make diagrams. A diagram for the standardized Normal distribution has zero in the middle. For the pvalue shade the area below 0.77. We already know that is .7206. Since .7206 is above .05, do not reject the null hypothesis. A diagram for the conventional test would show a shaded 'reject' zone below z z.05 1.645 . Since 0.7667 does not fall in this region, do not reject the null hypothesis. (ii) The confidence interval has the same direction as the alternate hypothesis, so it has the form x z x 5.92 1.645 1.20 7.894 . Make a diagram. Put x 5.92 in the middle and shade the area below 7.894. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) Since we are afraid that the mean may be below 5, the critical value for the sample mean must be below 5. The formula we use is xcv 0 z x 5 1.645 1.20 3.026 . Make a diagram. Shade the area below 3.026. Since x 5.92 does not fall in this 'reject region, do not reject the null hypothesis. c) H 0 : 5, H 1 : 5 when n 49 , x 8.40 and x 5.92 . Solution: This is a two-sided problem where the 'reject' zone is in both tails of the distribution. (i) Test ratio: We already know that z 0.7667 . In this two-sided problem, take the probability to the nearest corner and double it. pval 2Px 5.92 2Pz 0.77 2Pz 0 P0 z 0.77 2.5 .2794 2.2206 .4412 . Make diagrams. A diagram for the standardized Normal distribution has zero in the middle. For the pvalue shade the area above 0.77 and the area below -.77. We already know that is .4412. Since .4412 is above .05, do not reject the null hypothesis. A diagram for the conventional test (also with zero in the middle) would show a shaded 'reject' zone above z z.025 1.960 and a second 'reject region below z z.025 1.960 . Since 0.7667 does not fall 2 2 in these regions, do not reject the null hypothesis. (ii) The confidence interval has the form x z x 5.92 1.96 1.20 5.92 2.352 , or 3.568 to 2 8.272. Make a diagram. Put x 5.92 in the middle and shade the area between 3.568 and 8.272. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) The critical value for the sample mean has the formula xcv 0 z x . So the two critical values 2 are xcv 5 1.960 1.20 5 2.352 or 2.648 to 7.352. Make a diagram. Put 0 5 in the middle. Shade the areas below 2.648 and above 7.352 to show two 'reject regions. Since x 5.92 does not fall in either 'reject region, do not reject the null hypothesis. For the following 3 sections s x sx 8.40 1.20 , df n 1 48 , t n 49 n 1 48 n 1 48 note that t t.025 2.011 . t.05 1.677 and t 2 d) H 0 : 5, H 1 : 5 when n 49 , s x 8.40 and x 5.92 . x 0 5.92 5 0.7667 , and sx 1.20 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) Solution: This is a one-sided problem where the 'reject' zone is to the right. (i) Test ratio: We already know that t 0.7667 . In this right-sided problem 48 48 pval Px 5.92 Pt 0.77 . If we look on the t table, we find that t.25 0.680 and t.20 0.849 . This means that Pt 0.680 0.25 and Pt 0.849 0.20 . So the probability that t is above 0.77 is between .20 and .25. We can say that .20 p val .25. Make diagrams. A diagram for the t distribution has zero in the middle. For the p-value shade the area above 0.77. We already know that is between .20 and .25. Since these numbers are both .05, do not reject the null hypothesis. A diagram for the conventional test would show a shaded 'reject' zone above t t.05 1.677 . Since 0.7667 does not fall in this region, do not reject the null hypothesis. (ii) The confidence interval has the same direction as the alternate hypothesis, so it has the form x t x 5.92 1.677 1.20 3.908 . Make a diagram. Put x 5.92 in the middle and shade the area above 3.908. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) Since we are afraid that the mean may be above 5, the critical value for the sample mean must be above 5. The formula we use is xcv 0 t x 5 1.677 1.20 7.012 . Make a diagram. Shade the area above 7.012. Since x 5.92 does not fall in this 'reject region, do not reject the null hypothesis. e) H 0 : 5, H 1 : 5 when n 49 , s x 8.40 and x 5.92 . Solution: This is a one-sided problem where the 'reject' zone is to the left. (i) Test ratio: We already know that t 0.7667 , In this left-sided problem pval Px 5.92 Pt 0.77 . . We already know that the probability that t is above 0.77 is between .20 and .25. So the probability below t must be between .75 and .80. Make diagrams. A diagram for the t distribution has zero in the middle. For the p-value shade the area below 0.77. We already know that it is between .75 and .80. Since both probabilities are above .05, do not reject the null hypothesis. A diagram for the conventional test would show a shaded 'reject' zone below t t.05 1.677 . Since 0.7667 does not fall in this region, do not reject the null hypothesis. (ii) The confidence interval has the same direction as the alternate hypothesis, so it has the form x t x 5.92 1.677 1.20 7.932 . Make a diagram. Put x 5.92 in the middle and shade the area below 7.932. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) Since we are afraid that the mean may be below 5, the critical value for the sample mean must be below 5. The formula we use is xcv 0 t x 5 1.677 1.20 2.988 . Make a diagram. Shade the area below 2.988. Since x 5.92 does not fall in this 'reject region, do not reject the null hypothesis. f.) H 0 : 5, H 1 : 5 when n 49 , s x 8.40 and x 5.92 . Solution: This is a two-sided problem where the 'reject' zone is in both tails of the distribution. (i) Test ratio: We already know that t 0.7667 . In this two-sided problem, take the probability to the nearest corner and double it. pval 2Px 5.92 2Pz 0.77 . We already know that the probability that t is above 0.77 is between .20 and .25. If we double the probability, we can say that .40 p val .50. Make diagrams. A diagram for the t distribution has zero in the middle. For the p-value shade the area above 0.77 and the area below -.77. We already know that the total area is between .40 and .50. Since these probabilities are above .05, do not reject the null hypothesis. A diagram for the conventional test would show a shaded 'reject' zone above t n 1 t 48 2.011 and a 2 .025 48 second 'reject region below tn1 t.025 2.011 Since 0.7667 does not fall in these regions, do not 2 reject the null hypothesis. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) (ii) The confidence interval has the form x t x 5.92 2.0111.20 5.92 2.413 , or 3.507 to 2 8.333. Make a diagram. Put x 5.92 in the middle and shade the area between 3.507 and 8.333. Since 0 5 is in the confidence interval, do not reject the null hypothesis (iii) The critical value for the sample mean has the formula xcv 0 z x . So the two critical values 2 are xcv 5 2.0111.20 5 2.413 or 2.587 to 7.413. Make a diagram. Shade the areas below 2.587 and above 7.413 to show two 'reject regions. Since x 5.92 does not fall in either 'reject region, do not reject the null hypothesis. Exercise 9.34 [9.32 in 9th] (9.32 in 8th edition): Find the upper-tail value of the z-test statistic if the significance level is .01. From the t-table, z.01 2.327 Exercise 9.35 [9.33 in 9th] (9.33 in 8th edition): If the z statistic is 2.39, what is the statistical decision in 9.34 at the 1% significance level? Make a diagram showing a Normal curve with a mean at zero and a ‘reject’ region above 2.327. Since z calc = 2.39 is greater than z crit z .01 2.327 , reject H0. Exercise 9.36 [9.34 in 9th] (9.34 in 8th edition): Find the lower-tail value of the z-test statistic if the significance level is .01. z .01 2.327 Exercise 9.37 [9.35 in 9th] (9.35 in 8th edition): If the z statistic is -1.15, what is the statistical decision in 9.34 at the 1% significance level? Make a diagram showing a Normal curve with a mean at zero and a ‘reject’ region below -2.327. Since z calc = – 1.15 is greater than z crit z .01 2.327 and thus not in the ‘reject’ region, do not reject H0. Exercise 9.38 [9.36 in 9th] (9.36 in 8th edition): Assume that you have a one-tail hypothesis test in which you reject the null hypothesis only if the z statistic is in the upper tail and the value of the z statistic is 2.00. What is the p-value? Make a Normal curve with a mean at zero and shade the area above 2.00. p value Pz 2.00 .5 .4772 .0228 . Exercise 9.39 [9.37 in 9th] (9.37 in 8th edition): In problem 9.38, what is your decision if you test the null hypothesis at the 5% significance level? Since the p value = 0.0228 is less than = 0.05, reject H0. Exercise 9.40 [9.38 in 8th and 9th edition): Assume that you have a one-tail hypothesis test in which you reject the null hypothesis only if the z statistic is in the lower tail and the value of the z statistic is -1.38. What is the p-value? Make a Normal curve with a mean at zero and shade the area below -1.38. p value Pz 1.38 .5 .4162 .0838 . Exercise 9.41 [9.39 in 8th and 9th edition): In problem 9.40, what is your decision if you test the null hypothesis at the 1% significance level? Since the p value = 0.0838 is greater than = 0.01, do not reject H0. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) Exercise 9.42 [9.40 in 9th] (Not in 8th edition): Suppose that in a one-tail hypothesis test where you reject H 0 only in the lower tail, you compute the value of the test statistic z as 1.38, what is the p-value?’ Make a Normal curve and shade the area below 1.38. p value Pz 1.38 .5 .4162 .9162 . Exercise 9.43 [9.41 in 9th] (Not in 8th edition): In Problem 9.42, what would be your statistical decision if you tested the null hypothesis at the 0.01 level of significance? Since the p-value = 0.9162 > 0.01, we do not reject the null hypothesis. Exercise 9.44 [9.42 in 9th] (9.40 in 8th edition): If the production process is working properly, it turns out steel bars with a mean length of at least 2.8 feet with a standard deviation of 0.20 feet. You take a sample of 25 bars and the mean length is 2.73 feet. Do you need to adjust the production equipment? a) Use a critical value with .05 . (Actually, they seem to be looking for a test ratio and a traditional hypothesis test.) (a) If you use a 5% significance level, what is your decision using a critical value for the test ratio? First, you need hypotheses! The average length of steel bars produced is at least 2.8 feet and H 0 : 2.8 feet. the production equipment does not need immediate adjustment. The average length of steel bars produced is less than 2.8 feet and H 1 : 2.8 feet. the production equipment does need immediate adjustment. The facts given in the problem were .05 , n 25 , 0.20 , 0 2.8 and x 2.73 . So x n 0.2 0.04 . 25 The Test Ratio is z x 0 x x 2.8 2.73 2.8 1.75 . 0.04 0.04 This is a one sided lower tail test. Decision rule: If z calc z crit z .05 1.645 , reject H0. Decision: Since z calc = – 1.75 is less than z crit = –1.645, reject H0. There is enough evidence to conclude the production equipment needs adjustment. If you really want a critical value for x , recall xcv 0 z x . But since we have 2 H 1 : 2.8 we will use one critical value below 2.8. xcv 0 z x 2.8 1.645 0.04 2.7342 . Make a diagram with a center at 2.8 and a shaded ‘reject’ zone below 2.7342. Since x 2.73 is in the ‘reject’ zone, reject H0. (b) If you use a 5% significance level, what is your decision using a p-value? Decision rule: If p value < 0.05, reject H0. x 0 2.73 2.8 1.75 . Test statistic: z 0.04 x p value Pz 1.75 .0401 . To see this, make a diagram with a center at zero and a shaded area to the left of -1.75. Look up P1.75 z 0 on the Normal table. Then p value Px 2.73 Pz 1.75 Pz 0 P1.75 z 0 .0401 . Decision: Since p value = 0.0401 is less than 0.05, reject H0. There is enough evidence to conclude the production equipment needs adjustment. (c) Interpret the p-value. The probability of obtaining a sample whose mean is 2.73 feet or less when the null hypothesis is true is 0.0401. (d) Compare the conclusions of (a) and (b). The conclusions are the same. 252solnB2 2/13/08 (Open this document in 'Page Layout' view!) But note also the other methods for doing the problem! Critical Value Method and Test Ratio method were done above. Confidence Interval Method: x z x is the formula for a two sided confidence interval. Since the 2 alternate hypothesis is H 1 : 2.8 , this becomes 2.73 1.645 0.04 2.73 0.0658 2.7958 . Make a diagram showing a Normal curve with a mean at x 2.73 and, to represent the confidence interval, shade the area below 2.7958. Since 0 2.8 lies above the confidence interval, reject H 0 . Problem B8: I am testing the hypothesis H 0 : 5 . The result of the test is a p-value of .99. What are the p-values for H 0 : 5 and H 0 : 5 ? H : 5 Solution: The first hypothesis pair that I tested was 0 . Say that our result was x calc , and that we H 1 : 5 x 5 used it to compute t calc calc . Because this is a right – sided test the p-value is Px x calc sx Pt t calc .99 . Note that since Pt 0 .5 , t calc has to be a negative number to have a probability of 99% above it. (For example, suppose that n 11 , x 1.00000 and s x 1.44718 and we find that 1.00000 5 10 2.764 . We have 10 degrees of freedom and the t table says that t .01 2.764 . This 1.44718 means that p value Px 1.00000 Pt 2.764 .99 . ) The second hypothesis test will test t calc H 0 : 5 and give us a left-sided test, so that our p-value will be Px x calc Pt t calc .01 . (For H 1 : 5 the example with n 11 , x 1.00000 and s x 1.44718 , p value Px 1.00000 H 0 : 5 has a p-value that, for our Pt 2.764 Pt 2.764 .01 ) The third hypothesis test of H 1 : 5 example, is either 2Pt 2.764 or 2Pt 2.764 . If t has a negative value, we must pick the second of these, which is the only one that will give us a p-value between zero and 1. Our p-value will be 2Px x calc 2Pt t calc 2.01 .02 . The easiest way to show all of this is with a diagram. Make an almost Normal curve with zero in the middle and t calc to the left of zero. If the area to the right of t calc is .99, then the area to the left of t calc is .01, and the p-value for the two sided hypothesis test is Pt t calc Pt t calc .02 . (Remember that since t calc must be a negative number to have 99% above it, t calc must be a positive number. For our example p value Pt 2.764 Pt 2.764 .02 .)