chapter 9 hypothesis testing
DESCRIPTION
Chapter 9 Hypothesis Testing. Chapter Outline. Developing Null and Alternative Hypothesis Type I and Type II Errors Population Mean: Known Population Mean: Unknown Population Proportion. Hypothesis Testing. - PowerPoint PPT PresentationTRANSCRIPT
1
Chapter 9
Hypothesis Testing
2
Chapter Outline
Developing Null and Alternative Hypothesis Type I and Type II Errors Population Mean: Known Population Mean: Unknown Population Proportion
3
Hypothesis Testing
Just as Interval Estimation provides a range of possible values of population parameters , Hypothesis Testing is another method of making inference on population parameters using observed data.
Hypothesis testing is to determine whether a statement about the value of a population parameter should be rejected or not.
The null hypothesis, denoted by Ho, is a tentative assumption about a population parameter.
The alternative hypothesis, denoted by Ha, is the opposite to the null hypothesis.
4
Developing Null and Alternative Hypotheses
Formulating hypotheses is the first and foremost step in the hypothesis testing.
There are no absolute rules in developing hypotheses. But, generally speaking, we set the historical records, the established facts, or the claims as the null hypotheses. Hence, the new findings or observations, or challenges to the status quo are set as the alternative hypotheses.
It takes practice to formulate hypotheses correctly.
5
Developing Null and Alternative Hypotheses
Example 1: A new drug is developed with the goal of lowering bad cholesterol more than the existing drug.– Alternative Hypothesis:
The new drug lowers bad cholesterol more thanThe new drug lowers bad cholesterol more than the existing drug.the existing drug.
– Null Hypothesis: The new drug does not lower bad cholesterol more than The new drug does not lower bad cholesterol more than
the existing drug.the existing drug.
6
Developing Null and Alternative Hypotheses
Example 2: The label on a can of powder milk states that it contains 2 pounds of powder milk.– Null Hypothesis:
The label (the claim) is correct, i.e. the population The label (the claim) is correct, i.e. the population average weight of the can is average weight of the can is at leastat least ( ( >> ) 2 lbs. ) 2 lbs.– Alternative Hypothesis:
The label (the claim) is incorrect, i.e. the population The label (the claim) is incorrect, i.e. the population average weight of the can is average weight of the can is less thanless than ( (<< ) 2 lbs. ) 2 lbs.
7
Null and Alternative Hypotheses about A Population Mean
The equality part of the hypotheses always appears in the null The equality part of the hypotheses always appears in the null hypothesis. hypothesis.
In general, a hypothesis test about the value of a population In general, a hypothesis test about the value of a population mean mean µµ must take one of the following three forms (where must take one of the following three forms (where µµ00 is is the hypothesized value of the population mean).the hypothesized value of the population mean).
One-tailedOne-tailed(lower-tail)(lower-tail)
One-tailedOne-tailed(upper-tail)(upper-tail)
Two-tailedTwo-tailed
0 0: H 0 0: H
0: aH 0: aH 0 0: H 0 0: H
0: aH 0: aH 0 0: H 0 0: H
0: aH 0: aH
8
Null and Alternative Hypotheses
Example: Student AgeExample: Student Age A local university recently have recruited more non-traditional students (students who A local university recently have recruited more non-traditional students (students who
have had some working experience). The university thinks it’s important to study the have had some working experience). The university thinks it’s important to study the recent change in student composition in order to better meet students’ need. recent change in student composition in order to better meet students’ need.
The student record office wants to formulate a hypothesis test that uses a sample of The student record office wants to formulate a hypothesis test that uses a sample of students to determine whether the average age of students is NOW significantly larger students to determine whether the average age of students is NOW significantly larger than 21. than 21.
9
Null and Alternative Hypotheses
The average age of students has not The average age of students has not increased with recent recruitment of increased with recent recruitment of non-traditional students.non-traditional students.
The average age of students has The average age of students has increased due to recent recruitmentincreased due to recent recruitmentof non-traditional students.of non-traditional students.
HHaa::
where: where: = average age of students at the local = average age of students at the local university. university.
HH00: :
10
Type I Error
Because hypothesis testing is to use sample data to make inference on population parameters, we must allow for Because hypothesis testing is to use sample data to make inference on population parameters, we must allow for the possibility of errors.the possibility of errors.
A Type I error is rejecting A Type I error is rejecting HHoo when it is true. when it is true. The probability of making a Type I error when the null hypothesis is true as an equality is called the level of The probability of making a Type I error when the null hypothesis is true as an equality is called the level of
significance (significance (denoted as ‘denoted as ‘’’).). Applications of hypothesis testing that only control the Type I error are often called significance tests.Applications of hypothesis testing that only control the Type I error are often called significance tests.
11
Type II Error
A Type II error is accepting HA Type II error is accepting H00 when it is false. when it is false. It is difficult to control for the probability of It is difficult to control for the probability of
making a Type II error.making a Type II error. Statisticians avoid the risk of making a Type II Statisticians avoid the risk of making a Type II
error by using ‘do not reject Herror by using ‘do not reject H00’ and not ‘accept ’ and not ‘accept HH00’.’.
12
Type I and Type II Errors
CorrectCorrectDecisionDecision Type II ErrorType II Error
CorrectCorrectDecisionDecisionType I ErrorType I ErrorRejectReject HH00
(Conclude (Conclude > 12) > 12)
AcceptAccept HH00
(Conclude(Conclude << 12) 12)
HH0 0 TrueTrue(( << 12) 12)
HH0 0 FalseFalse
(( > 12) > 12)
Conclusion of Conclusion of Hypothesis Hypothesis
TestingTesting
Actual Population Condition Actual Population Condition
13
p-Value Approach to One-Tailed Hypothesis Testing
The pp-value-value is the probability of obtaining a is the probability of obtaining a sample statistic that is sample statistic that is at least as large asat least as large as the the observed one (in absolute value) if we assume that observed one (in absolute value) if we assume that the null hypothesis is true. the null hypothesis is true.
If the the If the the pp-value is less than or equal to the level -value is less than or equal to the level of significance of significance , the value of the test statistic , the value of the test statistic falls into the rejection region.falls into the rejection region.
Reject Reject HH00 if the if the pp-value -value ..
14
Critical Value Approach to One-Tailed Hypothesis Testing
Suppose the test statistic z has a standard normal probability distribution. Given the level of . Given the level of significance significance , , we can find the corresponding z value with an area of in the lower (or upper) tail of the distribution. This z value is called the Critical Value, and the tail area set by the z value is called the rejection area.
The rejection rule is:The rejection rule is:• Lower tail: Reject Lower tail: Reject HH00 if if zz << - -zz
• Upper tail: Reject Upper tail: Reject HH00 if if zz >> zz
15
Steps of Hypothesis Testing
Step 1. Develop the null and alternative hypotheses.Step 1. Develop the null and alternative hypotheses.
Step 2. Specify the level of significance Step 2. Specify the level of significance ..
Step 3. Collect the sample data and compute the test Step 3. Collect the sample data and compute the test statistic.statistic.
pp-Value Approach-Value Approach
Step 4. Use the value of the test statistic to compute theStep 4. Use the value of the test statistic to compute the pp-value.-value.
Step 5. Reject Step 5. Reject HH00 if if pp-value -value << ..
16
Steps of Hypothesis Testing
Critical Value Approach
Step 4. Use the level of significance to determine the critical value and the rejection rule.
Step 5. Use the value of the test statistic and the rejection rule to determine whether to reject H0.
17
One-Tailed Tests About A Population Mean: Known Known
Example: Student AgeExample: Student Age Continue with the example, the student record office randomly picked a Continue with the example, the student record office randomly picked a
sample of 49 students. The average age of the students in the sample is 23. sample of 49 students. The average age of the students in the sample is 23. Assume that the age pf Assume that the age pf student populationstudent population has a standard deviation of 5.5 years. has a standard deviation of 5.5 years.
Please perform a hypothesis test, at 5% level of significance, to determine Please perform a hypothesis test, at 5% level of significance, to determine whether the average age of students is NOW significantly larger than 21. whether the average age of students is NOW significantly larger than 21.
18
One-Tailed Tests About A Population Mean: Known Known
Example: Student AgeExample: Student Age1.1. Develop the hypothesis:Develop the hypothesis:
2.2. Specify the level of significance: Specify the level of significance:
3.3. Compute the test statistic:Compute the test statistic:
HH00: :
HHaa:: = .05= .05
545.2786.0
2
495.5
2123
n
xz
19
One-Tailed Tests About A Population Mean: Known Known
p-Value Approach4. Compute the p-value: Since this is an upper tail test, when z = 2.545, the upper tail area, i.e. the p-value = 0.0054=0.54%.
2.550z
The area to the left of 2.55 is
0.9946
The area to the right of 2.55 is
1-0.9946=0.0054
20
One-Tailed Tests About A Population Mean: Known Known
p-Value Approach
5. Determine whether to reject H0 :
Because p-value = 0.54%, which is << = 5%, we reject = 5%, we reject HH00. . To conclude our hypothesis testing, the sample evidence indicates that due to recent recruitment of non-traditional students, the average age of student population is significantly higher than 21.
21
One-Tailed Tests About A Population Mean: Known Known
p-Value Approach – Interpretation If the null hypothesis is true at equality, i.e. = 21, the
probability of observing a sample mean that is at least as large as 23 is 0.54% (the p-value). Since it is very unlikely to observe a sample mean >> 23 but we did obtain 23 from the random sample, we should have a reasonable doubt on the null hypothesis. For all the other population mean values under the null hypothesis ( >21), the p-value will be even smaller, i.e. it is even MORE unlikely to observe a sample mean >> 23.
Therefore, we are very confident in rejecting the null hypothesis. Nevertheless, keep in mind that we could have made a mistake, though the chance that we wrongfully reject H0 is only 5%.
22
One-Tailed Tests About A Population Mean: Known Known
Critical Value Approach4. Determine the critical value and rejection rule.
5. Determine whether to reject H0.
Because 2.55 >> 1.645, we reject H 1.645, we reject H00. Hence, we reach the same conclusion as that based on the p-value approach that the average age of student population is significantly higher than 21.. Hence, we reach the same conclusion as that based on the p-value approach that the average age of student population is significantly higher than 21.
For For aa = .05, = .05, zz.05.05 = 1.645 = 1.645
Reject Reject HH00 if if zz >> 1.645 1.645
23
One-Tailed Tests About A Population Mean: Known Known
Critical Value Approach
2.55
0z
The area to the right of 1.645 is 0.05, which is the rejection area. Our sample test statistic is 2.55, which falls into the rejection area. Hence, we
reject the H0.
1.645
24
p-Value Approach to Two-Tailed Hypothesis Testing
Compute the p-value using the following steps:1. Compute the value of the test statistic z;2. If z is positive, find the area under the standard normal curve to the right of z; If z is negative, find the area under the standard normal curve to the left of z.3. Double the tail area obtained from last step to get the p-value.
The rejection rule:
Reject H0 if the p-value < .
25
Critical Value Approach to Two-Tailed Hypothesis Testing
Determine the critical value using the following steps:
1. Half the level of significance ;2. Use the standard normal distribution table to
find z/2 , i.e. the z-value with an area of /2 in the upper tail of the distribution.
The rejection rule:Reject H0 if zz << - -z z /2/2 or or zz >> z z /2/2..
26
Two-Tailed Tests About A Population Mean: Known
Example: Paper Thickness Clarion Paper Company makes various types of paper
products. One of their products is a 30 mils thick paper. In order to ensure that the thickness of the paper meets the 30 mils specification, random cuts of paper are selected and the thickness of each cut is measured. A sample of 256 cuts had a mean thickness of 30.3 mils. Assuming the population standard deviation of paper thickness is known as 4 mils. Please perform a hypothesis test to determine if the average thickness of this particular paper product meets the 30 mils specification.
x
27
Two-Tailed Tests About A Population Mean: Known
Example: Paper Thickness1. Formulate the hypotheses:
2. Specify the level of significance:
3. Compute the test statistic:
HH00: : milsmils
HHaa: :
milsmils = .05= .05
2.125.0
3.0
2564
303.30
n
xz
28
Two-Tailed Tests About A Population Mean: Known
p-value Approach4. Compute the p-value: The area to the right of 1.2 is 1-0.8849 = 0.1151. So,
p-value = 2 0.1151 = 0.2302
5. Determine whether to reject H0: Because p-value = 0.2303, which is > = 0.05, we cannot
reject H0. Hence, the sample data indicate that this paper product meets the specification, i.e. the average thickness is insignificantly different from 30 mils.
29
Two-Tailed Tests About A Population Mean: Known
p-value Approach
0z
The area to the right of 1.2 is 0.1151. The p-value is twice as much as this tail area, I.e.
p-value = 2(0.1151) = 0.2302. Since the p-value is
larger than the level of significance 5%, we cannot
reject the H0.
1.2-1.2
30
Two-Tailed Tests About A Population Mean: Known
Critical Value Approach4. Determine the critical value and rejection rule:
For = 5%, z/2 = z0.025 = 1.96.
Reject H0 if sample test statistic z >1.96 or < -1.96
5. Determine whether to reject H0: Because the test statistic 1.2 < 1.96, we cannot
reject H0, the same conclusion as that based on the p-value approach.
31
Two-Tailed Tests About A Population Mean: Known
Critical Value Approach
1.2
0z
The areas to the right of 1.96 and to the left of –1.96 are
combined to be 0.05, which are the rejection areas. Our sample test statistic is 1.2, which falls outside of the rejection areas. Hence, we cannot reject the H0.
1.96-1.96
No Rejection Area
32
Tests About A Population Mean: Unknown
Test Statistic
txs n
0
/t
xs n
0
/
This test statistic has a This test statistic has a tt distribution distribution with with nn - 1 degrees of freedom. - 1 degrees of freedom.
33
Tests About A Population Mean: Unknown
Rejection Rule: p-Value ApproachReject H0 if p-value <
Rejection Rule: Critical Value Approach
HH00: : Reject Reject HH0 0 if if tt >> tt
Reject Reject HH0 0 if if tt << - -tt
Reject Reject HH0 0 if if tt << - - tt or or tt >> tt
HH00: :
HH00: :
34
p-Values and the t Distribution Most likely, you will not be able to determine the exact p-value from the t distribution table in our textbook. However, you can still obtain a range
for the p-value using the table, which is sufficient for you to determine whether or not to reject the null hypothesis. Of course, when using a computer statistical software package, you can obtain the precise p-value for the t distribution.
35
One-Tailed Test About A Population Mean: Unknown
Example: Gas Price
The average gasoline price of one of the major oil companies has been $3.50 per gallon. Because of cost reduction measures, it is believed that there has been a significant reduction in the average price. In order to test this belief, the oil company randomly selected a sample of 36 of its gas stations and determined that the average price for the stations in the sample was $3.45 and the standard deviation of the sample is $0.12. Use =.05 to test the hypothesis.
36
One-Tailed Test About A Population Mean: Unknown
Example: Gas Price
1. Formulate the hypotheses:
2. Specify the level of significance: =.05
3. Compute the value of the test statistic:
HH00: : >> 3.53.5HHaa: : < <
3.53.5
5.202.0
05.0
3612.0
5.345.3
ns
xt
37
One-Tailed Test About A Population Mean: Unknown
p-Value Approach 4. Compute the p-value: Check the t distribution table. Because for the row corresponding to
the degrees of freedom of 36-1 =35, the t = 2.5 is between 2.438 and 2.724, the p-value must be between .005 and .01, i.e.:
.005 < p-value < .01 Please note that the t distribution table does not include negative t
values. That’s because t distribution is symmetric around zero.
5. Determine whether to reject H0:
Because p-value < =.05, we reject H0. In conclusion, we are at least 95% confident that the average gas price has become lower than $3.5 per gallon and the cost reduction measures seem to have worked.
38
One-Tailed Test About A Population Mean: Unknown
Critical Value Approach 4. Determine the critical value and rejection rule:
For =.05 and d.f. = 36-1 =35, t.05 = 1.69. Since our test is a lower tail test, the rejection rule is:
Reject H0 if t < -1.69
5. Determine whether to reject H0:
Because the test statistic = -2.5 < -1.69, we reject H0. Thus, we have reached the same conclusion as that from the p-value approach.
39
One-Tailed Test About A Population Mean: Unknown
Critical Value Approach
t = -2.5
0t
The area to the right of -1.69 is 0.05, which is the rejection area. Our sample test statistic is -2.5,
which falls into the rejection area. Hence, we reject the H0.
t.05= -1.69
For d.f. = 36-1 =35
40
Null and Alternative Hypotheses about A Population Proportion
The equality part of the hypotheses always appears in the null The equality part of the hypotheses always appears in the null hypothesis. hypothesis.
In general, a hypothesis test about the value of a population In general, a hypothesis test about the value of a population proportion proportion pp must take one of the following three forms (where must take one of the following three forms (where pp00 is the hypothesized value of the population proportion). is the hypothesized value of the population proportion).
One-tailedOne-tailed(lower-tail)(lower-tail)
One-tailedOne-tailed(upper-tail)(upper-tail)
Two-tailedTwo-tailed
HH00: : pp >> pp00
HHaa: : pp < < pp00
HH00: : pp << pp00
HHaa: : pp > > pp00
HH00: : pp = = pp00
HHaa: : pp ≠ ≠ pp00
41
Tests About A Population Proportion
Test Statistic
assuming assuming npnp >> 5 and 5 and nn(1 – (1 – pp) ) >> 5 5
p
ppz
0
n
ppp
00 1
where:where:
42
Tests About A Population Proportion
Rejection Rule: p-Value Approach
HH00: : pppp Reject Reject HH0 0 if if zz >> zz
Reject Reject HH0 0 if if zz << - -zz
Reject Reject HH0 0 if if zz << - -zz or or zz >> zz
HH00: : pppp
Reject Reject HH0 0 if if p p –value –value <<
Rejection Rule: Critical Value ApproachRejection Rule: Critical Value Approach
HH00: : pppp
43
Two-Tailed Tests About A Population Proportion
Example: PC Market Share A popular computer company, APL, would like to find out if its market share has been affected recently due to the emergence of a few new competitors. The market share of APL in the
PC market has been stably sitting at 25%. A survey was conducted on 100 PC buyers and it revealed that 20 out of 100 purchased the PCs made by APL. Please conduct a hypothesis test, at 5% level of significance, to determine if the PC market share of APL has changed.
44
Two-Tailed Tests About A Population Proportion
Example: PC Market Share
1. Formulate the hypothesis:
2. Specify the level of significance:3. Compute the test statistic:
H0: p=.25
Ha: p.25
= .05= .05
0433.0
100
25.125.1 00
n
ppp
15.1
0433.
25.100/200
p
ppz
a commona commonerror is usingerror is using
in this in this formulaformula pp
45
Two-Tailed Tests About A Population Proportion
p-Value Approach:
4. Compute the p-value:
For z = -1.1547, the area to the left of z is .1251. So,
p-value = 2.1251=.2502
5. Determine whether to reject H0.
Because p-value = .2502 > = .05, we cannot reject H0. The PC market share of APL has not been affected by the new competitors.
46
Two-Tailed Tests About A Population Proportion
Critical Value Approach: 4. Determine the critical value and the rejection
rule:
For = .05, z/2=z.025=1.96
Reject H0 if z < -1.96 or z > 1.96
5. Determine whether to reject H0. Because the test statistic –1.15 > -1.96 and <
1.96, we cannot reject H0. The same conclusion is reached as that from the p-value approach.