Day 8-3 Prakash Balachadra Departmet of Mathematics & Statistics Bosto Uiversity Friday, October 8, 011 Sectio 5.: Hypothesis Tests forµ Aoucemets: Tutorig: Math office i 111 Cummigto 1st floor, Rich Hall. Away week of November 13. Xiyi will fill i. Cheat sheet - 1 pg, sigle sided. Office hours ext Friday moved to ext Wedesday so you guys ca ask me questios before the exam. 3.: Usigp-values (σ kow) 1. Assume that, (a) The sample is obtaied usig simple radom samplig, (b) The sample has o outliers ad the populatio from which the sample is draw is ormally distributed or that 30.. Step 1: Determie if the test is a two, left, or right-tailed test. 3. Select a level of sigificaceαbased o the seriousess of makig a Type I error, ad compute if left or right-tailed orp ] Z > zα if two-tailed. 4. Compute 5. If, PZ > z α ] = α, Z N(0,1) z 0 = X µ 0 σ/ which is the umber of stadard errors the sample mea X is from the ull hypothesis mea µ 0. (a) (two-tailed)pz > z 0 ] < α reject the ull hypothesis. (b) (left-tailed)pz < z 0 ] < α reject the ull hypothesis. 1
(c) (right-tailed)pz > z 0 ] < α reject the ull hypothesis. Thesep-values quatify the probability that a sample will result i a sample mea such as the oe obtaied if the ull hypothesis is true. Thus, we reject the ull hypothesis if thep-value is too small (so that it s very ulikely that we got the sample mea we did assumig the ull hypothesis is true) ad so yields the exact sigificace of the data. (σ ukow) 1. Assume that, (a) The sample is obtaied usig simple radom samplig, (b) The sample has o outliers ad the populatio from which the sample is draw is ormally distributed or 30.. Step 1: Determie if the test is a two, left, or right-tailed test. 3. Select a level of sigificaceαbased o the seriousess of makig a Type I error, ad compute if left or right-tailed orp ] Z > zα if two-tailed. 4. Compute 5. If, Examples: PZ > t α ] = α, Z tdist( 1) t 0 = X µ 0 s/ is the umber of sample stadard errors away X is from µ 0. (a) (two-tailed)pz > t 0 ] < α reject the ull hypothesis. (b) (left-tailed)pz < t 0 ] < α reject the ull hypothesis. (c) (right-tailed)pz > t 0 ] < α reject the ull hypothesis. A egieer wats to measure the bias i a ph meter. She uses the meter to measure the ph i 14 atural substaces ad obtais the followig data, 7.01, 7.04, 6.97, 7.00, 6.99, 6.97, 7.04, 7.04, 7.01, 7.00, 6.99, 7.04, 7.07, 6.97. Is there sufficiet evidece to support the claim that the ph meter is ot correctly calibrated at α = 0.05? Solutio: The data s free of outliers ad approximately ormal, so we re good. This is a two-tailed test. µ 0 = 7.0, X = 7.01, s = 0.03, = 14. t 0 = X µ 0 s/ = 7.01 7.0 0.03/ 14 = 1.1693. So, PZ > t 0 ] = PZ > t 0 ] + PZ < t 0 ] = PZ > t 0 ] = PZ > 1.1693] = 0.1316 = 0.633.
0.8 0.75 0.7 0.65 0.6 0.55 6.97 6.98 6.99 7 7.01 7.0 7.03 7.04 7.05 7.06 7.07 7.07 7.06 7.05 7.04 7.03 7.0 7.01 7 6.99 6.98 6.97 1 3
Sice 0.633 > 0.05, we caot reject the ull hypothesis, so that with a 5% level of sigificace, the ph meters are calibrated correctly. I this example, we kow the exact level of sigificace i the data, amely 35%. This is the smallest level of sigificace we eed i order to still reject H 0. 3.3: Aalysis ad Coclusios of the Hypothesis Tests (Power) Whe performig hypothesis testig, we cotrolαby prescribig it outright, where recall that, α = PType I Error] = PReject H 0 H 0 True]. β = PType II Error] = PAccept H 0 H 1 True]. β o the other had is difficult to cotrol sice it depeds o several factors. Oe of these parameters isαitself, β = PH 0 True H 1 True] = PH 1 True H 0 True] PH 0 True] PH 1 True] = (1 α) PH 0 True] PH 1 True] Thus, icreasigαdecreases β, so that oe must weight the choice of a smallerβ, which is desirable, with a larger level of sigificace,α, which is udesirable. The power of a test is defied to be the ability of the test to detect or reject a false ull hypothesis. Quatitatively, it s defied by, Power = 1 β = PReject H 0 H 0 False] = PReject H 0 H 1 True]. As power icreases, β decreases, resultig i a better test (lower type II error). Power is a complicated fuctio of three variables: 1. =Sample Size,. α=level of Sigificace=PType I Error], 3. ES=The Effect Size=The stadardized differece i meas specified uder H 0 ad H 1 defied by, ES = µ 0 µ 1. σ As such, we ll focus oly o the case where σ is kow. Let s ivestigate the effect of each of these parameters o power. 4
Figure 1: X uderh0 with mea µ 0 = 100. Figure : X uderh0 with mea µ 0 = 100 ad H 1 withµ 1 = 110. 5
Figure 3: X uderh0 ad H 1 withα = 0.05. 6
Figure 4: Chagigαto0.1 fixigµ 1 = 110. Figure 5: Chagig µ 1 to 10 with fixig α = 0.05. All pictures from D Agostio et al. 7
The last effect is chagig the sample size, but we ve doe this before: a larger sample size esures a more powerful test. Let s compute the power= 1 β where, for ow, we re cosiderig a right-tailed test. Recall that z α is defied by, PZ > z α ] = α where Z = X 0 µ 0 σ/. Thus, ] X0 µ 0 P σ/ > z α = α P X 0 > σ ] z α +µ 0 = α ad so x α = σ z α +µ 0 i the above picture. Now, X 1 = σ Z +µ 1 so that, 1 β = P X1 > x α ] = P σ Z +µ 1 > σ z α +µ 0 ] Sice this is a right-tailed test,µ 1 > µ 0 so that 1 β = P Z > z α µ ] 1 µ 0 1 β = P Z > z α µ ] 1 µ 0 We ca repeat similar argumets for the left-tailed ad two-tailed tests, obtaiig the followig formulae for power: 1. For a two-sided test:. For a oe-sided test (left or right) Examples: Power = P Z > zα µ ] 0 µ 1 Power = P Z > z α µ ] 0 µ 1 8
(# 9) We wish to test the hypothesis that the mea weight for females who are 5 8 is 140 pouds. Assumig σ = 15 usig a 5% level of sigificace with = 36, fid the power of the test ifµ = 150 usig a two-sided test. Solutio: Sice this is two-tailed test, Power = P Z > zα µ ] 0 µ 1 µ 0 = 140,µ 1 = 150, = 36, σ = 15. zα = z 0.05 = 1.96, so that Power = P Z > 1.96 140 150 ] 15/ = PZ >.04] = 1 PZ <.04] = 1 0.007 = 0.9793. 36 (Sample Size Determiatio) Take agai the right-tailed test. We have from the computatio of power, This defies, Sicez β = z 1 β, so that, 1 β = P Z > z α µ ] 0 µ 1 z 1 β = z α µ 0 µ 1 σ/. z β = z α µ 0 µ 1 σ/ = z α ES = z α +z β ES = ( ) zα +z β. ES The same ca be doe for the left-tailed ad two-tailed tests, so that we have the followig formulae for sample-size determiatio, 1. For a two-tailed test,. For a oe-sided test, it s give by, ( z α = +z ) β. ES Example: = ( ) zα +z β. ES 9
We wish to ru the followig test:, H 0 : µ = 100 H 1 : µ 100 at α = 0.1. Ifσ = 0, how large of a sample would be required so that β = 0.04 ifµ = 10? Solutio: This is a two-tailed test. ES = µ 0 µ 1 σ = 100 10 0 = 0.1. Sice α = 0.1 ad β = 0.04, ( z α = +z ) ( ) ( ) β z0.05 +z 0.04 1.645+1.755 = = = 34. ES 0.1 0.1 Note: I looked upz 0.05 ad z 0.04 i the z-table. 10