#### Transcript Chapter 9

```Chapter 9
Hypothesis Testing
McGraw-Hill/Irwin
Hypothesis
• Hypothesis is a statement about a certain
population parameter.
• 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 current assumption, the
probability to observe 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 hypothesisexpress 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
H0 ), and the remaining expression not
containing equal sign is called the H-A
hypothesis (denoted by Ha).
9-5
Types of Hypotheses
• Right-Sided tailed, “Greater Than” Alternative
H0:   0 vs.
Ha:  > 0
• Left-Sided tailed, “Less Than” Alternative
H0 :   0 vs.
Ha :  < 0
• Two-Sided tailed, “Not Equal To” Alternative
H0 :  = 0 vs.
Ha :   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
H0:   0 vs.
Ha:  > 0
H0:  = 0 vs.
Ha:  > 0
• Left-Sided (Left-Tailed), “Less Than” Alternative
H0 :   0 vs.
Ha :  < 0
H0 :  = 0 vs.
Ha :  < 0
• Two-Sided (Two-Tailed) , “Not Equal To” Alternative
H0 :  = 0 vs.
Ha :   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”
x  0
t.s. 
 n
• 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
Ha: µ > µ0
P(Z>t.s.)
Ha: µ < µ0
P(Z<t.s.)
Ha: µ  µ0
2*P(Z>t.s.) for t.s.>0
2*P(Z<t.s.) for t.s.<0
Reject H0 if: p-value≤
t.s.  z 
x  0
x
x  0

 n
9-10
Right-tailed Test
• Right-tailed test: P(Z>t.s.)
•H0: μ ≤ k
•P is the
area to the
right of the
test statistic.
•Ha: μ > k
•-3
•-2
•-1
•0
•1
•2
•3
•z
•Test
statistic
9-11
Left-tailed Test
• Left-tailed test: P(Z<t.s.)
•H0: μ  k
•Ha: μ < k
•P is the area to
the left of the
test statistic.
•3
•2
•1
•0
•1
•2
•3
•z
•Test
statistic
9-12
Two-tailed Test
Two-tailed test:
2*P(Z>t.s.) for t.s.>0
2*P(Z<t.s.) for t.s.<0
•H0: μ = k
•Ha: μ  k
•P is twice the
area to the right
of the positive
test statistic.
•P is twice the
area to the left of
the negative test
statistic.
•-3
•-2
•-1
•Test
statistic
•0
•1
•2
•Test
statistic
•3
•z
9-13
Hypothesis Testing Conclusion
• If p-value≤, then we say we reject Hnull and accept Ha.
• If p-value>, we say we fail to reject Hnull 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 H0.
9-15
Za 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 
•H0: μ ≤ k
•The area to
the left of z
is α.
•Ha: μ > k
•-3
•-2
•-1
z
•0
•1
•2
•3
•Test
statistic
•z
9-17
Left-tailed Test, rejection region
• Left-tailed test
•H0: μ  k
•Ha: μ < k
The area to the
left of -z is α.
•3
•Test
statistic
•2
•1
•0
•1
•2
•3
•z
-z
9-18
Two-tailed Test, rejection region
• Two-tailed test
•H0: μ = k
•Ha: μ  k
The area to the
left of -z/2 is
α/2.
•-3
•-2
•-1
-z/2
•0
•1
•2
The area to
the right of
z/2 is α/2.
•3
•z
z/2
9-19
Z Tests about a Population Mean:
σ known, rejection region method
Alternative Reject H0 if: Rejection region
Ha: μ> µ0
t.s. ≥ z
[z,
Ha: μ < µ0
t.s. ≤ –z
(-∞, -z]
Ha: μ  µ0
either
(-∞, -z/2]
∞)
[z/2,
∞)
t.s. ≥ z/2 or
t.s. ≤ –z/2
Where the test statistics is
x  0
t.s. 
 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 is the claimed value of the population
mean
• Define a new test statistic
x  0
t.s. 
s 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 H0 if: Rejection region
Ha: µ > µ0
t.s. ≥ t
[t,
Ha: µ < µ0
t.s. ≤ –t
(-∞, -t]
Ha: µ  µ0
t.s. ≥ t/2
(-∞, -t/2]
∞)
[t/2,
∞)
or
t.s. ≤ –t/2
t, t/2, and p-values are based on n – 1 degrees of
freedom (for a sample of size n)
9-23
Definition of the critical value tα
9-24
Type I and Type II errors
• If we reject H0 , then it is possible to
make type I error
• If we fail to reject H0 and do not accept
Ha (or equivalently: fail to reject H0 and
reject Ha ), 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
```