Transcript Document
Chapter 11 • Z Tests • Type I and II errors • Power Pizza Delivery • Pines Pizza claims that on average they deliver in 20 min or less. • Design an experiment to test their claim. • Remember your three principles of experimental design( control, replication, randomization. • What would constitute sufficient evidence that they are wrong in their claim. • Your group has 10 minutes. Pizza Delivery • FACTS…. • Claim is 20 minutes or less. So the true mean is assumed to be u = 20 • Lets use 1.5 minutes as the true standard deviation • We need a sample mean from our experiment that we can use as evidence against the claim. Pizza Delivery • FACTS…. • Choose a sample mean that is greater than 20 minutes but not too much greater. • Also choose a sample size, how many deliveries do you think is necessary to test this claim. Pizza Delivery • FACTS…. • Claim is 20 minutes or less. Ho: u = 20 • If you were going to argue the claim you are saying it is over 20 minutes Ha: u > 20 Conclusions • The whole idea is to make the correct conclusion. • There are 2 scenarios based on your p-value. • The sample mean drives your pvalue and conclusion…..use your brain!!! • This p-value is low enough to reject Ho at the ____ level. • This is evidence to suggest that pines pizza may have a mean delivery time of more than 20 min. • This p-value is too high to reject Ho at the ____ level. • There is not enough evidence to suggest that pines pizza may have a mean delivery time of more than 20 min. Check Your Pulse • Most peoples pulse rate ranges from 70 to 100 beats per minute. • A previous study gave a mean of 73 and standard deviation 11. • Let’s see how our pulse rates compare to these. • Let’s use the following Hypothesis Ho: μ = 73 vs Ha: μ ≠ 73, where μ is the true mean pulse rate for our class today. We will also use the standard deviation from the previous study σ=11 How to take your pulse • Place 2 fingers on your other wrist and count the beats for 15 seconds, then multiply by 4. • You can also count the beats for 60 seconds(takes more concentration) Ho: μ = 73 vs Ha: μ ≠ 73, where μ is the true mean pulse rate for students at Rancho. Assumptions: We have an independent random sample of 39 pulse rates taken during fourth period in class. The population of all students at school is more than 10x our sample. Our normal condition is met by the CLT. 1-sample Z Test Mean = 69.6 n = 39 Z = -1.92 P-value = .0547 This p-value is low enough to reject Ho at the 10% level. Based on this sample, there is evidence to suggest the the pulse rates for Rancho students may be different than 73. Type 1 and 2 errors Type 1 error — Rejecting Ho when it’s true. Type 2 error — Failing to reject Ho when it’s false. CH 11 Tests Significance Tests Use the HAN SOLO acronym • H: hypotheses Ho and Ha • A: assumptions/Conditions • N: name the Test • • • • S: stats from calc O: obtain a p-value L: low enough to reject Ho? O: outcome in context What is a P-Value? • P-value assumes Ho is true. • It is a percent. • It is the probability of your sample happening by chance if Ho is true. What is a P-value? When the p-value is very low like p = .0123 it means that the data you collected could only happen 1.23% of the time if Ho is true. Since 1.23% is very rare, what does this probably suggest? It means that Ho is probably not true. So we Reject Ho What is a P-value? Now, lets say a p-value is higher. p = .3567. This means that the data we collected could happen about 35.67% of the time, if Ho is true. This percent is very likely to happen. There is no reason to doubt Ho Do not reject Ho Alpha Levels The popular alpha levels are: • α = 0.01 which is 1% • α = 0.05 which is 5% • α = 0.10 which is 10% These levels are the cutoff points for rejecting Ho Practice the Hard Parts • The following slides will help you write your alternative hypotheses(Ha) • Help with your p-values • Help write your conclusions. Jack claims he can throw a football 50 yards. He throws the ball 75 times and averages 49.5 yards. Carry out a significance test at the α = .05 level. Ho: μ = 50 vs Ha: μ < 50 Where μ is the true mean distance Jack can throw a football After crunching the #’s on the calculator a p-value gives P = .0766 What do we do with Ho? Write your conclusion. Is p < .05? No, we will not Reject Ho There is not enough evidence at the 5% level to suggest that Jack throws a football less than 50 yards. A manufacturer claims that a new brand of air-conditioning unit uses only 6.5 kilowatts of electricity per day. A consumer agency believes the true figure is higher and runs a test on a sample size of 50. Carry out a significance test at the α = .10 level. Ho: μ = 6.5 vs Ha: μ > 6.5 Where μ is the true mean kilowatts of electricity used per day After crunching the #’s on the calculator a p-value gives P = .0590 What do we do with Ho? Write your conclusion. Is p < .10? Yes, we will Reject Ho This evidence suggests that the true mean kilowatts of electricity used per day might be more than 6.5 kilowatts. Mr. Pines claims that the mean GPA for athletes at Rancho Alamitos High School is 3.25. Carry out a significance test at the α = .01 level. Ho: μ = 3.25 vs Ha: μ ≠ 3.25 Where μ is the true mean GPA of athletes at Rancho After crunching the #’s on the calculator a p-value gives P = .0083 What do we do with Ho? Write your conclusion. Is p < .01? Yes, we will Reject Ho This evidence suggests that the true mean GPA of athletes at Rancho might be different than 3.25. No alpha(α) level given Lets say our calculator gives a p-value of p = .0452 If there is no alpha level given, how do you know if you should reject the Ho? Typical alpha levels .01 .05 .10 You need to reject at the level where it fits best, this p-value of p =.0452 is low enough to reject at the 5% level but not at the 1% level. Understand this….. • It is NOT our job to find the true mean or the true proportion in a significance test. • We just have to make a decision on the claim. • Our data helps us make a decision One and Two-sided tests One sided tests: Ha: μ < 20 Ha: μ > 20 Two sided test Ha: μ ≠ 20 One-sided test Ho: μ = 10 vs Ha: μ > 10 Let’s say you are not given any data, all you have is a z-score Z = 2.78 How do you get a p-value? normalcdf(2.78,1000) = .0027 Two-sided test Ho: μ = 10 vs Ha: μ ≠ 10 Let’s say you are not given any data, all you have is a z-score Z = 2.78 How do you get a p-value? normalcdf(2.78,1000) = .0027 Because this is a two-sided test(≠) you need to multiply your p-value by 2 2(.0027) = .0054 P-value? • Caution!!! • You only need to multiply your p-value by 2 if it is a two-sided test and if you had to use normalcdf to calculate it. P-value If you used one of the tests from the test menu on your calculator, the p-value is already taken care of. This was done from the TEST MENU, do NOT multiply your p-value by 2 Type 1 and 2 errors • Type 1 error — Rejecting Ho when it’s true. • Type 2 error — Failing to reject Ho when it’s false. Here is the dilemna • It might not be safe to launch the space shuttle today. • How is this a type I, type II error situation? Type 1 and 2 errors Ho: The shuttle is safe, launch rockets Ha: The shuttle is not safe, delay the launch What is a type I error in this context? What are its consequences? What is a type II error in this context? What are its consequences? Which is worse? Type I error: Reject Ho but it was true. Assuming the shuttle is not safe, delaying the launch, but the shuttle was safe. Consequence: Not launching on time, have to reschedule. But no one is in danger Type II error: Fail to Reject Ho, when it is false. Assuming shuttle is safe, when it actually wasn’t safe. Consequence: Shuttle blows up. Reject Ho Ho True Ho False Assume the Shuttle is not safe, delay launch Assume the Shuttle is not safe, delay launch TYPE I ERROR Fail to Reject Ho Correct Decision Assume the Shuttle is safe, launch Assume the Shuttle is safe, launch Correct Decision TYPE II ERROR Which type of error is more serious? …. You have to read the problem! Decreasing the chance of a type I error increases the chance of a type II error…and vice versa Type 1 and 2 errors • What is the probability of that error? • Type 1 is the alpha level. • Type 2 is β and complex and you do not have to know. Power STUDY THIS PAGE • What is power? • Power = 1 - β It is the probability of correctly rejecting Ho when it is false. Ways to increase power Increase sample size Increase alpha level.....ex.(use α = .10 instead of α = .05 or α = .01) Criminal Trial QUIZ( yes, a quiz, actually a group quiz, one paper per group • In a criminal trial, the defendant is held to be innocent until shown to be guilty beyond a reasonable doubt. • Ho: defendant is innocent • Ha: defendant is guilty Criminal Trial 1. Give the type I and type II errors in this context. 2. Give the consequences for each 3. Which is worse? 4. Based on your answer to #3, is it better to use a significance test with α = .05 or α = .01? Explain your answer. 5. Explain what power would be in the context of THIS setting. 1-sample Z-test • Ho: u = 3.5 vs Ha: u ≠ 3.5 where u is the true mean of this real die. • Assumptions: We have an independent random sample of 50 rolls of a real die. Our normal condition is met by the CLT. z = -.33 X-bar = 3.42 σ = 1.70783 p=.7405 This p-value it too high to reject Ho There is not enough evidence to suggest that the mean of this die is different than 3.5 Back to the Real Die Recall that a real die has μ = 3.5 and σ = 1.71….last week we rolled the die 50 times. What sample mean would we need to get in order to reject the null(μ = 3.5 ) at the 5% level? You have to use the z-test formula x - 3.5 = 1.960 1.71 50 x - 3.5 = 1.960 1.71 50 x = 3.973987818 Plug the answer back in a Z-test and see if your p-value gets rejected at the 5% level. Make sure you do a two-sided test. Emergency Response Time • Ho: The mean response time is equal to 6.7 minutes • Ha: The mean response time is less than 6.7 minutes. Give the type I and type II errors for this situation. Give consequences for each What should the alpha level be set at? What is power in context of this situation Type I Error: Reject Ho, when it’s true Assume the response time is less than 6.7 minutes when it’s not. Consequence: Not trying to improve your response time, people are at risk of not getting helped as fast as they should be. Type II Error: Fail to reject Ho, when it’s false Assume the response time is equal 6.7 minutes when it’s less. Consequence: Wasting time and money on improving your response time when you already have. Type I is worse because peoples lives are at risk. Because you want to protect the type I error, you need to make Ho hard to reject. Choose a low alpha level .01. The power is correctly rejecting Ho when it’s false. Probability of correctly assuming response time is less than 6.7 minutes. Temperatures Ho: u = 98.6 vs Ha: u ≠ 98.6 where u is the true mean temperature for students in this class Conditions We have an independent sample of 9 students who volunteered to take their temperatures. Our sample is not large enough to assume Normality by the CLT. Our box plot shows no outliers or extreme skew. Ok to proceed. 1-sample t test X-bar = 98.31 S = .86378 n=9 df = 8 t = -1.00 p = .3451 This p-value is too high to reject Ho This evidence suggests that the true mean temperature might not be different than 98.6 Rejecting the Ho • Determine what should be done with the following P-Values 1.P(Z < -1.43) = 0.0764, reject at the 10% level 1.P(Z > .34) = 0.3669, do not reject Ho 1.P(Z ≠ 2.87) = 0.0041, reject at the 1% level Notice the small difference (a) Mean = 536.7 P-Value = .0505 Do not reject Ho (b) Mean = 536.8 P-Value = .0496 Reject at 5% level (c) The sample mean only changed by a tenth, slight variation completely reversed our conclusion Sample Size Matters (a) n = 100 P-Value = .3628 not even close to rejecting null (b) n = 1000 P-Value = .1336 not enough to reject null (c) n = 10,000 P-Value = .0002 reject at any level Conjecture • Mr. Pines is considering whether he should do his catching tic tacs activity this year in AP Stats. Ho: It is safe, do the activity. Ha: It is not safe, don’t do it. Fill out your type I and II error template completely. Conjecture • Mr. Pines got stung by a sting ray over the break. He is trying to decide whether he should go to the doctor. Ho: It will heal on its own. Ha: It needs to be looked at by a doctor. Fill out your type I and II error template completely. Type I Error: Reject Ho, when it’s true Decide that it needs to be looked at by a doctor when it would have healed on its own. Consequence: Wasted time,money, and the inconvenience of going to the doctor. Type II Error: Fail to reject Ho, when it’s false Assume that it would heal on its own when it needed to be looked at by a doctor Consequence: It takes a long time to heal, could get infected, and may possibly result in loss of a limb. Type II error is worse because you’re putting your body in serious risk Because you want to protect against the type II error, you need to make Ho easy to reject. Choose a high alpha level .10. The power is correctly rejecting Ho when it’s false. So in this situation the power is the probability of correctly choosing to go to the doctor when you need to go. • That was a true story. • Mr. Pines made a type II error. • Luckily the doctor was able to heal him in time. Conjecture • Mr. Pines is wondering whether the shark swimming near him is a friendly shark or a mean shark. Ho: It is a friendly shark. Ha: It is a mean shark. Fill out your type I and II error template completely. Type I Error: Reject Ho, when it’s true Decide that the shark is mean when it actually was friendly Consequence: Miss out on an opportunity to swim with a shark and have a great experience to share with all your friends and family. Type II Error: Fail to reject Ho, when it’s false Assume that the shark is friendly when it is actually a mean shark. Consequence: Get eaten. Type II error is worse because you could get eaten by a shark. Because you want to protect against the type II error, you need to make Ho easy to reject. Choose a high alpha level .10. The power is correctly rejecting Ho when it’s false. So in this situation the power is the probability of correctly identifying a mean shark when it is actually mean. Conjecture • Mr. Pines is wondering if he should quit is his job and try to join the circus. Ho: Keep teaching. Ha: Circus. Fill out your type I and II error template completely. Conjecture • Mr. Pines is wondering if he should still eat the last half of his bagel after it fell on the carpet in this room so that the cream cheese side was touching the carpet. Ho: Eat it. Ha: Throw it away. Fill out your type I and II error template completely. 4 Boys Ditch It was the day before a vacation and four boys, who are all friends, were absent from Mr. Pines’ 2nd period class. They were generally healthy boys. After 60 days of class, each had missed only one day. There was not a flu going around at the time and the day was typical except for the fact that it was the day before a long break. All boys were healthy and present the day before. Is there mathematical evidence to suggest that these boys were ditching? Justify your response. Ho: The boys were just absent coincidentally. Ha: The boys organized a ditch day. How would you calculate the P-value? (The probability that those boys were all absent by chance on the same day of school) 4 Boys Ditch It was the day before a vacation and four boys, who are all friends, were absent from Mr. Pines’ 2nd period class. They were generally healthy boys. After 60 days of class, each had missed only one day. There was not a flu going around at the time and the day was typical except for the fact that it was the day before a long break. All boys were healthy and present the day before. Is there mathematical evidence to suggest that these boys were ditching? Justify your response. What would your conclusion be? Which error type might you have committed? Looking at the error type, what do you think Mr. Pines should do with this situation? Conjecture • Mr. Pines is wondering whether to accuse these 4 boys of ditching. Ho: The boys were just absent coincidentally. Ha: The boys organized a ditch day. We need a p-value to base our decision on. The probability that one boy was absent is based on his attendance so far this year…(1/60) So for these 4 boys absent on the same day is (1/60)^4 P-value = .00000008 Type I Error: Reject Ho, when it’s true Decide that the boys ditched when they really were just absent coincidently Consequence: Boys may get in trouble for something they didn’t do, Mr. Pines may get parent complaints and possible law suit?. Type II Error: Fail to reject Ho, when it’s false Assume that the boys were just absent coincidently when they did organize a ditch day. Consequence: Boys get away with missing a day of school, they don’t learn their lesson and continue to do more serious offenses which leads to a life of crime. For Mr. Pines a Type I error is worse because it’s not worth the time and hassle. Because you want to protect against the type I error, you need to make Ho hard to reject. Choose a high low level .01. The power is correctly rejecting Ho when it’s false. So in this situation the power is the probability of correctly deciding that they ditched when they really ditched. You could have chosen that a Type II error is worse because maybe you feel that they shouldn’t get away with ditching Because you want to protect against the type II error, you need to make Ho easy to reject. Choose a high high level .10. The power is correctly rejecting Ho when it’s false. So in this situation the power is the probability of correctly deciding that they ditched when they really ditched.