Transcript Chapter 9
Chapter 9
Hypothesis Testing
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Hypothesis
• • • • Hypothesis is a statement population parameter.
about a certain It is usually about a parameter equal to (not equal to), less than or equal to ( greater than), greater than or equal to(or less than) some given number.
For example: the supporting rate of a candidate among all voters is greater than 50%.
A hypothesis testing is a statistical technique for evaluating if there is enough evidence to support a hypothesis. The strength of evidence is evaluated by the probability of certain statistic, called test statistic.
9-2
Rule of Rare Events
• If under probability current to assumption, observe the the sample (statistic) we have is extremely small, then we conclude the assumption is not right.
• How small is small?
if the probability to observe the sample is less than the Level of significance . =0.1, .05, .01
It is determined by the risk requirement of the problem. The risk is the probability to make a mistake. 9-3
Rule of Events, final version
• If under current assumption (H-null), the probability to observe the test statistic is , then we conclude the assumption is not right.
• If under H-null, the p-value is , then we conclude H-null assumption is not right.
9-4
How to set up the symbolic form of the hypothesis-
express relationship with math expressions
• Find out the hypothesis of interest about the population parameter (mean), and write down its symbolic expression. • Write down the symbolic expression of the complement.
• The expression with equal sign (=, ≤, ≥ ) is called H-null hypothesis (denoted by H 0 ), and the remaining expression not containing equal sign is called the H-A hypothesis (denoted by H a ). 9-5
Types of Hypotheses
• Right Sided tailed, “Greater Than” Alternative H 0 : 0 vs.
H a :
>
0 • Left Sided tailed, “Less Than” Alternative H 0 : 0 vs.
H a :
<
0 • Two Sided tailed, “Not Equal To” Alternative H 0 : = 0 vs. H a : 0 where 0 is a given constant value (with the appropriate units) that is a comparative value 9-6
• • •
Types of Hypotheses
-the red part is the conversion followed by some textbooks
Right-Sided (Right Tailed), “Greater Than” Alternative H 0 : 0 H 0 : = 0 vs.
vs.
H H a a : :
> >
0 0 Left-Sided (Left Tailed), “Less Than” Alternative H H 0 0 : 0 : = 0 vs.
vs.
H a H a : :
< <
0 0 Two-Sided (Two Tailed) , “Not Equal To” Alternative H 0 : = 0 vs. H a : 0 where 0 is a given constant value (with the appropriate units) that is a comparative value 9-7
Z Tests about a Population Mean: σ known
• The population standard deviation σ is known.
• Suppose the population being sampled is normally distributed, or sample size n is at least 30. Under these two conditions, use the Z distribution to calculate the p-value and then use the rule of rare events to perform the hypothesis testing.
9-8
Z Test Statistic σ is known
• Use the “test statistic”
t
.
s
.
x
n
0 • If the population is normal or n is large * , the test statistic t.s. follows a normal distribution *
n
≥
30, by the Central Limit Theorem 9-9
Z Tests about a Population Mean: σ known Alternative Type of test p-value
H a : µ > µ 0 H a : µ < µ 0 P(Z>t.s.) P(Z
Reject H 0
t
.
s
.
if:
p value≤
x
z
x
0
x
0
n
9-10
Right-tailed Test
• Right-tailed test: P(Z>t.s.) •
H
0 :
μ
≤
k
•
H
a :
μ
>
k
•
P
is the area to the right of the test statistic.
• -3 • -2 • -1 • 0 • 1 • Test statistic • 2 • 3 •
z
9-11
Left-tailed Test
• Left-tailed test: P(Z
H
0 :
μ
k
•
H
a :
μ
<
k
•
P
is the area to the left of the test statistic.
• 3 • 2 • • 1 Test statistic • 0 • 1 • 2 • 3 •
z
9-12
Two-tailed Test
Two-tailed test:
2*P(Z>t.s.) for t.s.>0 •
H
0 :
μ
=
k
•
H
a :
μ
k
•
P
is twice the area to the left of the negative test statistic.
2*P(Z
P
is twice the area to the right of the positive test statistic.
•
z
• -3 • -2 • -1 • Test statistic • 0 • 1 • Test statistic • 2 • 3 9-13
Hypothesis Testing Conclusion
• • If p value≤ , then we say we reject H null and accept Ha. If p-value> , we say we
fail to reject
H null and do not accept Ha. Never say we accept H-null. 9-14
Z Tests about a Population Mean: σ known, rejection region method
• To use the rule of rare events we only need to know the relationship between p-value and the given significance level. See slide 3. • The rejection region method explores the property and sets up rejection regions in which any value corresponds to a p-value less than the given significance level . That means if the t.s. is on the rejection region then we reject H 0 . 9-15
Z
a
and Right Hand Tail Areas
• The definition of the critical value Z α • The area to the right if 1 α • Z α • Z α is the percentile such that • P(Z< Z α ) =1 α 9-16
Right-tailed Test, rejection region
• Right-tailed test, for any given significance level •
H
0 :
μ
≤
k
•
H
a :
μ
>
k
• The area to the left of z is
α.
•
z
• -3 • -2 • -1 z • 0 • 1 • 2 • 3 • Test statistic 9-17
Left-tailed Test, rejection region
• Left-tailed test •
H
0 :
μ
k
•
H
a :
μ
<
k
The area to the left of z is
α.
•
z
• 3 • Test statistic • 2 • 1 • 0 -z • 1 • 2 • 3 9-18
Two-tailed Test, rejection region
•
Two-tailed test
The area to the left of z /2 is
α/2.
•
H
0 :
μ
=
k
•
H
a :
μ
k
The area to the right of z /2 is
α/2.
•
z
• -3 • -2 • -1 z /2 • 0 • 1 z /2 • 2 • 3 9-19
Z Tests about a Population Mean: σ known, rejection region method Alternative Reject H 0 if: Rejection region
H a :
μ
> µ 0 t.s
. ≥ z [z , ∞ ) H a :
μ
< µ 0 t.s
. ≤ –z ( ∞ , z ] H a :
μ
µ 0 either t.s
. ≥
z
/2 or t.s
. ≤ –
z
/2 Where the test statistics is ( ∞ , z /2 ] [z /2, ∞ )
t
.
s
.
x
0
n
9-20
t Tests about a Population Mean: σ Unknown
• The population standard deviation σ is unknown, as is the usual situation, but the sample standard deviation s is given. • The population being sampled is normally distributed or sample size is n≥30.
• Under these two conditions, we can use the t distribution to test hypotheses 9-21
Defining the t Statistic: σ Unknown
• • • • • Let x be the mean of a sample of size n with standard deviation s Also, µ 0 mean is the claimed value of the population Define a new test statistic
t
.
s
.
x s
0
n
If the population being sampled is normal or sample size is big enough, and s is given… The sampling distribution of the t.s. is a t distribution with n – 1 degrees of freedom 9-22
t Tests about a Population Mean: σ Unknown Continued Alternative Reject H 0 if: Rejection region
H a : µ > µ 0 t.s
. ≥ t [t , ∞ ) H a : µ < µ 0 t.s
. ≤ –t ( ∞ , t ] H a : µ µ 0
t.s.
≥
t
/2 or
t.s.
≤ –
t
/2 ( ∞ , t /2 ] [t /2, ∞ )
t
,
t
/2 , and p-values are based on
n
freedom (for a sample of size
n
) – 1 degrees of 9-23
Definition of the critical value t
α
9-24
Type I and Type II errors
• If we reject H 0 , then it is possible to make type I error • If we fail to reject H 0 and do not accept H a (or equivalently: fail to reject H 0 and reject H a ), then it is possible to make type II error. 9-25
Selecting an Appropriate Test Statistic for a Test about a Population Mean
9-26