Hypothesis Test
Hypothesis Test
INTRODUCTION
complementary
statements
Example
Solution:
H0: μ ≥ 20 ounces Null Hypothesis (Claim)
Ha: μ < 20 ounces Alternative Hypothesis
Components of Hypothesis Test
1. The hypothesis
Null Hypothesis (H0):
Alternative Hypothesis (H1):
2. The test statistic
3. The rejection region or its p-value :
A rule that tells us for which values of the test statistic, or
for which p-values, the null hypothesis should be rejected.
4. Conclusion:
Accept H0
Reject H0
Decision/Conclusion Rule
Depends on the significance level, α, the maximum
tolerable risk you want to have of making a mistake, if
you decide to reject H0. Usually, the significance level
is α = .01 or α = .05.
Decision
t > t table
Based on Critical Values Reject H0
z > z table
Based on p-values p <α Reject H0
Possible Results
Actual Situation
H0 is true H1 is true
α 1−β
Reject H0
Type I Error Power
Decision
Accept H0
β
1−α Type II Error
Define:
α = P(Type I error) = P(reject H0 when H0 is true)
β =P(Type II error) = P(accept H0 when H1 is true)
Type I and Type II Errors
α
Level of Significance
Example:
The test statistic for a right-tailed test is z = 1.56. Find the P-value.
Example:
The P-value for a hypothesis test is P = 0.0594. What is
your decision if the level of significance is
a.) 0.05,
b.) 0.1?
a.) Because 0.0594 is > 0.05, you should accept the null
hypothesis.
H 0 : μ = μ0 H 0 : μ = μ0 H 0 : μ = μ0
H1 : μ ≠ μ0 H1 : μ < μ0 H1 : μ > μ 0
Two-tailed One-tailed One-tailed
Assumptions
H 0 : μ = 880
H a : μ ≠ 880
Te st sta tistic :
x − μ 0 871 − 880
z≈ = = − 3 .0 3
s/ n 21 / 50
Solution
What is the critical value of z that
cuts off exactly α/2 = .01/2 = .005 in the tail of the z
distribution?
For our example, z = -3.03
falls in the rejection region
and H0 is rejected at the
1% significance level.
99% CI for μ
(863.35, 878.65)
Example 2
0.025 0.025
z
−z0 = −1.96 0 z0 = 1.96
Continued.
Solution
Test statistic :
x − μ 0 252,000 − 250,000
z≈ = = 1.07
s/ n 15,000 / 64
Example 3 (Decision based on critical Value)
•Rejection Region: Reject H0 if z > 2.33. If the test statistic falls in the
rejection region, its p-value will be less than α = .01.
Example 3 (Decision based on p Value)
0 0.45 t
z=
( x1 − x2 ) − Δ 0
2 2
s s
1
+ 2
n1 n2
For Small Sample
Test Statistic: Small Sample
Equal Variances Unequal Variances
x1 − x2
t=
s12 s22
t=
(x1 − x2 ) − Δ 0 +
n1 n2
1 1
s +
2
n1 n2
How to check the reasonable equality of variance assumption?
Rule of Thumb
2
larger s Assume that the
2
≤3 variances are equal
smaller s
larger DO NOT Assume that
smaller the variances are equal
Example 1
H0 : μ1 − μ2 = 0 (same)
Ha : μ1 − μ2 ≠ 0 (different)
T e st sta tistic :
x1 − x 2 − 0 756 − 762 − 0
z≈ = = − .9 2
2 2 2 2
s1 s 2 35 30
+ +
n1 n 2 50 50
Example 2
d
–t0 μd t0
t test for Difference between Means
Symbol Description
n The number of pairs of data
d The difference between entries for a data pair, d = x1 – x2
μd The hypothesized mean of the differences of paired data
in the population
d The mean of the differences between the paired data
entries in the dependent samples
d = d
n
sd The standard deviation of the differences between the
paired data entries in the dependent samples
2
n( d 2 ) − (d )
sd =
n(n − 1)
The Test Statistics
To test H 0 : μ1 − μ 2 = μ 0 we test H 0 : μ d = μ 0
using the test statistic
d − μ0
t=
sd / n
where n = number of pairs, d and sd are the
mean and standard deviation of the differences, d i .
Use the p - value or a rejection region based on
a t - distribution with df = n − 1.
Example
Student 1 2 3 4 5 6
Score (before) 85 96 70 76 81 78
Score (after) 88 85 89 86 92 89
H 0 : μd ≤ 0
Ha: μd > 0 (Claim)
Solution
H 0 : μd ≤ 0 α = 0.05
d = d • 7.167
n
n( d 2 ) − ( d )2 = 6(833) − 1849 ≈ 104.967 ≈ 10.245
sd = 6(5)
n(n − 1)
Solution
-3 -2 -1 0 1 2 3
t
tα = 2.015 d.f. = 6 – 1 = 5
d − μd 7.167 0
t= 1.714.
sd n 10.245
6
Fail to reject H0.
There is not enough evidence at the 5% level to support
the claim that the students’ scores after the course are
better than the scores before the course.