AMS 572 Lecture Notes #5 September 19, 2013 <Today’s Topic> Power Calculation (Inference on one population mean) Truth H0 Decision Ha Type II error H0 Type I error Ha = P(Type II error) = P(Fail to reject H 0 | H a ) ⑦ Power Calculation (Inference on one population mean) 1. H 0 : 0 H a : 0 ( a 0 ) 1st scenario, Normal population, 2 is known. Test statistic : Z 0 X 0 n H0 ~ N (0,1) At the significance level , we reject H 0 if Z 0 Z Power of the test = P(reject H 0 | H a ) = 1- Power = 1- = P(reject H 0 | H a ) = P( Z 0 Z | a ) = P( X 0 n Z | a ) , If a , Z 0 X 0 n ~ N( a 0 ,1) n 1 = P( X a n = P( Z Z a 0 Z | a ) n a 0 | a ) , n Z ~ N (0,1) 2nd scenario, Normal population, 2 is unknown. Test statistic : T0 X 0 S n H0 ~t n 1 At the significance level , we reject H 0 if T0 t n 1, Power of the test = P(reject H 0 | H a ) = 1- Power = 1- = P(reject H 0 | H a ) = P( T0 t n 1, | a ) = P( X 0 S n t n1, | a ) = P( = P(T t n 1, a 0 S n X a S n a 0 S n t n1, | a ) | a ) , Here T ~ t n1 2 Recall that the Shapiro-Wilk test: can be used to determine whether the population is normal. 3rd scenario, Any population (*usually we use this test when the population is found not normal), large sample (n 30 ) Test statistic : Z 0 X 0 S n H0 ~ N (0,1) At the significance level , we reject H 0 if Z 0 Z Power of the test = P(reject H 0 | H a ) = 1- Power = 1- = P(reject H 0 | H a ) = P( Z 0 Z | a ) = P( X 0 S n Z | a ) = P( = P( Z Z a 0 S n X a | a ) , S n a 0 S n Z | a ) Z ~ N (0,1) 3 2. H 0 : 0 H a : 0 ( a 0 ) 1st scenario, Normal population, 2 is known. Test statistic : Z 0 X 0 n H0 ~ N (0,1) At the significance level , we reject H 0 if Z 0 Z Power = P(reject H 0 | H a ) = P( Z 0 Z | a ) = P( X 0 n = P( Z Z | a ) = P( X a a 0 Z | a ) , n n a 0 Z | a ) n Z ~ N (0,1) 4 The derivation of the remaining two scenarios is very similar to that of the first pair of hypotheses too and is thus omitted. 3. H 0 : 0 H a : a 0 1st scenario, Normal population, 2 is known. Test statistic : Z 0 X 0 n H0 ~ N (0,1) At the significance level , we reject H 0 if Z 0 Z 2 Power = P(reject H 0 | H a ) = P( ( Z 0 Z 2 | a ) = P( Z 0 Z 2 | a ) P( Z 0 Z 2 | a ) = P( X a n a 0 X a a 0 Z 2 | a ) P( Z 2 | a ) n n n = P( Z Z 2 a 0 0 | a ) P( Z Z 2 a | a ) n n 5 (*Without loss of generality, for the plot below, we assume a 0 ) The derivation of the remaining two scenarios is very similar to that of the first pair of hypotheses too and is thus omitted. Ex1) Jerry is planning to purchase a sports goods store. He calculated that in order to make profit, the average daily sales must be $525 . He randomly sampled 36 days and found X $565 and S $50 . If the true average daily sales is $550, what is the power of Jerry’s test at the significance level of 0.05? H 0 : 0 525 H a : a 550 0 Sol) Power = P(Reject H 0 | H a ) P( Z 0 Z | a ) P( P( X 0 S n X a S n Z | a ) Z P ( Z 1.645 a 0 S n 550 525 50 36 | a ) ) P( Z 1.355) 0.91 6 Ex2) John Pauzke, president of Cereal’s Unlimited Inc, wants to be very certain that the mean weight of packages satisfies the package label weight of 16 ounces. The packages are filled by a machine that is set to fill each package to a specified weight. However, the machine has random variability measured by 2 . John would like to have strong evidence that the mean package weight is about 16 oz. George Williams, quality control manager, advises him to examine a random sample of 25 packages of cereal. From his past experience, George knew that the weight of the packages follows a normal distribution with standard deviation 0.4 oz. At the significance level 0.05 , (a) What is the decision rule (rejection region) in terms of the sample mean X ? (b) What is the power of the test when 16.13 oz? Sol) Let X denote the weight of a randomly selected package of cereal, then X ~ N ( 16, 0.4) H 0 : 16 H a : 16 H 0 : 16 H : 16 a (a) Test Statistic : Z 0 X 0 n H0 ~ N (0,1) if 0 16 P( Z 0 c | H 0 ) c Z We reject H 0 at 0.05 if Z0 X 0 n Z X 0 Z n 16 1.645 0.4 25 16.1316 (oz) H 0 : 0 16 (b) H a : a 16.13 0 (n=25) Power = P(Reject H 0 | H a ) 7 P( Z 0 Z | a ) P( P( X 0 n X a n Z | a ) Z P( Z 1.645 a 0 | a ) n 16.13 16 0.4 25 ) P( Z 0.02) 0.49 Ex3) The seven scores listed below are axial loads (in pounds) for a random sample of 7 12-oz aluminum cans manufactured by ALUMCO. An axial load of a can is the maximum weight supported by its sides, and it must be greater than 165 pounds, because that is the maximum pressure applied when the top lid is pressed into place. 270, 273, 258, 204, 254, 228, 282 (1) As the quality control manager, please test the claim of the engineering supervisor that the average axial load is greater than 165 pounds. Use 0.05 . What assumptions are needed for your test? (2) Please write a SAS program to do part (a). Sol) H 0 : 165 H a : 165 (1) Assume the distribution is normal. T0 X 0 S n H0 ~ t n1 At the significance level of 0.05 , we reject H 0 in favor of H a if T0 t n 1, T0 87.7 27.6 7 CI : X t n 1, 2 8.9 1.943 : We reject H 0 S n 8 (2) data cans ; input pressure @@ ; newvar = pressure – 165; datalines ; 270 273 258 204 254 228 282 ; run ; proc univariate data=cans normal ; var newvar ; run ; Ex4) To determine whether glaucoma affects the corneal thickness, measurements were made in 8 people affected by glaucoma in one eye but not in the other. The corneal thickness (in microns) were as follows: Person Eye affected Eye not affected 1 488 484 2 478 478 3 480 492 4 426 444 5 440 436 6 410 398 7 458 464 8 460 476 (a) According to the data, can you conclude, at the significance level of 0.10, that the corneal thickness is not equal for affected versus unaffected eyes? Please first derive the general formula for the test for the given scenario based on a sample size of n and a significance level of α. (b) Calculate a 90% confidence interval for the mean difference in thickness. Please first derive the general formula for the confidence interval for the given scenario based on a sample size of n and a confidence level of 1-α. (c) Please write the entire SAS code to check the assumptions necessary in (a) and to perform the test asked for in (a). (*Part C was not given as part of the quiz today.) Note: For the general derivation of (a) and (b), please refer to your lecture notes #4. Solution: (a) Using d 4 and s d 10.744 , the test statistic is t d 0 sd n 40 10.744 8 1.053 Since t t81,0.05 1.895 , we can NOT reject H 0 at 0.10 . That is, we do NOT have enough evidence to support the claim that the average corneal thicknesses are affected by glaucoma. 9 (b) A 90% CI for 1 2 is given by d tn1, 2 sd n 4 1.895 10.744 8 That is, [11.198, 3.198] (c) The SAS code is as follows. Data eyes; Input bad good; Diff=bad-good; Datalines; 488 484 478 478 480 492 426 444 440 436 410 398 458 464 460 476 ; Run; Proc univariate data = eyes normal; Var diff; Run; ***Alternatively, we can enter the data as follows: Data eyes; Input bad good @@; Diff=bad-good; Datalines; 488 484 478 478 480 492 426 444 440 436 410 398 458 464 460 476 ; Run; Note: Dear students, please install SAS, R and G*Power (***Go to Google and type: GPower – you will be given the link to the free download site) on your computers. Homework #3: (*Expected to be done before our lecture next Thursday. Solutions will be posted by next Tuesday.) From our text book by Tamhane and Dunlop. Chapter 7: 7.1, 7.4, 7.6, 7.7, 7.10, 7.11, 7.13, 7.15, 7.17 You have only learned part of the methods relevant to this homework. So please do not be anxious if you can not answer all the questions right now. You will, after Tuesday. 10