Professional Documents
Culture Documents
7.1
Introduction to
Hypothesis Testing
Hypothesis Tests
A hypothesis test is a process that uses sample statistics to
test a claim about the value of a population parameter.
Eg. 1. If a manufacturer of rechargeable batteries claims that the
batteries they produce are good for an average of at least 1,000
charges, a sample would be taken to test this claim.
Stating a Hypothesis
H subzero or H naught
A null hypothesis H0 is a statistical hypothesis that
contains a statement of equality such as , =, or .
H sub-a
A alternative hypothesis Ha is the complement of the null
hypothesis. It is a statement that must be true if H0 is false
and contains a statement of inequality such as >, , or <.
Writing hypotheses: translate the claim from a verbal
statement to a mathematical statement.
Stating a Hypothesis
Example 1:
Right-tailed test
Complement of the
null hypothesis
P is the area to
the right of the
test statistic.
-3
-2
-1
1
2
Test
statistic
Stating a Hypothesis
Example 02. A cigarette manufacturer claims that less than
one-eighth of the US adult population smokes cigarettes.
H0: p 0.125
Ha: p < 0.125 (Claim)
Left-tailed test
P is the area to
the left of the
test statistic.
-3
-2
-1
Test
statistic
z
Stating a Hypothesis
Example 03. A local telephone company claims that the
average length of a phone call is 8 minutes.
H0: = 8 (Claim)
Ha: 8
Two-tailed test
P is twice the
P is twice the
-3
-2
-1
Test
statistic
z
Test
statistic
z
Stating a Hypothesis
Exercise:
Write the claim as a mathematical sentence. State the null and
alternative hypotheses and identify which represents the claim.
Condition of
equality
Types of Errors
Your
Decision
Actual Fact
Ho is true Ho is false
Accept Ho
Correct
Type II
Error
Reject Ho
Type I
Error
Correct
Statistical Tests
x
After stating the
Ho and Ha and specifying the level of
significance, a random sample is taken from the population
and sample statistics are calculated.
Test
statistic
X
p
2
p
s2
Standardized test
statistic
z (n 30)
t (n < 30)
z
X2
/2: level of
/2: level of
significance
significance
z
-3
-2
-1
-z/2
z/2
Left-tailed Test
1. If the alternative hypothesis contains the less-than
inequality symbol (<), the hypothesis test is a left-tailed
test.
H0: k
Ha: < k
P is the area to
the left of the
test statistic.
-3
-2
-1
Test
statistic
z
Right-tailed Test
2. If the alternative hypothesis contains the greater-than
symbol (>), the hypothesis test is a right-tailed test.
H0: k
Ha: > k
P is the area to
the right of the
test statistic.
-3
-2
-1
Test
statistic z
Two-tailed Test
3. If the alternative hypothesis contains the not-equal-to
symbol (), the hypothesis test is a two-tailed test. In a
two-tailed test, each tail has an area of P.
H0: = k
Ha: k
P is twice the
P is twice the
-3
-2
-1
Test
statistic
z
Test
statistic
z
Making a Decision
Decision Rule Based on P-value
To use a P-value to make a conclusion in a hypothesis test,
compare the P-value with .
1. If P , then reject H0.
2. If P > , then fail to reject H0.
Claim
Decision
Claim is H0
Claim is Ha
Reject H0
Do not reject H0
Interpreting a Decision
Example:
You perform a hypothesis test for the following claim. How
should you interpret your decision if you reject H0? If you fail
to reject H0?
H 0: ?
H a: ?
=?
z
Test statistic
Continued.
Yes
Reject H0.
7.2
p
2
Test
statistic
X
p
s2
Standardized test
statistic
z (n 30)
t (n < 30)
z
X2
1.56
z
0
Example:
b) The Observed test statistic for a two-tailed test is z = 3.03.
Find the P-value.
In Table 3, P-value = P(z>3.03) + P(z<-3.03)
=2P(z<-3.03) = 2(0.0012) = 0.0086
z x
n
standard error
x
n
In Symbols
Identify .
z x
n
Use Table 3 in
Appendix
Continued.
In Words
In Symbols
H0: 1000
(Claim)
The observed z is
z x 1002 1000
n
14 100
1.43
Continued.
1.43
= 0.01
0
2.33
Reject Ho.
zc
0
-2.33 -1.64 -1.28
0.01 0.05 0.10
Left-Tailed Test
Right-Tailed Test
Fail to reject Ho.
Reject Ho.
Reject Ho.
zc
Two-Tailed Test
zc
Reject Ho.
z < z
Reject Ho.
z
Left-Tailed Test
Reject Ho.
z < -z/2z/2
z/2
z>z
Right-Tailed Test
Reject Ho.
z > z/2
Two-Tailed Test
In Words
In Symbols
Identify .
z (Table 3)
In Words
6. Find the standardized test
statistic z .
In Symbols
z x or if n 30
n
use s.
H0: = 8 (Claim)
H a: 8
0.025
z= 1.96
z= 1.96
Continued.
Ha: 8
z x 7.8 8
n 0.5 58
3.05.
zc = 1.96
zc = 1.96
7.3
p
2
Test
statistic
X
p
s2
Standardized test
statistic
z (n 30)
t (n < 30)
z
X2
To find the critical value, use Table 4 with d.f. = 11 and 0.10
in the Two Tail, column. Because the test is a two-tail
test, one critical value is negative and one is positive.
t0 = 1.796 and t0 = 1.796
t x
s n
d.f. = n 1 .
In Words
In Symbols
Identify .
d.f. = n 1.
Use Table 4
In Words
6. Find the standardized test
statistic.
In Symbols
t x
s
n
If t is in the rejection
region, reject H0.
Otherwise, fail to
reject H0.
t x 7.8 8
s n
0.5 18
1.70.
t0 = 2.110
t0 = 2.110
= 0.01.
d.f. = 10 1 = 9
t x 1002 1000
s n
14 10
Or http://stattrek.com/onlinecalculator/t-distribution.aspx
0.45
0
0.45
At the 1% level of sig, there is not enough evidence to support the claim that
the rechargeable battery has an average life of at least 1000 charges.
Statistical Significance
The critical value approach and the P-value approach
always reach the same conclusion.
The P-value approach is often preferred because:
+ Computer printouts usually calculate P-value
+ after calculating the P-value, you can make a decision at
any significance level.
If the Ho hypothesis is rejected at =0.05, what should be
conclusion at significance level of 0.1?
7.4
Hypothesis Testing
Independent Samples
Dependent Samples
Hypothesis
For a two-sample hypothesis test,
1. the null hypothesis H0 is a statistical hypothesis that
usually states there is no difference between the
parameters of two populations. The null hypothesis always
contains the symbol , =, or .
1. the alternative hypothesis Ha is a statistical hypothesis that
is true when H0 is false. The alternative hypothesis always
contains the symbol >, , or <.
Test Statistic
For a two-sample hypothesis test,
1. If Both n130; n2 30 Use Z test
X1 X 2
S12 S 22
n1 n2
x x 2 1 2
t 1
x x
1
Variances equal
Variances not equal
x x
1
s12 s 22
n1 n2
x x 1 1
n1 n2
1
and d.f =
n1
+ n2 2.
Test statistic: Z
X1 X 2
S12 S 22
n1 n2
Avg. Daily
Intakes
Test statistic:
X1 X 2
S12 S 22
n1 n2
Men
Women
Sample size
50
50
Sample mean
756
762
35
30
756 762
352 30 2
50 50
0.92
In Words
In Symbols
Identify .
d.f. = n1+ n2 2 or
d.f. = smaller of n1 1
or n2 1.
Use Table 4
Continued.
In Words
In Symbols
x1 x 2 1 2
x x
1
If t is in the rejection
region, reject H0.
Otherwise, fail to
reject H0.
H0: 1 = 2
Ha: 1 2
=
(Claim) 0.005
d.f. = n1 + n2 2
= 17 + 18 2 = 33
=
0.005
-3
-2
-1
t0 = 2.576
t0 = 2.576
Continued.
H0: 1 = 2
Ha: 1 2 (Claim)
-3
-2
-1
t0 = 2.576
t0 = 2.576
n1
n2
n1 1 s12 n2 1 s 22
17 1 78002 18 1 73752
n1 n2 2
17 18 2
n1
n2
1
1
17 18
7584.0355(0.3382)
2564.92
Continued.
H0: 1 = 2
Ha: 1 2 (Claim)
-3
-2
-1
t0 = 2.576
t0 = 2.576
x x
1
35800 35100 0
2564.92
0.273
7.5
Hypothesis Testing
for Proportions
Population
parameter
p
2
Test
statistic
X
p
s2
Standardized test
statistic
z (n 30)
t (n < 30)
z
X2
p p
p
p
p
pq n
In Words
In Symbols
Identify .
Use Table 3
Continued.
In Words
In Symbols
z p p
pq n
If z is in the rejection
region, reject H0.
Otherwise, fail to
reject H0.
H0: p 0.94
0.95 0.94
z p p
pq n
(0.94)(0.06) 500
z 0.94
2.33
Reject H0.
z
z/2 = 1.96
z/2 = 1.96
populations
Data: a random sample of size n1 from binomial population 1 with
proportion p1 and a random sample of size n2 from binomial population
2 with proportion p2
The hypothesis of interest involves the difference, p1-p2, in the form:
H0: p1-p2 = 0 vs. Ha: one of the three alternatives
Two-sided: p1-p2 0
Left-sided: p1-p2 < 0
Right-sided: p1-p2 > 0
Youth Soccer
Male
Female
Sample size
80
70
Played soccer
65
39
p1q1 p2 q2
n1
n2
SE
1 1
p q
n1 n2
p p
1
SE
SE
Since the p-value < = .01, H0 is rejected There is strong evidence to indicate
that the rates of participation are different for boys and girls.
Exercising
Exercise 3. Internet
An Internet server claimed that its users averaged 13 hours
per day. To determine whether this was an overstatement, a
competitor conducted a survey of 250 customers and found
that the average time spent online was 10.5 hours per day
with a standard deviation of 5.2 hours.
Does the data provide sufficient evidence to indicate that the
average hours of users are less than that claimed by the first
Internet provider? Test at the 0.01 level of significance.
Exercise 3. Internet
An Internet server claimed that its users averaged 13 hrs/day. To
determine whether this was an overstatement, a competitor
conducted a survey of 250 customers and found that the average
time spent online was 10.5 hrs/day with a standard deviation of 5.2
hours. Does the data provide sufficient evidence to indicate that the
average hours of use are less than that claimed by the first Internet
provider? Test at the 0.01 level of significance.
7.5
Hypothesis Testing
for Variance and
Standard Deviation
(n 1)s 2
In Words
In Symbols
Identify .
d.f. = n 1
Use Table 6 in
Appendix B.
Continued.
In Words
In Symbols
(n 1)s 2
If 2 is in the
rejection region,
reject H0. Otherwise,
fail to reject H0.
H0: 30
Ha: < 30
(Claim)
X2
Continued.
= 2.088
0.01
X20
= 2.088
X2
(n 1)s 2
(10 1)(28.8)2
302
8.29
H0: 2 = 5 (Claim)
H a: 2 5
1
0.025
2
X2L
X2R
X2
Continued.
1
0.025
2
10.982
36.781
X2
Continued.
(n 1)s 2
(23 1)(4.5)
19.8 Fail to reject H0.
5
19.8
10.982
36.781
X2