Download Ch9 - YSU

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
Chapter 9
Hypothesis Testing
1
Chapter Outline
 Developing Null and Alternative Hypothesis
 Type I and Type II Errors
 Population Mean:  Known
 Population Mean:  Unknown
 Population Proportion
2
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.
3
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.
4
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 than
the existing drug.
– Null Hypothesis:
The new drug does not lower bad cholesterol more than
the existing drug.
5
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
average weight of the can is at least ( > ) 2 lbs.
– Alternative Hypothesis:
The label (the claim) is incorrect, i.e. the population
average weight of the can is less than (< ) 2 lbs.
6
Null and Alternative Hypotheses about A
Population Mean
 The equality part of the hypotheses always appears in the
null hypothesis.
 In general, a hypothesis test about the value of a population
mean µ must take one of the following three forms (where
µ0 is the hypothesized value of the population mean).
H 0 :   0
H a :   0
H 0 :   0
H a :   0
H 0 :   0
H a :   0
One-tailed
(lower-tail)
One-tailed
(upper-tail)
Two-tailed
7
Null and Alternative Hypotheses
 Example: Student Age
A local university recently have recruited more nontraditional students (students who 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.
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 than 21.
8
Null and Alternative Hypotheses
H0:   21
The average age of students has not
increased with recent recruitment of
non-traditional students.
Ha: 21
The average age of students has
increased due to recent recruitment
of non-traditional students.
where:  = average age of students at the local
university.
9
Type I Error
 Because hypothesis testing is to use sample data to
make inference on population parameters, we
must allow for the possibility of errors.
 A Type I error is rejecting Ho 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 significance (denoted as ‘’).
 Applications of hypothesis testing that only
control the Type I error are often called
significance tests.
10
Type II Error
 A Type II error is accepting H0 when it is false.
 It is difficult to control for the probability of
making a Type II error.
 Statisticians avoid the risk of making a Type II
error by using ‘do not reject H0’ and not ‘accept
H0’.
11
Type I and Type II Errors
Actual Population Condition
Conclusion of
Hypothesis
Testing
H0 True
( < 12)
H0 False
( > 12)
Accept H0
(Conclude  < 12)
Correct
Decision
Type II Error
Type I Error
Correct
Decision
Reject H0
(Conclude  > 12)
12
p-Value Approach to
One-Tailed Hypothesis Testing
 The p-value is the probability of obtaining a
sample statistic that is at least as large as the
observed one (in absolute value) if we assume that
the null hypothesis is true.
 If the the p-value is less than or equal to the level
of significance  , the value of the test statistic
falls into the rejection region.
 Reject H0 if the p-value  .
13
Critical Value Approach to
One-Tailed Hypothesis Testing
 Suppose the test statistic z has a standard normal
probability distribution. Given the level of
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:
• Lower tail: Reject H0 if z < -z
• Upper tail: Reject H0 if z > z
14
Steps of Hypothesis Testing
Step 1. Develop the null and alternative hypotheses.
Step 2. Specify the level of significance .
Step 3. Collect the sample data and compute the test
statistic.
p-Value Approach
Step 4. Use the value of the test statistic to compute the
p-value.
Step 5. Reject H0 if p-value < .
15
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.
16
One-Tailed Tests About A Population Mean:
 Known
 Example: Student Age
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. Assume that the age pf
student population has a standard deviation of 5.5 years.
Please perform a hypothesis test, at 5% level of
significance, to determine whether the average age of
students is NOW significantly larger than 21.
17
One-Tailed Tests About A Population Mean:
 Known

Example: Student Age
1. Develop the hypothesis:
H0:   21
Ha: 21
2. Specify the level of significance:  = .05
3. Compute the test statistic:
x
23  21
2
z


 2.545

5.5
0.786
n
49
18
One-Tailed Tests About A Population Mean:
 Known

p-Value Approach
4. 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%.
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
z
0
2.55
19
One-Tailed Tests About A Population Mean:
 Known

p-Value Approach
5. Determine whether to reject H0 :
Because p-value = 0.54%, which is <  = 5%, we
reject H0.
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.
20
One-Tailed Tests About A Population Mean:
 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%.
21
One-Tailed Tests About A Population Mean:
 Known

Critical Value Approach
4. Determine the critical value and rejection rule.
For a = .05, z.05 = 1.645
Reject H0 if z > 1.645
5. Determine whether to reject H0.
Because 2.55 > 1.645, we reject H0. Hence, we
reach the same conclusion as that based on the pvalue approach that the average age of student
population is significantly higher than 21.
22
One-Tailed Tests About A Population Mean:
 Known

Critical Value Approach
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.
z
0
1.645
2.55
23
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 <  .
24
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 z < -z /2 or z > z /2.
25
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 milsx 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.
26
Two-Tailed Tests About A Population Mean:
 Known

Example: Paper Thickness
1. Formulate the hypotheses: H0:  30mils
Ha:   30mils
2.
Specify the level of significance:  = .05
3.
Compute the test statistic:
x
30.3  30 0.3
z


 1.2

4
0.25
256
n
27
Two-Tailed Tests About A Population Mean:
 Known

p-value Approach
4. 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.
28
Two-Tailed Tests About A Population Mean:
 Known

p-value Approach
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.
z
-1.2
0
1.2
29
Two-Tailed Tests About A Population Mean:
 Known

Critical Value Approach
4. 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 pvalue approach.
30
Two-Tailed Tests About A Population Mean:
 Known

Critical Value Approach
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.
No Rejection Area
z
-1.96
0
1.96
1.2
31
Tests About A Population Mean:
 Unknown

Test Statistic
x  0
t
s/ n
This test statistic has a t distribution
with n - 1 degrees of freedom.
32
Tests About A Population Mean:
 Unknown

Rejection Rule: p-Value Approach
Reject H0 if p-value < 

Rejection Rule: Critical Value Approach
H0:   0
Reject H0 if t < -t
H0:   0
Reject H0 if t > t
H0: 0
Reject H0 if t < - t2 or t > t2
33
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 pvalue for the t distribution.
34
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.
35
One-Tailed Test About A Population Mean:
 Unknown

Example: Gas Price
1. Formulate the hypotheses: H0:  > 3.5
Ha:  < 3.5
2. Specify the level of significance:  =.05
3. Compute the value of the test statistic:
t
x
s
n

3.45  3.5
0.12
 0.05

 2.5
0.02
36
36
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.
37
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.
38
One-Tailed Test About A Population Mean:
 Unknown

Critical Value Approach
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
t.05= -1.69 0
t = -2.5
For d.f. = 36-1 =35
39
Null and Alternative Hypotheses about A
Population Proportion
 The equality part of the hypotheses always appears in the
null hypothesis.
 In general, a hypothesis test about the value of a population
proportion p must take one of the following three forms
(where p0 is the hypothesized value of the population
proportion).
H0: p > p0
Ha: p < p0
H0: p < p0
H0: p = p0
H a : p > p0
Ha: p ≠ p0
One-tailed
(lower-tail)
One-tailed
(upper-tail)
Two-tailed
40
Tests About A Population Proportion
 Test Statistic
z
p  p0
p
where:
p 
p0 1 p0 
n
assuming np > 5 and n(1 – p) > 5
41
Tests About A Population Proportion
 Rejection Rule: p-Value Approach
Reject H0 if p –value < 
 Rejection Rule: Critical Value Approach
H0: p  p0
Reject H0 if z > z
H0: p  p0
Reject H0 if z < -z
H0: pp0
Reject H0 if z < -z2 or z > z2
42
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.
43
Two-Tailed Tests About A
Population Proportion

Example: PC Market Share
1. Formulate the hypothesis:
H0: p=.25
Ha: p.25
2. Specify the level of significance:  = .05
3. Compute the test statistic:
a common
error is using
p in this
formula
p 
z
p0 1  p0 
.251  .25

 0.0433
n
100
p  p0
p

20 / 100  .25

 1.15
.0433
44
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.
45
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.
46