Errors in Hypothesis Testing 2 TYPES OF ERRORS TRUE CASE HAis true HAis false WE Accept HA SAY Do not Accept HA CORRECT TYPE I ERROR PROB = α TYPE II ERROR CORRECT PROB = β α is set by the decision maker β varies and depends on: (1) α; (2) n; (3) the true value of Relationship Between and • is the Probability of making a Type II error – i.e. the probability of not concluding HA is true when it is • depends on the true value of • The closer the true value of is to its hypothesized value, the more likely we are of not concluding that HA is true -i.e. is large (closer to 1) • is calculated BEFORE a sample is taken – We do not use the results of a sample to calculate CALCULATING • Example: If we take a sample of n = 49, with = 4.2, “What is the probability we will get a sample from which we would not conclude > 25 when really = 25.5?” (Use = .05) REWRITE REJECTION REGION IN TERMS OF x The Hypothesis Test Accept H A if z x 25 1.645 or if 4.2 49 4.2 x 25 1.645 49 25.987 CALCULATING (cont’d) • So when = 25.5, – If we get an x > 25.987, we will correctly conclude that > 25 – If we get an x < 25.987 we will not conclude that > 25 even though really = 25.5 That’s a TYPE II ERROR!! P(Making this error) = CALCULATING (cont’d) • So what is P(not getting an x > 25.987 when really = 25.5? That is P(getting an x < 25.987)? Calculate z = (25.987 - 25.5)/(4.2/ 49) .81 • is the area to the left of .81 for a “>” test • P(Z < .81) = .7910 β “>” Test Determining When = 25.5 DO NOT ACCEPT HA WRONG ACCEPT HA Prob = =.7910 RIGHT! .7910 25.5 0 25.987 .81 X Z What is When = 27? • So what is P(not getting an x > 25.987 when really = 27? That is P(getting an x < 25.987)? Calculate z = (25.987 - 27)/(4.2/ 49) -1.69 • is the area to the left of -1.69 for a “>” test • P(Z < -1.69) = .0455 β This shows that the further the true value of is from the hypothesized value of , the smaller the value of β; that is we are less likely to NOT conclude that HA is true (and it is!) “>” Test Determining When = 27 DO NOT ACCEPT HA WRONG ACCEPT HA Prob = =.0455 RIGHT! .0455 25.987 -1.69 27 0 X Z for “<” Tests • For n = 49, = 4.2, “What is the probability of not concluding that < 27, when really is 25.5? (With = .05) The Hypothesis Test Accept H A if z x 27 1.645 or if 4.2 49 4.2 26.013 x 27 1.645 49 • This time is the area to the right of x What is When = 25.5? • So what is P(not getting an x < 26.013 when really = 25.5? That is P(getting an x > 26.013)? Calculate z = (26.013 – 25.5)/(4.2/ 49) .86 • is the area to the right of .86 for a “<” test • P(Z > .86) = 1 - .8051 = .1949 β “<” TEST Determining When = 25.5 DO NOT ACCEPT HA ACCEPT HA WRONG RIGHT! Prob = =.1949 .8051 .1949 25.5 0 26.013 .86 X Z for “” Tests • For n = 49, = 4.2, “What is the probability of not concluding that 26, when really is 25.5? (With = .05) The Hypothesis Test x 26 Accept H A if z 1.96 or 1.96 or if 4.2 49 4.2 24.824 or x 26 1.96 49 4.2 27.176 x 26 1.96 49 • This time is the area in the middle between the two critical values of x What is When = 25.5? • So what is P(not getting an x < 24.824 or > 27.176 when really = 25.5? That is P(24.824 < x < 27.176)? Calculate z’s = (24.824 – 25.5)/(4.2/ 49) -1.13 and = (27.176 – 25.5)/(4.2/ 49 ) 2.79 • is the area in between -1.13 and 2.79 for a “” test β • P(Z < 2.79) = .9974 • P(Z < -1.13) = .1292 P(-1.13 < Z < 2.79 = .9974 - .1292 = .8682 “” TEST Determining When = 25.5 ACCEPT HA DO NOT ACCEPT HA RIGHT! WRONG Prob = =.9974 – .1292 =.8682 .8682 .9974 .1292 24.824 -1.13 25.5 0 27.176 2.79 X Z The Power of a Test = 1 - • is the Probability of making a Type II error – i.e. the probability of not concluding HA is true when it is • depends on the true value of and sample size, n • The Power of the test for a particular value of is defined to be the probability of concluding HA is true when it is -- i.e. 1 - Power Curve Characteristics • The power increases with: – Sample Size, n – The distance the true value of μ is from the hypothesized value of μ Power Curves For HA: μ 26 With n = 25 and n = 49 n = 49 n = 25 α = .05 Calculating Using Excel “> Tests” Suppose H0 is = 25; = 4.2, n = 49, = .05 “>” TESTS: HA: > 25 and we want when the true value of = 25.5 1) Calculate the critical x-bar value = 25 + NORMSINV(.95)*(4.2/SQRT(49)) 2) Calculate z = (critical x-bar -25.5)/ (4.2/SQRT(49)) 3) Calculate the the probability of getting a zvalue < than this critical z value: -- this is =NORMSDIST(z) Calculating Using Excel “< Tests” Suppose H0 is = 27; = 4.2, n = 49, = .05 “< TESTS”: HA: < 27 and we want when the true value of = 25.5 1) Calculate the critical x-bar value = 27 - NORMSINV(.95)*(4.2/SQRT(49)) 2) Calculate z = (critical x-bar -25.5)/ (4.2/SQRT(49)) 3) Calculate the the probability of getting a zvalue > than the critical value: -- this is =1-NORMSDIST(z) Calculating Using Excel “ Tests” Suppose H0 is = 26; = 4.2, n = 49, = .05 TESTS: HA: 26 and we want when the true value of = 25.5 1) Calculate the critical upper x-barU value and the lower critical x-barL value = 26 - NORMSINV(.975)*(4.2/SQRT(49)) = 26 + NORMSINV(.975)*(4.2/SQRT(49)) (x-barL) (x-barU) 2) Calculate zU = (x-barU -25.5)/ (4.2/SQRT(49)) and zL = (x-barL -25.5)/ (4.2/SQRT(49)) 3) Calculate the the probability of getting an zvalue in between zL and zU - this is =NORMSDIST(zU) - NORMSDIST(zL) β for “>” Tests =B3+NORMSINV(1-B2)*(B5/SQRT(B6)) =(B8-B7)/(B5/SQRT(B6)) =NORMSDIST(B9) =1-B10 β for “<” Tests =B3-NORMSINV(1-B2)*(B5/SQRT(B6)) =(B8-B7)/(B5/SQRT(B6)) =1-NORMSDIST(B9) =1-B10 β for “” Tests =B3-NORMSINV(1-B2/2)*(B5/SQRT(B6)) =B3+NORMSINV(1-B2/2)*(B5/SQRT(B6)) =(B8-B7)/(B5/SQRT(B6)) =(B9-B7)/(B5/SQRT(B6)) =NORMSDIST(B11)-NORMSDIST(B10) =1-B12 REVIEW • • • • Type I and Type II Errors = Prob (Type I error) = Prob (Type II error) -- depends on , n and α How to calculate for: – “>” Tests – “<” Tests – “” Tests • Power of a Test at = 1- • How to calculate using EXCEL