Intermediate Statistical Analysis Professor K. Leppel.

Slides:



Advertisements
Similar presentations
“Students” t-test.
Advertisements

Hypothesis testing Another judgment method of sampling data.
Anthony Greene1 Simple Hypothesis Testing Detecting Statistical Differences In The Simplest Case:  and  are both known I The Logic of Hypothesis Testing:
Chapter 9 Hypothesis Testing Understandable Statistics Ninth Edition
Hypothesis Testing A hypothesis is a claim or statement about a property of a population (in our case, about the mean or a proportion of the population)
1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and Alternative Hypotheses Type I and Type II Errors Type I and Type II Errors.
1 1 Slide STATISTICS FOR BUSINESS AND ECONOMICS Seventh Edition AndersonSweeneyWilliams Slides Prepared by John Loucks © 1999 ITP/South-Western College.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 9 Hypothesis Testing Developing Null and Alternative Hypotheses Developing Null and.
Chapter 10 Section 2 Hypothesis Tests for a Population Mean
1 1 Slide IS 310 – Business Statistics IS 310 Business Statistics CSU Long Beach.
Hypothesis Testing Using a Single Sample
Fundamentals of Hypothesis Testing. Identify the Population Assume the population mean TV sets is 3. (Null Hypothesis) REJECT Compute the Sample Mean.
Pengujian Hipotesis Nilai Tengah Pertemuan 19 Matakuliah: I0134/Metode Statistika Tahun: 2007.
Probability & Statistics for Engineers & Scientists, by Walpole, Myers, Myers & Ye ~ Chapter 10 Notes Class notes for ISE 201 San Jose State University.
BCOR 1020 Business Statistics Lecture 21 – April 8, 2008.
Inference about a Mean Part II
8-2 Basics of Hypothesis Testing
Inferences About Process Quality
Chapter 9 Hypothesis Testing.
Statistics for Managers Using Microsoft® Excel 5th Edition
Definitions In statistics, a hypothesis is a claim or statement about a property of a population. A hypothesis test is a standard procedure for testing.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 9 Hypothesis Testing.
Lecture Slides Elementary Statistics Twelfth Edition
Overview Definition Hypothesis
1 © Lecture note 3 Hypothesis Testing MAKE HYPOTHESIS ©
Statistical inference: confidence intervals and hypothesis testing.
8 - 1 © 2003 Pearson Prentice Hall Chi-Square (  2 ) Test of Variance.
Sections 8-1 and 8-2 Review and Preview and Basics of Hypothesis Testing.
Fundamentals of Hypothesis Testing: One-Sample Tests
1 1 Slide © 2005 Thomson/South-Western Chapter 9, Part B Hypothesis Tests Population Proportion Population Proportion Hypothesis Testing and Decision Making.
Chapter 9.3 (323) A Test of the Mean of a Normal Distribution: Population Variance Unknown Given a random sample of n observations from a normal population.
Overview Basics of Hypothesis Testing
1 Power and Sample Size in Testing One Mean. 2 Type I & Type II Error Type I Error: reject the null hypothesis when it is true. The probability of a Type.
1 1 Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University © 2002 South-Western/Thomson Learning.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
LECTURE 19 THURSDAY, 14 April STA 291 Spring
1 Psych 5500/6500 The t Test for a Single Group Mean (Part 1): Two-tail Tests & Confidence Intervals Fall, 2008.
Chapter 8 Introduction to Hypothesis Testing ©. Chapter 8 - Chapter Outcomes After studying the material in this chapter, you should be able to: 4 Formulate.
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 Chapter 9 Hypothesis Testing. 2 Chapter Outline  Developing Null and Alternative Hypothesis  Type I and Type II Errors  Population Mean: Known 
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 8 Hypothesis Testing.
Lecture 9 Chap 9-1 Chapter 2b Fundamentals of Hypothesis Testing: One-Sample Tests.
Interval Estimation and Hypothesis Testing Prepared by Vera Tabakova, East Carolina University.
Two-Sample Hypothesis Testing. Suppose you want to know if two populations have the same mean or, equivalently, if the difference between the population.
1 9 Tests of Hypotheses for a Single Sample. © John Wiley & Sons, Inc. Applied Statistics and Probability for Engineers, by Montgomery and Runger. 9-1.
Unit 8 Section 8-3 – Day : P-Value Method for Hypothesis Testing  Instead of giving an α value, some statistical situations might alternatively.
© Copyright McGraw-Hill 2004
Formulating the Hypothesis null hypothesis 4 The null hypothesis is a statement about the population value that will be tested. null hypothesis 4 The null.
Applied Quantitative Analysis and Practices LECTURE#14 By Dr. Osman Sadiq Paracha.
Statistical Inference Statistical inference is concerned with the use of sample data to make inferences about unknown population parameters. For example,
Created by Erin Hodgess, Houston, Texas Section 7-1 & 7-2 Overview and Basics of Hypothesis Testing.
 What is Hypothesis Testing?  Testing for the population mean  One-tailed testing  Two-tailed testing  Tests Concerning Proportions  Types of Errors.
Copyright © 2009 Pearson Education, Inc t LEARNING GOAL Understand when it is appropriate to use the Student t distribution rather than the normal.
Chapter 9 Hypothesis Testing Understanding Basic Statistics Fifth Edition By Brase and Brase Prepared by Jon Booze.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
4-1 Statistical Inference Statistical inference is to make decisions or draw conclusions about a population using the information contained in a sample.
Chapter 9 Introduction to the t Statistic
Chapter 9: Hypothesis Tests for One Population Mean 9.5 P-Values.
9.3 Hypothesis Tests for Population Proportions
Chapter 9 Hypothesis Testing.
Review and Preview and Basics of Hypothesis Testing
Chapter 8 Hypothesis Testing with Two Samples.
Chapter 9 Hypothesis Testing.
LESSON 20: HYPOTHESIS TESTING
St. Edward’s University
Interval Estimation and Hypothesis Testing
Slides by JOHN LOUCKS St. Edward’s University.
Hypothesis Tests for a Standard Deviation
Power Section 9.7.
Presentation transcript:

Intermediate Statistical Analysis Professor K. Leppel

Hypothesis Testing One Sample

Notation H 0 : hypothesis being tested “null hypothesis” H a or H 1 : alternative hypothesis Example: H 0 :  = 100 versus H 1 :  100

Type I and Type II errors Type I error – rejecting the null hypothesis when it’s true. Type II error – accepting the null hypothesis when it’s false.

Situation H 0 is trueH 0 is false Decision accept H 0 reject H 0

Situation H 0 is trueH 0 is false Decision accept H 0 reject H 0 incorrect decision (type I error) probability =  = level of significance

Situation H 0 is trueH 0 is false Decision accept H 0 correct decision probability = 1-  = confidence level reject H 0 incorrect decision (type I error) probability =  = level of significance

Situation H 0 is trueH 0 is false Decision accept H 0 correct decision probability = 1-  = confidence level incorrect decision (type II error) probability =  reject H 0 incorrect decision (type I error) probability =  = level of significance

Situation H 0 is trueH 0 is false Decision accept H 0 correct decision probability = 1-  = confidence level incorrect decision (type II error) probability =  reject H 0 incorrect decision (type I error) probability =  = level of significance correct decision probability = 1-  = power of the test

Critical region Values of the test statistic for which the null hypothesis is rejected. Example: Suppose you are testing whether or not the population mean is 100. Your test statistic is the sample mean. If the sample mean is very far from 100, perhaps less than 90 or more than 110, you reject the hypothesis that the mean is 100. Then your critical region is the set of values of the sample mean that are less than 90 or more than 110.

Acceptance region Values of the test statistic for which the null hypothesis is accepted. Example: Again suppose you are testing whether the population mean is 100, and your test statistic is the sample mean. You decided to reject the null hypothesis if the sample mean is less than 90 or more than 110. You accept the null hypothesis if the sample mean is between 90 and 110. Then your acceptance region is the set of values of the sample mean that are between 90 and 110.

Example: Suppose you want to know whether the mean IQ at a particular university is 130. You know the population standard deviation  is 5.4. To test the hypothesis, you take a random sample of 25 observations. The mean IQ of the sample is 128.

a 130 b If the null hypothesis is correct, the center of the distribution of the sample mean is 130. acceptance region crit. reg. Our critical and acceptance regions look like this graph. We need to determine what a and b are so that we know when we should accept our null hypothesis and when we should reject it.

a 130 b Suppose we want our probability  of type I error to be at most acceptance region crit. reg. We want the probability of rejecting the null hypothesis when it is actually correct to be So we are in the critical region when the graph is centered at 130 with probability The area in each of the two tails of the critical region is half of 0.05 or

.025 The equation we derived implies this graph of the standard normal or Z distribution. From the Z table, we know that the cut-off points for the tails with area must be 1.96 and

Solving the first equation for a and the second equation for b, we find a = and b =

Returning to our graph for the sample mean, we have this picture. acceptance region crit. reg. So if our sample mean is between and , we accept the null hypothesis that the population mean IQ is 130. If our sample mean is less than or more than , we reject the null hypothesis and accept the alternative that the population mean is not 130.

Since the sample mean was 128, what would our decision be? acceptance region crit. reg. Accept H 0 :  = 130 If the sample mean was 127 instead, what would our decision be?

In the hypothesis test we just performed, we determined the cut-off points a and b for the sample mean, and then checked to see if our observed values were in the acceptance or critical region. Another way of doing the hypothesis test is to use the “p-value.” The p-value is the probability that the value of the sample mean is as far away from the hypothesized mean as observed, if the hypothesized mean is actually correct. If the p-value is greater than our test level , we accept the null hypothesis. If the p-value is less than , we reject the null hypothesis. The reasoning when the p-value is less than  is this: The probability of seeing the observed value of the sample mean, if the null hypothesis is true, is very small. Since it’s unlikely under the assumption of the null hypothesis, we reject that hypothesis.

Let’s do the same problem using the p-value method. Recall that the sample mean was 128, the population standard deviation was 5.4, the sample size was 25, and the test level was = 2 ( ) = 2 (0.0322) = Using a test level of  = 0.05, we accept the null hypothesis, since the p-value > Z

Quick & Dirty Method of Hypothesis Testing 1.Convert the sample mean to a standard normal Z-statistic: 2. Sketch the critical & acceptance regions in terms of a Z-statistic. 3. Make the decision.

Same problem one more time: Recall that the sample mean was 128, the population standard deviation was 5.4, the sample size was 25, and the test level was Based on a test level or  of 0.05, we have the graph below Z crit. reg. Since the Z-value is in the acceptance region, we accept the null hypothesis that the population mean is 130.

When a hypothesis has only one value such as  = 130, we call it a simple hypothesis. When a hypothesis has more than one value, we call it a composite hypothesis. Some examples:

The critical region depends on the alternative hypothesis, not the null. If the alternative is “not equal to”, the critical region is 2-tailed. If the alternative is “greater than”, the critical region is the right tail only. If the alternative is “less than”, the critical region is the left tail only.

1-Tailed Hypothesis Test at the 5% level if the sample mean is 128 based on a sample of size 25, and the population standard deviation is 5.4. We will again use these 3 methods to do this problem: 1.Determine critical region in terms of the sample mean. 2.P-value 3.“Quick & Dirty”

1. Determine critical region in terms of the sample mean crit. reg. Since the alternative hypothesis is  <130, the critical region is the left tail. Since the test level is 5%, the area of the critical region is Acceptance region We sketch the graph under the assumption that the null hypothesis is true, centering the graph at the most conservative value of that hypothesis,  = 130. a

crit. reg. Acceptance region a crit. reg. Acceptance region Z Using the Z table, we find the cut-off point must be

we find a = Our value of the sample mean was 128. Since 128 is in the critical region, we reject the null hypothesis and accept the alternative that  < crit. reg. Acceptance region a

2. P-value method. Keep in mind that the sample mean is 128, the population standard deviation is 5.4, the sample size is 25, and the test level is = 0.5 – = Using a test level of  = 0.05, we reject the null hypothesis and accept the alternative that  <130, since the p-value < Z

3. “Quick & Dirty” Method. Again, remember that the sample mean was 128, the population standard deviation was 5.4, the sample size was 25, and the test level was Based on a test level or  of 0.05, we have the graph below. crit. reg. Since the Z-value is in the critical region, we reject the null hypothesis and accept the alternative that  < 130. Z Acceptance region.45

Calculating  Recall that  is the probability of type I error = Pr( reject H 0 | H 0 is true), and  is the probability of type II error = Pr( accept H 0 | H 0 is false).

where the population standard deviation is 50 and the sample size is 25. Let’s first determine the critical region, and then calculate , based on a specified value of .

a 1000 b acceptance region crit. reg

.025 The above equation implies this graph of the standard normal or Z distribution From the Z table, we know that the cut-off points for the tails with area must be 1.96 and -1.96

Solving the first equation for a and the second equation for b, we find a = and b = So our critical and acceptance regions look like this: acceptance region crit. reg.

But what if  is actually 990, not 1000? acceptance region crit. reg. Our cut-off values for the critical and acceptance regions are still the same, but the distribution curve is centered at 990 instead of at  = Pr(accepting H 0 | H 0 is false, in this case,  =990) = Pr(being in acceptance region|  =990)

We determine from the Z table that the specified area is = Z

So, , the probability of accepting the null hypothesis that  = 1000, when  is actually 990, is With the given standard deviation and sample size, it is difficult to distinguish a distribution with a mean of 990 from a distribution with a mean of If we had a mean of 900, which is farther from 1000 than 990 is, it would be easier to distinguish it from 1000, and our value of  would be smaller.

In general, we want the probability of type I and type II errors,  and , to be small. How can we make  and  smaller? Since  is the probability of accepting the null hypothesis when it is false, we can make  smaller by accepting the null hypothesis less often (shrinking the acceptance region). If we shrink the acceptance region, however, we expand the critical region. That means we reject the null hypothesis more often, increasing the probability of rejecting it when it is correct. So we’ve increased . Similarly, if we try to decrease , we increase .

Example: Parties Suppose you have just completed your first semester at college. You are reflecting back on your social experiences of the semester, and thinking that you went to a lot of boring parties. You are thinking that you would like to reduce the number of boring parties that you attend. Think of the decision to attend a party as one involving the null hypothesis that the party is a good one and the alternative hypothesis is that the party is boring. You want to keep down the error probabilities  = Pr(skip a party | it’s a good one) and  = Pr(attend a party | it’s boring). To reduce , you might go to a lot of parties, but then you risk attending boring ones. To reduce , you might go to very few parties, but then you risk missing some good ones.

Is there some way that we can decrease both  and  ? Yes, we can decrease both  and  by collecting more data or more information, by increasing the sample size. Unfortunately, in the real world, collecting more data usually means increasing the cost of the study. So there’s a tradeoff between accuracy and cost.

In the context of our party example, to keep down the number of boring parties you attend as well as the number of good parties you miss, you need to get more information. You need to talk to more people, find out who’s going, the music that is likely to be played, the food that will be served, etc.

How do we do hypothesis testing when the population standard deviation is unknown? We do it similarly to what we’ve done so far, but we replace the population standard deviation  by the sample standard deviation and the Z distribution by the t distribution

Example: Suppose you sample 16 matchboxes. The sample mean number of matches per box is 17 and the sample standard deviation is 2. Test at the 5% level Use all three methods that we used previously.

a 18 b Method 1 acceptance region crit. reg. If the null hypothesis is correct, the distribution of the sample mean is centered at 18. We need to find the values of a and b so that the combined area in the two tails is We don’t have to compute a and b separately. We can just compute one of them and figure out the other by symmetry. We’ll do b.

.025 The equation we derived implies this graph of the t distribution From the t table, we find that for 15 degrees of freedom, the cut-off points for the two tails with a combined area 0.05 are and

Solving the first equation for a and the second equation for b, we find a = and b = 19.07, which gives us the acceptance and critical regions shown in the graph. Since our value for the sample mean is 17, which is in the acceptance region, we accept the null hypothesis that  = acceptance region crit. reg

Method 2 Recall that the sample size is 16, the sample mean number of matches is 17, the sample standard deviation is 2, and we’re testing at the 5% level Since we’re doing a 2-tailed test, we need a 2-tailed p-value.

Using Excel, we find that this 2-tailed p-value is So based on a test level of  = 0.05, we accept the null hypothesis, since the p-value > t

Method 3 Keep in mind that the sample mean was 17, the sample standard deviation was 2, the sample size was 16, and the test level was Based on a test level or  of 0.05, we have the graph below. Since our t 15 -value, -2.00, is in the acceptance region, we accept the null hypothesis that the population mean is t crit. reg. Acceptance region

New Example: Let X be the number of miles driven when the cumulative repair cost for a car reaches $500. Given a sample of 15 observations, a sample mean of 22,500, and a sample standard deviation of 4,000, test at the 5% level Use all three methods that we used previously. Notice that for this test, the critical region is just the left tail. Also, since we have the sample standard deviation, not the population standard deviation, we’ll be using a t-statistic.

a 24,000 Method 1 acceptance region crit. reg. If the null hypothesis is correct, the distribution of the sample mean is centered at 24,000. We need to find the value of a so that the area in the left tail is

.05 The equation we derived implies this graph of the t distribution From the t table, we find that for 14 degrees of freedom, the cut-off point for a left tail with an area of 0.05 is

Solving the equation for a, we find a = 22,181. This gives us the acceptance and critical regions shown in the graph. Since our value for the sample mean is 22,500, which is in the acceptance region, we accept the null hypothesis that  = 24, ,000 acceptance region crit. reg. 22,181

Method 2 Recall that the sample size is 15, the sample mean is 22,500, the sample standard deviation is 4,000, and we’re testing at the 5% level Since we’re doing a 1-tailed test, we need a 1-tailed p-value.

Using Excel, we find that this p-value is So based on a test level of  = 0.05, we accept the null hypothesis, since the p-value > t

Method 3 Keep in mind that the sample mean was 22,500, the sample standard deviation was 4,000, the sample size was 15, and the test level was Based on a test level or  of 0.05, we have the graph below. Since our t 14 -value, , is in the acceptance region, we accept the null hypothesis that the population mean is 24, t crit. reg. Acceptance region

Hypothesis testing on the population proportion 

So for hypothesis testing on a population proportion, we have the statistic

Example Notice that our test is right-tailed, so the critical region is as shown below. From the Z table, we know that the cut-off point is Z.05 acceptance region crit. reg..45 Since our Z-statistic is in the acceptance region, we accept H 0 :  = 0.30

In the section we have just completed, we did 3 different types of hypothesis tests for the case of a single sample. 1.population mean - known population variance 2.population mean - unknown population variance 3.population proportion In the next section we will look at hypothesis testing when we have more than one sample.