ECO252 QBA2 SECOND HOUR EXAM In-class materials Nov 8, 2005 Exhibit 1 The director of the MBA program of a state university wanted to know if a one week orientation would change the proportion among potential incoming students who would perceive the program as being good. Given below is the result from 215 students’ view of the program before and after the orientation. Before the Orientation Good Not Good Total 1. After the Orientation Good Not Good 93 37 71 14 164 51 Total 130 85 215 Referring to Exhibit 1, which test should she use? 2 a) -test for difference in proportions b) Z-test for difference in proportions c) McNemar test for difference in proportions d) Wilcoxon rank sum test ANSWER: c TYPE: MC DIFFICULTY: Moderate KEYWORDS: McNemar test, assumption In Method D6b, the McNemar Test, we compare two proportions taken from the same sample. Assume that question 2 question 1 yes no two different questions are asked of the same group with the following responses. yes x11 x12 x no 21 x 22 question1 In this case good not question 2 good not 93 37 71 14 H 0 : p1 p 2 If we wish to test ,where p1 is the proportion saying ‘yes’ before and p 2 is the proportion H 1 : p1 p 2 x x 21 37 71 34 34 3.2717 (The test is valid only if saying ‘yes’ after, let z 12 x12 x 21 37 71 108 10 .3923 x12 x 21 10 .) 2. Referring to Exhibit 1, what is the null hypothesis? . 3. Referring to Exhibit 1, what is the value of the test statistic using a 1% level of significance? ANSWER: 3.37 or 3.37 TYPE: PR DIFFICULTY: Moderate 1 KEYWORD: McNemar test, test statistic 4. Referring to Table Exhibit 1, what is the p-value of the test statistic using a 5% level of significance? ANSWER: 0.0008 TYPE: PR DIFFICULTY: Moderate KEYWORD: McNemar test, p-value 5. Referring to Table Exhibit 1, what should be the director’s conclusion? .04 a) There is sufficient evidence that the proportion of potential incoming students who perceive the program as being good is the same before and after the orientation. b) There is insufficient evidence that the proportion of potential incoming students who perceive the program as being good is the same before and after the orientation. c) There is sufficient evidence that the proportion of potential incoming students who perceive the program as being good is not the same before and after the orientation. d) There is insufficient evidence that the proportion of potential incoming students who perceive the program as being good is not the same before and after the orientation. ANSWER: c TYPE: TF DIFFICULTY: Moderate KEYWORD: McNemar test, conclusion Exhibit 2 (Problem D7) In a study of sleep gotten with a sleeping pill and with a placebo the results were (Keller, Warren, Bartel, 2nd ed. p. 354) d x1 x2 Pill Placebo difference 7.3 6.8 .5 8.5 7.9 .6 6.4 6.0 .4 9.0 8.4 .6 6.9 6.5 .4 x1 7.620 x 2 7.120 d 0.500 s12 1.197 s 22 0.997 s d2 0.010 We want to see if the means or medians, as appropriate, are different. Assume that these are independent samples from population with a Normal distribution and that 12 22 Assume these are paired samples from a Normal distribution. 6. Referring to Exhibit 1, what should be the degrees of freedom for this test? a) DF 4 b) DF 8 c) DF 9 2 s12 s 22 n1 n 2 0.4388 2 7.9341 (Rounded to 7.) d) DF 2 2 0.2394 2 0.1994 2 s12 s 22 4 4 n1 n2 n1 1 n2 1 2 e) Degrees of freedom are irrelevant because we are using a (Mann-Whitney-) Wilcoxon rank sum test. f) Degrees of freedom are irrelevant because we are using a Wilcoxon signed rank test. g) We do not have enough information to answer this question. (You must explain what information is missing) 7. Referring to Exhibit 1, in the formula D d t sd , we should use the following. 2 a) b) c) sd sd 0.010 .002 0.447 n2 5 s s2 s d 1 2 0.4388 0.6624 n1 n 2 sˆ2p n1 1s12 n2 1s22 s d sˆ p 41.197 40.947 1.097 , which is used to compute n1 n2 2 8 1 1 1 1 1.097 0.439 0.662 n1 n 2 5 5 d) The standard error is irrelevant because we are using a (Mann-Whitney-) Wilcoxon signed rank test. e) The standard error is irrelevant because we are using a (Mann-Whitney-) Wilcoxon signed rank test. f) We do not have enough information to answer this question. (You must explain what information is missing) 8. Referring to Exhibit 1, assume that the correct alternate hypothesis is 1 2 , that use of the formula t d D0 x1 x 2 1 2 is correct, that t 2.263 and that we there are 27 sd sd degrees of freedom (Assume that all of these are correct, even though it is very unlikely!), we should do the following. 27 27 2.052 and t .01 2.473 so that the p-value is between .05 and .02. Note t .025 a) Reject the null hypothesis only if the significance level is a value below .01 b) Reject the null hypothesis if the significance level is any value below .02 c) Reject the null hypothesis if the significance level is any value above .025 d) Reject the null hypothesis if the significance is any value above .05 e) Reject the null hypothesis only if the significance level is above .10 f) None of the above. 9. Referring to Exhibit 1, assume that the correct alternate hypothesis is 1 2 , that use of the formula t d D0 x1 x 2 1 2 is correct, that t 1.877 and that there are 27 sd sd degrees of freedom (Assume that all of these are correct, even though it is very unlikely!), we should do the following. 27 27 2.052 , so that the pvalue is between .10 and .05 1.703 and t .025 Note t .05 a) Reject the null hypothesis only if the significance level is a value below .025 b) Reject the null hypothesis if the significance level is any value below .025 3 c) d) e) f) Reject the null hypothesis if the significance level is any value above .025 Reject the null hypothesis if the significance is any value above .05 Reject the null hypothesis if the significance level is any value above .10 None of the above. 10. You are having a part produced in two different machines. x1 is 201 randomly selected data points that represent the length of parts from machine one, x 2 is 501 randomly selected data points that represent the length of parts from machine two. You want to test your suspicion that parts from machine two are more variable in length than parts from machine one (This is the same as saying that machine 1 is more reliable than machine 2). Test this suspicion after stating your hypotheses. Your sample means are 25.593 inches for machine 1 and 25.592 for machine 2. Sample standard deviations are 8.379 for machine 1 and 9.293 for machine 2. Solution: H 0 : H 0 : 12 22 12 22 1 2 or . In terms of the variance ratio or , the alternate 22 12 H 1 : 12 22 H 1 : 1 2 hypothesis rules, so H 0 : 22 12 1 and H 1 : 22 12 1. Since you are comparing variances, use Method D7. Compare the ratio s 22 s12 against F . 2 s22 9.293 1.230 . This has the F distribution with 500 and 200 degrees of freedom. From s12 8.379 the table F 500, 200 1.22 . Since the computed F is larger than the table F, reject the null .05 hypothesis. 11. You are having a part produced in two different machines. x1 is 101 randomly selected data points that represent the length of parts from machine one, x 2 is 126 randomly selected data points that represent the length of parts from machine two. You want to test your suspicion that parts from machine one are more variable in length than parts from machine two (This is the same as saying that machine 2 is more reliable than machine 1). Test this suspicion after stating your hypotheses. Your sample means are 25.593 inches for machine 1 and 25.592 for machine 2. Sample standard deviations are 8.379 for machine 1 and 6.964 for machine 2. Solution: H 0 : H 0 : 22 12 2 2 2 1 or . In terms of the variance ratio 12 or 22 , the alternate 2 1 H 1 : 22 12 H 1 : 2 1 hypothesis rules, so H 0 : 12 22 1 and H 1 : 12 22 1. Since you are comparing variances, use Method D7. Compare the ratio s 22 s12 against F . 2 s12 8.379 1.453 . This has the F distribution with 100 and 125 degrees of freedom. From s22 6.964 the table F 100,125 1.36 . Since the computed F is larger than the table F, reject the null .05 hypothesis. 4 12. (Extra credit) compute a confidence interval for the ratio of the two variances in the previous problem. Solution 1: From the outline 22 s 22 ( n1 1, n2 1) s22 9.293 F . 2 1.230 has s1 8.379 s12 Fn2 1,n1 1 12 s12 2 s 22 2 1 2 the F distribution with 500 and 200 degrees of freedom. So, 2 ( 200, 500) 500, 200 1.27 , F 200,500 must be between . F.025 .025 500, 200 2 1.230 F.025 F.025 1 F 200,400 1.27 and F 200,1000 1.23 , probably about 1.26. The interval thus becomes 1.230 2 1 .025 .025 1.230 22 2 1 2 1.230 1.26 or 0.968 22 1.55 . 1.27 1 1 Solution 2: From the outline s12 s 22 12 s12 ( n2 1, n1 1) s12 8.379 F . 2 1.453 s2 6.964 F n1 1, n2 1 22 s 22 2 2 1 2 has the F distribution with 100 and 125 degrees of freedom. (125, 100) 100,125 1.45 . F 125,100 must be between 12 1.453 F.025 F.025 . .025 100,125 2 F.025 F 100,100 1.48 and F 200,100 1.42 , probably about 1.46. The interval thus becomes 1.453 2 1 .025 .025 1.453 1 1.45 12 22 1.453 1.46 or 1.00 12 22 2.12 . 13. A researcher randomly samples female (Sample 1) and male graduates of an MBA program. The figures represent starting salaries. The Minitab command used here is a pull-down command that is equivalent to the two-sample command that you used. MTB > TwoT 18 48266.7 13577.63 12 55000 11741.29; SUBC> Alternative -1. Two-Sample T-Test and CI Sample 1 2 N 18 12 Mean 48267 55000 StDev 13578 11741 SE Mean 3200 3389 Difference = mu (1) - mu (2) Estimate for difference: -6733.30 95% upper bound for difference: 1229.26 T-Test of difference = 0 (vs <): T-Value = -1.44 DF = 25 P-Value = 0.081 a) Turn in your first computer assignment only. (2) b) For this assignment make 3 curves with centers at zero and with the t ratio marked by a vertical line. Indicate, using the three diagrams and information from the printout, what the p-value would be if the null hypothesis was pvalue 1 .081 .919 (i) H 0 : 1 2 (ii) H 0 : 1 2 pvalue .081 pvalue 2.081 .161 (iii) H 0 : 1 2 Give me a number for the p-value. Diagram: It says T-Value = -1.44 so make three diagrams with an almost Normal curve and a mean at zero. (i) .919 is the area above -1.44, (ii) .081 is the area below -.144, (iii) .161 is the area above +1.44 and the area below -1.44. (1.5) 5 c) Using the style that I use for null hypotheses, which of the three hypotheses in b) is the null hypothesis used here and would it be rejected if the confidence level was .05? (1) Solution: It says T-Test of difference = 0 (vs <). This says H 1 : 1 2 , so the null hypothesis is H 0 : 1 2 . P-value is above .05, so do not reject the null hypothesis. d) Nothing in the command told Minitab which method to use. Of the four methods you learned to compare two means, which one did Minitab use. Solution: D3. A real estate company is comparing the amount of time people live in Smallville (Sample 1) with the amount of time they live in Metropolis (Sample 2). The figures here indicate duration in months. The Minitab command used here is a pull-down command that is equivalent to the twosample command that you used. MTB > TwoT 100 35 30 150 50 32.4037; SUBC> Alternative -1. Two-Sample T-Test and CI Sample 1 2 N 100 150 Mean 35.0 50.0 StDev 30.0 32.4 SE Mean 3.0 2.6 Difference = mu (1) - mu (2) Estimate for difference: -15.0000 95% upper bound for difference: -8.3931 T-Test of difference = 0 (vs <): T-Value = -3.75 DF = 223 P-Value = 0.000 a) Turn in your first computer assignment only. (2) b) For this assignment make 3 curves with centers at zero and with the t ratio marked by a vertical line. Indicate, using the three diagrams and information from the printout, what the p-value would be if the null hypothesis was (i) H 0 : 1 2 pvalue 1 0 1 (ii) H 0 : 1 2 pvalue 0 pvalue 20 0 (iii) H 0 : 1 2 Give me a number for the p-value. Diagram: It says T-Value = -3.75 so make three diagrams with an almost Normal curve and a mean at zero. (i) 1 is the area above -3.75, (ii) 0 is the area below -3.75, (iii) 0 is the area above +3.75 and the area below -3.75. (1.5) c) Using the style that I use for null hypotheses, which of the three hypotheses in b) is the null hypothesis used here and would it be rejected if the confidence level was .05? (1) Solution: It says T-Test of difference = 0 (vs <). This says H 1 : 1 2 , so the null hypothesis is H 0 : 1 2 . P-value is below .05, so reject the null hypothesis. d) Nothing in the command told Minitab which method to use. Of the four methods you learned to compare two means, which one did Minitab use? Solution: D3. 14. Problem 10.13 b in text. The manager suspects that the amount of stuff going into cans packed by machines 1 and 2 is different. Assume that variances are equal. x1 8.005 x 2 7.997 s1 0.012 s 2 0.005 n1 11 n2 16 H0: 1 2 1 2 where Populations: 1 = Line A, 2 = Line B H1: Decision rule: DF. = 12. If |t| > 2.1788, reject H0. 6 Test statistic: t X 1 X 2 1 2 S12 S22 n1 n2 8.005 7.997 0 0.0122 0.0052 11 16 2.0899 0.012 2 0.005 2 .00000156 .0000131 16 11 Since t = 2.0899 < 2.1788 or p-value = 0.0586 > 0.05, do not reject H0. There is not sufficient evidence of a difference in the mean weight of cans filled on the two lines. The following problem is an easier version of a problem in the text. Revised version 1: A pet food canning factory produces 8 oz cans of cat food. The manager suspects that the amount of cat food put into the cans by machine 1 is significantly larger than that put in by machine 2. A sample of output is taken with the results below. x1 8.005 x 2 7.997 s1 0.048 s 2 0.015 n1 176 n 2 144 a) What are the managers’s null and alternate hypotheses? d D0 b) You will use a test ratio of the form to test the hypothesis. Find s d . sd Warning: Be accurate! s d2 is roughly the size of .0000175. If you start rounding excessively, your answers will be completely wrong. If you absolutely cannot do this section, say so and use .000175, which is very wrong. c) Compute the test ratio and find a p-value for your result. d) If the manager had, instead, suspected that a larger amount was going into cans filled by machine 2, what would the p-value be? Solution: a) H 1 : 1 2 , so H 0 : 1 2 . Note: d 8.005 7.997 0.008 0.015 2 .00000156 144 s12 s 22 n1 n1 b) 0.048 2 .0000131 176 0.048 2 0.015 2 .0000131 .00000156 .0000147 .003828 176 144 sd 8.005 7.997 2.0899 pvalue Pz 2.09 .5 .4817 .0183 .003828 d) 1-.0183 = .9817. Revised version 2: A pet food canning factory produces 8 oz cans of cat food. The manager suspects that the amount of cat food put into the cans by machine 2 is significantly larger than that put in by machine 1. A sample of output is taken with the results below. x1 8.012 x 2 8.020 s1 0.048 s 2 0.015 n1 176 n 2 144 a) What are the managers’s null and alternate hypotheses? d D0 b) You will use a test ratio of the form to test the hypothesis. Find s d . sd c) z Warning: Be accurate! s d2 is roughly the size of .0000175. If you start rounding excessively, your answers will be completely wrong. If you absolutely cannot do this section, say so and use .000175, which is very wrong. c) Compute the test ratio and find a p-value for your result. d) If the manager had, instead, suspected that a larger amount was going into cans filled by machine 1, what would the p-value be? Solution: a) H 1 : 1 2 , so H 1 : 1 2 Note: d 8.012 8.020 0.008 7 b) 0.048 2 .0000131 176 0.015 2 .00000156 s d 144 s12 s 22 n1 n1 0.048 2 0.015 2 .0000131 .00000156 .0000147 .003828 176 144 8.012 8.020 2.0899 pvalue Pz 2.09 .5 .4817 .0183 .003828 d) 1-.0183 = .9817. c) z 8 15. Problem 12.53 in text. Over 104 weeks, the following number of mortgages were approved by a bank. Do the results below follow a Poisson distribution? H0 : The number of commercial mortgages approved per week follows a Poison distribution. H1 : The number of commercial mortgages approved per week does not follow a Poison distribution. 7 X Use m j 1 j fj n 2.1058 219 2.1058 104 Number Approved/Week 0 1 2 3 4 5 6 7 8 or more Total 13 25 32 17 9 6 1 1 0 104 Combine the last three classes: Number Approved/Week 0 1 2 3 4 5 6 or more Total 2 k p 1 k f0 fe fe f0 f0 13 25 32 17 9 6 2 104 P X mj f j fe 0.121752 0.256382 0.269940 0.189477 0.099749 0.042010 0.014744 0.004435 0.001511 1.000000 0 25 64 51 36 30 6 7 0 219 fe 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 2.15181 104 f0 fe 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 1.533351 0.461269 0.15719 104 2 / fe 0.009011434 0.103805808 0.549095235 0.371491012 0.181951945 0.608872099 0.010710218 1.834937752 2 1.8349 2 2 crit 5,0.01 =15.0863 Since 1.8349 < 15.0863, do not reject H0. At the 1% level of significance, there is not enough evidence to reject the null hypothesis that the distribution of commercial mortgages approved per week follows a Poisson distribution. 9 Revised version 1: Over 104 weeks, the following numbers of mortgages were approved by a bank. Do the results below follow a Poisson distribution? a) Find the average number of mortgages approved per week? Hint: The original version of the problem came up with a mean of 2.1058 approvals per week. You will come out with something closer to a mean that you actually can find in your tables (1) b) If the data followed an appropriate Poisson distribution exactly, what would the numbers of weeks be with 0, 1, 2, 3, 4, 5, 6, 7 and 8 or more approvals be? (3) c) Use a statistical test to compare the number of actual approvals with the distribution you found in the last section. (3) d) If all this sounds like too much work, guess the mean and compare the observed data with a Poisson distribution with the mean that you guessed. Do not use a Chi-squared method in d. (5) Number Approved x 0 1 2 3 4 5 6 7 8 or more Total Number Approved/Week 0 1 2 3 4 5 6 7 8 or more Total mean O 13 25 31 17 8 5 1 1 0 104 f0 16 25 31 17 8 5 1 1 0 104 xO 0 25 62 51 32 25 6 7 0 208 mj f j 0 25 62 51 32 25 6 7 0 208 P X fe 0.121752 0.256382 0.269940 0.189477 0.099749 0.042010 0.014744 0.004435 0.001511 1.000000 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 1.533351 0.461269 0.15719 104 208 2 104 Combine the last three classes: Number Approved/Week 0 1 2 3 4 5 6 or more Total f0 16 25 31 17 8 5 1 104 fe 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 2.15181 104 f0 fe 2 / fe 0.009011434 0.103805808 0.549095235 0.371491012 0.181951945 0.608872099 0.010710218 1.834937752 10 2 k p 1 k f0 fe fe 2 1.8349 2 2 crit 5,0.01 =15.0863 Since 1.8349 < 15.0863, do not reject H0. At the 1% level of significance, there is not enough evidence to reject the null hypothesis that the distribution of commercial mortgages approved per week follows a Poisson distribution. 11 Revised version 2: Over 105 weeks, the following numbers of mortgages were approved by a bank. Do the results below follow a Poisson distribution? a) Find the average number of mortgages approved per week? Hint: The original version of the problem came up with a mean of 2.1058 approvals per week. You will come out with something closer to a mean that you actually can find in your tables (1) b) If the data followed an appropriate Poisson distribution exactly, what would the numbers of weeks be with 0, 1, 2, 3, 4, 5, 6, 7 and 8 or more approvals be? (3) c) Use a statistical test to compare the number of actual approvals with the distribution you found in the last section. d) If all this sounds like too much work, guess the mean and compare the observed data with a Poisson distribution with the mean that you guessed. Do not use a Chi-squared method in d. Number Approved x 0 1 2 3 4 5 6 7 8 or more Total O 23 24 30 16 6 4 1 1 0 105 Number Approved/Week 0 1 2 3 4 5 6 7 8 or more Total mean xO 0 24 60 48 24 25 6 7 0 189 f0 23 24 30 16 6 4 1 1 0 105 mj f j 0 24 60 48 24 25 6 7 0 189 P X fe 0.121752 0.256382 0.269940 0.189477 0.099749 0.042010 0.014744 0.004435 0.001511 1.000000 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 1.533351 0.461269 0.15719 104 189 1.80 105 Combine the last three classes: Number Approved/Week 0 1 2 3 4 5 6 or more Total f0 16 25 31 17 8 5 1 104 fe 12.66221 26.66368 28.07378 19.70564 10.37388 4.369 2.15181 104 f0 fe 2 / fe 0.009011434 0.103805808 0.549095235 0.371491012 0.181951945 0.608872099 0.010710218 1.834937752 12 2 k p 1 k f0 fe fe 2 1.8349 2 2 crit 5,0.01 =15.0863 Since 1.8349 < 15.0863, do not reject H0. At the 1% level of significance, there is not enough evidence to reject the null hypothesis that the distribution of commercial mortgages approved per week follows a Poisson distribution. 13 Chi-squared Computations ————— 11/8/2005 11:59:53 PM ———————————————————— Welcome to Minitab, press F1 for help. MTB > #Version 1 MTB > WOpen "C:\Documents and Settings\rbove\My Documents\Minitab\notmuch.MTW". Retrieving worksheet from file: 'C:\Documents and Settings\rbove\My Documents\Minitab\notmuch.MTW' Worksheet was saved on Thu Apr 14 2005 Results for: notmuch.MTW MTB > Execute "C:\Documents and Settings\rbove\My Documents\Minitab\252chisq.mtb" 1. Executing from file: C:\Documents and Settings\rbove\My Documents\Minitab\252chisq.mtb Data Display Row 1 2 3 4 5 6 O 16 25 31 17 8 7 E 14.0748 28.1498 28.1498 18.7665 9.3833 5.4758 D -1.92516 3.14978 -2.85022 1.76649 1.38330 -1.52419 Dsq 3.70624 9.92114 8.12373 3.12048 1.91351 2.32316 Dsq/E 0.263324 0.352441 0.288589 0.166279 0.203927 0.424259 Osq/E 18.1885 22.2027 34.1388 15.3998 6.8206 8.9485 Data Display n ne sumD chisq1 chisq K6 104.000 104.000 0.000000000 1.69882 1.69882 105.699 MTB > print c2 c7 Data Display Row 1 2 3 4 5 6 E 14.0748 28.1498 28.1498 18.7665 9.3833 5.4758 f 0.135335 0.270671 0.270671 0.180447 0.090224 0.052652 Results for: 252x0506-11.MTW MTB > WSave "C:\Documents and Settings\rbove\My Documents\Minitab\252x050611.MTW"; SUBC> Replace. Saving file as: 'C:\Documents and Settings\rbove\My Documents\Minitab\252x0506-11.MTW' 14 MTB > #version 2 MTB > exec '252chisq' Executing from file: 252chisq.MTB Data Display Row 1 2 3 4 5 6 O 23 24 30 16 6 6 E 17.3564 31.2415 28.1173 16.8705 7.5917 3.8226 D -5.64361 7.24149 -1.88268 0.87045 1.59171 -2.17737 Dsq 31.8503 52.4392 3.5445 0.7577 2.5335 4.7409 Dsq/E 1.83507 1.67851 0.12606 0.04491 0.33372 1.24023 Osq/E 30.4787 18.4370 32.0087 15.1745 4.7420 9.4176 Data Display n ne sumD chisq1 chisq K6 105.000 105.000 0.000000000 5.25851 5.25851 110.259 MTB > print c2 c7 Data Display Row 1 2 3 4 5 6 E 17.3564 31.2415 28.1173 16.8705 7.5917 3.8226 f 0.165299 0.297538 0.267784 0.160671 0.072302 0.036406 Results for: 252x0506-12.MTW MTB > WSave "C:\Documents and Settings\rbove\My Documents\Minitab\252x050612.MTW"; SUBC> Replace. Saving file as: 'C:\Documents and Settings\rbove\My Documents\Minitab\252x0506-12.MTW' 15