ch 9 hypothesis testing with one sample - part ii

28
HYPOTHESIS TESTING WITH ONE SAMPLE Chapter 9 – Part II

Upload: jason-edington

Post on 11-Apr-2017

54 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Ch 9 Hypothesis Testing with One Sample - Part II

HYPOTHESIS TESTING WITH ONE SAMPLEChapter 9 – Part II

Page 2: Ch 9 Hypothesis Testing with One Sample - Part II

HYPOTHESIS TESTING STEPS So, how do we do hypothesis testing? Here are the steps in more detail:

1. State the problem2. Formulate the null and alternative hypotheses3. Choose the significance level (i.e. choose the probability of rejecting H0 when H0 is true)4. Determine the appropriate test statistic5. Compute the test statistic6. Find critical value(s) at the appropriate level of significance (traditional method) or

compute the p-value (p-value method)7. Compare test statistics to critical value(s) or p-value to level of significance 8. Based on this comparison reject or fail to reject H0

9. State your conclusions How do we do all this?

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 3: Ch 9 Hypothesis Testing with One Sample - Part II

DISTRIBUTIONS NEEDED FOR HYPOTHESIS TESTING Recall the following three distributions

If you are testing a single population mean and the standard deviation is KNOWN then

If you are testing a single population mean and the standard deviation is UNKNOWN then

If you are testing a single population proportion then

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 4: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE TEST STATISTIC Test Statistic: A value computed from the sample data that is used in

making the decision of rejecting H0 (or not) When the hypothesis test is about the MEAN and the population standard

deviation is KNOWN, then the test statistic is

When the hypothesis test is about the MEAN and the population standard deviation is UNKNOWN, then the test statistic is

When the hypothesis test is about a PROPORTION, then the test statistic is

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 5: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE TEST STATISTIC The cost of a daily newspaper varies from city to city. However, the

variation among prices remains steady with a population standard deviation of 20 cents. A study was done to test the claim that the mean cost of a daily newspaper is $1.00. 12 newspapers were bought and the mean cost was found to be 95 cents. Solution: This problem asks us to test if the mean cost of a daily newspaper is

$1.00. Further, we know the population standard deviation (Ç). So, we use z:¿.95−1.2

√12

¿−0.050.0577 ¿−0.866

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 6: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE TEST STATISTIC Registered nurses earned an average salary of $69,110. For that same

year, a survey was conducted of 41 California registered nurses to determine if the annual salary is higher than $69,110. The sample average was $71,121, with a sample standard deviation of $7,489. Solution: This problem asks us to test if the mean salary for nurses is higher than

$69,110. Here, we do NOT know the population standard deviation (Ç). So, we use t:

s ¿71121−69110

7489√ 41

¿2011

1169.585 ¿1.719

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 7: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE TEST STATISTIC The US Department of Energy reported that 51.7% of homes were heated

by natural gas. A random sample of 221 homes in Kentucky found that 115 were heated by natural gas. Solution: This problem asks us to test if the proportion of households is equal to

51.7%. Since this is asking about a proportion, the test statistic is:

¿0.52−0.517

√ 0.517(1−0.517)221

¿0.0030.0336 .0892

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 8: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE TEST STATISTIC A particular brand of tires claims that its deluxe tire averages at least

50,000 miles before it needs to be replaced. From past studies of this tire, the population standard deviation is known to be 8,000. A survey of owners of that tire design is conducted. From 28 tires surveyed, the mean lifespan was 46,500 miles with a standard deviation of 9,800 miles.

Question: Which distribution do we want to use?

S = 9800

¿46500−50000

8000√28

¿−35001151.858 2.315

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 9: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE CRITICAL VALUES The Critical Region is the set of all values of the test statistic that cause

us to reject the null hypothesis A critical value is any value that separates the critical region (where we

reject H0) from the values of the test statistic that do not lead to the rejection of H0

Common choices for the significance level are 0.10, 0.05, and 0.01 So what does a critical region look like?

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 10: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION

When Ha contains a ‘not equal to’; i.e.

So the red area is the critical region

If our test statistic is inside the red area, then we reject H0

If our test statistic is inside the blue area, then we fail to reject H0

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 11: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION

When Ha contains a ‘less then’;

i.e. Note that tells us which tail: <

So the red area is the critical region

If our test statistic is inside the red area, then we reject H0

If our test statistic is inside the blue area, then we fail to reject H0

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 12: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION

When Ha contains a greater then; i.e. Note that tells us which tail: >

So the red area is the critical region

If our test statistic is inside the red area, then we reject H0

If our test statistic is inside the blue area, then we fail to reject H0

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 13: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION So the critical region gives us a rule for when we should reject (or fail to reject the

null hypothesis) If our test statistic is inside the critical region (the red) than we REJECT the null

hypothesis If our test statistic is not inside the critical region then we FAIL TO REJECT the null

hypothesis This is equivalent to saying if the absolute value of our test statistic is bigger than

the absolute value of the critical value then we REJECT the null hypothesis, i.e.

If not, then we FAIL TO REJECT the null hypothesis

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 14: Ch 9 Hypothesis Testing with One Sample - Part II

EXAMPLES A particular brand of tires claims that its deluxe tire averages at least

50,000 miles before it needs to be replaced. From past studies of this tire, the population standard deviation is known to be 8,000. A survey of owners of that tire is conducted. From 28 tires surveyed, the mean lifespan was 46,500 miles with a standard deviation of 9,800 miles. Using » = 0.05, calculate the critical region. Test statistic was z = -2.315 (earlier example)

tells us “Left Tail Test” The value of

REJECT since our test statistic is inside the critical region

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 15: Ch 9 Hypothesis Testing with One Sample - Part II

EXAMPLES Registered nurses earned an average salary of $69,110. For that same

year, a survey was conducted of 41 California registered nurses to determine if the annual salary is higher than $69,110. The sample average was $71,121, with a sample standard deviation of $7,489. Using » = 0.05, calculate the critical region. Test statistic was t = 1.719 (earlier example)

tells us “Right Tail Test” Find

df = n-1 = 40

REJECT since our test statistic is inside the critical region

=1.645

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 16: Ch 9 Hypothesis Testing with One Sample - Part II

EXAMPLES The US Department of Energy reported that 51.7% of homes were heated by

natural gas. A random sample of 221 homes in Kentucky found that 115 were heated by natural gas. Using , calculate the critical region.

The tells us “Two Tail Test” Test statistic was z = 0.0892

Fail to reject since our test statistic is outside (or not inside) the critical region

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 17: Ch 9 Hypothesis Testing with One Sample - Part II

RARE EVENTS Suppose you make an assumption about a property of the population (this

assumption is the null hypothesis) Then you gather data from a random sample If the sample has properties that would be very unlikely to occur if the

assumption is true, then you would conclude that your assumption about the population is probably incorrect

So we need some sort of way to quantify how unlikely our assumption is if the null hypothesis is true

We will use the sample data to calculate the ACTUAL probability of getting the test result, called the p-value

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 18: Ch 9 Hypothesis Testing with One Sample - Part II

P-VALUES P-value: The p-value is the probability that, if the null hypothesis is true,

the results from another randomly selected sample will be as extreme or more extreme as the results obtained from the given sample

So the p-value, in some sense, measures how likely our assumption about some property of the population is to be true

A p-value is always a number between 0 and 1 A large p-value indicates that we should FAIL TO REJECT the null hypothesis A small p-value indicates that we should REJECT the null hypothesis

If p is small, reject the null How do we calculate the p-value?

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 19: Ch 9 Hypothesis Testing with One Sample - Part II

CALCULATING THE P-VALUE When Ha contains a ‘not equal

to’; i.e. So the red area is the p-value

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 20: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION

When Ha contains a ‘less then’;

i.e. So the red area is the p-value

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 21: Ch 9 Hypothesis Testing with One Sample - Part II

CRITICAL REGION

When Ha contains a ‘greater then’; i.e.

So the red area is the p-value

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 22: Ch 9 Hypothesis Testing with One Sample - Part II

P-VALUES So what is a large (or small) p-value? Any p-value that is smaller than (or equal to) our level is considered small Thus, if our p-value then we REJECT the null hypothesis

If p is small, reject the null! Also, if our p-value > then we FAIL TO REJECT the null hypothesis

Remember, we never ACCEPT H0, we always FAIL TO REJECT H0

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 23: Ch 9 Hypothesis Testing with One Sample - Part II

FINDING P-VALUE ON YOUR CALCULATOR STATTESTS Choose your test:

Z-Test (Population Standard Deviation KNOWN) T-Test (Population Standard Deviation UNKNOWN) 1-PropZTest (Proportion)

Unless you are putting the data in, choose STATS Set your value Enter the other data depending on the type of test ( Choose the value for the alternative hypothesis ( Choose ‘Calculate’

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 24: Ch 9 Hypothesis Testing with One Sample - Part II

A particular brand of tires claims that its deluxe tire averages at least 50,000 miles before it needs to be replaced. From past studies of this tire, the population standard deviation is known to be 8,000. A survey of owners of that tire is conducted. From 28 tires surveyed, the mean lifespan was 46,500 miles with a standard deviation of 9,800 miles. Using » = 0.05, is the data highly consistent with the claim?

The Population SD is known, so Z-test Choose Stats (not Data)

n: 28

Calculate - Enter Since p-value = 0.0104 < , we REJECT (If p is small, reject the null!) That is, our sample has properties that would be very unlikely to occur if the assumption

is true, thus we conclude that our assumption, , is probably incorrect Conclusion: There is sufficient evidence to conclude that the mean lifespan of the tires is

less than 50,000 miles.

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 25: Ch 9 Hypothesis Testing with One Sample - Part II

Registered nurses earned an average salary of $69,110. For that same year, a survey was conducted of 41 California registered nurses to determine if the annual salary is higher than $69,110. The sample average was $71,121, with a sample standard deviation of $7,489. Using » = 0.05, calculate the critical region.

Test statistic was t = 1.719 (earlier example)

df = n-1 = 40 p-value = ? (Find it)

0.0436

Since p-value < , we should reject the Conclusion: At the 5% significance level, there is sufficient evidence to conclude

that the mean salary of California registered nurses exceeds $69,110.

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 26: Ch 9 Hypothesis Testing with One Sample - Part II

The US Department of Energy reported that 51.7% of homes were heated by natural gas. A random sample of 221 homes in Kentucky found that 115 were heated by natural gas. Using , calculate the critical region.

“Two Tail Test” Test statistic was z = 0.0892 p-value =

0.9203 Since p-value > we should fail to reject Conclusion: There is not enough evidence to conclude that the proportion

of homes in Kentucky that are heated by natural gas is different from 0.517

(0.46015)2=.9203

0.46015 0.46015

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 27: Ch 9 Hypothesis Testing with One Sample - Part II

RULES TO REMEMBER If our test statistic is inside the critical region then we REJECT the null hypothesis If our test statistic is outside the critical region then we FAIL TO REJECT the null

hypothesisALTERNATIVELY If our p-value then we REJECT the null hypothesis If our p-value then we FAIL TO REJECT the null hypothesis

BOTH WAYS LEAD TO THE SAME SOLUTION!

We never ACCEPT , we always FAIL TO REJECT

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing

Page 28: Ch 9 Hypothesis Testing with One Sample - Part II

HOMEWORK Page 507: 62, 68, 69, 70, 75, 78, 104, 112

Null and Alternative Hypothesis Type I and Type II Errors Hypothesis Testing