Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Probability and Statistics Outline 1. Distinguish Types of Hypotheses LECTURE 8 INTRODUCTION TO HYPOTHESIS TESTING 2. Describe the basics of hypothesis testing 3. Explain the z-test for mean Adapted from http://www.prenhall.com/mcclave 8-1 8-2 Statistical Methods Hypothesis Testing Population I believe the population mean age is 50 (hypothesis). Reject hypothesis! Not close. Random sample Mean X = 20 8-3 8-4 Hypothesis Testing A hypothesis test allows us to draw conclusions or make decisions regarding population data from sample data. 8-5 What’s a Hypothesis? Usually a statement about population parameters Parameter Is Population Mean, Proportion, Variance Must Be Stated Before Analysis 8-6 Example of hypothesis The label on soft drink bottle states that it contains 67.6 fluid ounces. Is there evidence the label is incorrect? What is the hypothesis in the above context? Research Hypothesis • • • • • 8-7 What we aim to show statistically Statement we hope or suspect is true Denoted as Ha or H1 Convention: no equality sign Also called alternative hypothesis 8-8 Null Hypothesis • Theory put forward because • • • • Believed to be true or used as starting point for testing. So we assume Ho is true and use the information specified in Ho as a starting point for testing. Not been proved Opposite of Research Hypothesis Convention: contain equality sign Usually phrased as “no effect”, “no difference” Called H0 8-9 1.Example Problem: Test That the Population Mean Is Not 3 2.Steps State the Question Statistically ( 3) State the Opposite Statistically ( = 3) Must Be Mutually Exclusive & Exhaustive Select the Alternative Hypothesis ( 3) • • When doing exams, you will write Ho before Ha. But to correctly figure out hypotheses, you should write Ha first, then the Ho. Normally, Ha contains the question we wish to answer. Take into account the convention 8 - 10 Identifying Hypotheses Steps Setting up hypotheses What Are the Hypotheses? Is the population average amount of TV viewing 12 hours? State the question statistically: = 12 State the opposite statistically: 12 Select the alternative hypothesis: Ha: 12 State the null hypothesis: H0: = 12 Has the , <, or > Sign State the Null Hypothesis ( = 3) 8 - 11 8 - 12 What Are the Hypotheses? Is the population average amount of TV viewing different from 12 hours? What Are the Hypotheses? Is the average cost per hat less than or equal to $20? State the question statistically: 12 State the question statistically: 20 State the opposite statistically: = 12 Select the alternative hypothesis: Ha: < 20 Select the alternative hypothesis: Ha: 12 State the null hypothesis: H0: 20 State the null hypothesis: H0: = 12 8 - 13 8 - 14 What Are the Hypotheses? Is the average amount spent in the bookstore greater than $25? State the question statistically: 25 Jury trial example • • • Begin with idea the defendant is innocent Collect data (evidence) Convict if data are sufficiently inconsistent with the initial idea What should be our null hypothesis and alternative hypothesis? State the opposite statistically: 25 Select the alternative hypothesis: Ha: 25 • State the null hypothesis: H0: 25 8 - 15 8 - 16 Possible conclusions of a hypothesis test 2 possible conclusions: • Do not reject Ho: test is not significant • Reject Ho: test is significant Question: in the jury trial example, what are the possible conclusions? 8 - 17 Possible errors in testing • • Type I error: reject Ho if Ho is true Type II error: do not reject Ho if Ho is false Question: identify Type I and Type II errors in the jury trial example. 8 - 18 Jury Trial Results Possible errors in testing H0: Innocent • Probability of type I error: alpha • Significance level Probability of type II error: beta 8 - 20 8 - 19 Significance level • • • • Denoted a Probability of making Type I error Equals Total Area of Rejection Region Should be decided by researcher at start • Example Values Are .01, .05, .10, etc. 8 - 21 If we aim to collect evidence to show that the population mean is greater than 100. • • • Let’s write down the hypotheses? Sample mean is used to estimate population mean. Sample means vary from sample to sample (described by sampling distribution) What values of the sample means support the alternative hypothesis? When should we reject the null hypothesis? 8 - 23 If we want to test population mean is • greater than 100 (right-tailed) • smaller than 100 (left-tailed) • different from 100 (two-tailed) 8 - 22 A problem • One-tailed vs. Two-tailed tests Rejection region (right-tailed test) H0: = a Ha: > a Exercise: let’s draw the rejection region. Remember that a equals total Area of Rejection Region. Choose a small value of a as an example. You should now be convinced why the test is called right-tailed. 8 - 24 One population tests Test statistic • Now we select a random sample from population and calculate the sample mean. The calculated sample mean becomes our test statistic, as it contains evidence from the selected sample (evidence can be against or not against Ho) If test statistic falls in rejection region, we reject Ho. Otherwise, we do not reject Ho. • 8 - 25 One population Mean Z Test 1.Assumptions Population Standard Deviation Is Known Population Is Normally Distributed If Population Is Not Normal, Large Sample Size (so that the CLT holds) Is Required (In This Case, The Sampling Distribution of Sample Mean Will Be Approximately Normal) 2. Alternative Hypothesis Has < or > Sign 3. Z-Test Statistic 8 - 27 One-Tailed Z Test for Mean Hypotheses H0:=a Ha: < a H0:=a Ha: > a Reject H0 Reject H0 a a a X Must be significantly below 8 - 28 One-Tailed Z Test Finding Critical Z To make rejection decision, we need to find out critical value. Converting from to Z makes this process easier. What Is Za given a = .025? a = .025 8 - 29 Z Test T Test 8 - 26 One-Tailed Z Test for Mean ( Known) Proportion a Small values give no evidence against H0 in favor of Ha. Don’t reject! Right-Tailed Z Test Example Does an average box of cereal contain more than 368 grams of cereal? A random sample of 25 boxes showedX = 372.5. The company has specified to be 15 grams. Test at the .05 level. Assume normal 8 - 30 population. X 368 gm. Right-Tailed Z Test Solution H0: = 368 Ha: > 368 a = .05 n = 25 Critical Value(s): Test Statistic: Decision: Do not reject at a = .05 Left-tailed Z test Suppose we want to test population mean < 100 using Z test with significance level of 0.01. The calculated Z test statistic is -2.5. What is the rejection region? What is the decision? Conclusion: No evidence average is more than 368 8 - 31 8 - 32 Two-Tailed Z Test for Mean ( Known) Writing conclusions 1.Assumptions 2 cases: •Reject Ho: •Do not reject Ho: Population Standard Deviation Is Known Population Is Normally Distributed If Population Is Not Normal, Large Sample Size (n 30) Is Required (In This Case, The Sampling Distribution of Will Be Approximately Normal) 2. Alternative Hypothesis Has Sign 3. Z-Test Statistic: 8 - 34 8 - 33 Two-Tailed Z Test Example Does an average box of cereal contain 368 grams of cereal? A random sample of 25 boxes showedX = 372.5. The company has specified to be 15 grams. Test at the .05 level. Assume population. 8 normal - 35 Two-Tailed Z Test Solution H0: = 368 Ha: 368 a .05 n 25 Critical Value(s): Test Statistic: Decision: Do not reject at a = .05 Conclusion: No evidence average is not 368 368 gm. 8 - 36 Hypothesis testing common pitfalls Conclusion Choose or change hypotheses after looking at data 1. Distinguish Types of Hypotheses Choose or change level of significance after looking at data 2. Describe the basics of hypothesis testing Do not reject Ho accept Ho without considering power (1-) 3. Explain the z-test for mean 8 - 37 8 - 38