Hypothesis Testing
Hypothesis Testing
Testing
Learning Objectives
◼ population mean
Example: The mean monthly family
medication bill in Amman is μ = 42 Jd.
◼ population proportion
Example: The proportion of adults in this
city with asthma is π = 0.17
What is a Hypothesis?
H0 : μ = 3 H0 : X = 3
The Null Hypothesis, H0
(continued)
Sample
The Hypothesis Testing
Process (continued)
◼ Suppose the sample mean age was X = 20.
Sampling
Distribution of X
X
20 μ = 50
If H0 is true ... then you reject
If it is unlikely that you
the null hypothesis
would get a sample
that μ = 50.
mean of this value ... ... When in fact this were
the population mean…
The Test Statistic and
Critical Values
◼ If the sample mean (X) is close to the assumed
population mean, the null hypothesis is not
rejected.
◼ If the sample mean is far from the assumed
population mean, the null hypothesis is rejected.
◼ How far is “far enough” to reject H0?
◼ The critical value of a test statistic creates a “line in
the sand” for decision making -- it answers the
question of how far is far enough.
The Test Statistic and
Critical Values
◼ The General formula for Test Statistic:
X−μ
e.g.: Z test for the mean Z STAT =
σ
n
The Test Statistic and
Critical Values
Sampling Distribution of the test statistic
Region of Region of
Rejection Rejection
Region of
Non-Rejection
Critical Values
Actual Situation
◼ β when
◼ β when σ
◼ β when n
Level of Significance
and the Rejection Region
H0: μ = 3 Level of significance =
H1: μ ≠ 3
/2 /2
Critical values
Rejection Region
Hypothesis
Tests for
(Z test) (t test)
assumptions assumptions
Z Test of Hypothesis for the
Mean (σ Known)
◼ Convert sample statistic ( X ) to a ZSTAT test statistic
Hypothesis
Tests for
σ
(ZKnown
test) σ(tUnknown
test)
-Zα/2 0 +Zα/2 Z
Lower Upper
critical critical
value value
6 Steps in CV
Hypothesis Testing
1. State the null hypothesis, H0 and the alternative
hypothesis, H1 (one tail or two tails test)
2. Choose the level of significance, , and the
sample size, n
3. Determine the appropriate test statistic and
sampling distribution
4. Determine the critical values that divide the
rejection and non-rejection regions
6 Steps in CV
Hypothesis Testing
(continued)
test
CV Hypothesis Testing Example
(continued)
= 0.05/2 = 0.05/2
◼ Remember
◼ If the p-value is low then H0 must go
The 5 Step p-value approach to
Hypothesis Testing
1. State the null hypothesis, H0 and the alternative
hypothesis, H1
2. Choose the level of significance, , and the sample size, n
4. Collect data and compute the value of the test statistic and
the p-value
X − μ 2.84 − 3 − .16
Z STAT = = = = − 2.0
σ 0.8 .08
n 100
p-Value Hypothesis Testing Example:
Calculating the p-value
4. (continued) Calculate the p-value.
◼ How likely is it to get a ZSTAT of -2 (or something further from the
mean (0), in either direction) if H0 is true?
0 Z
-2.0 2.0
p-value = 0.0228 + 0.0228 = 0.0456
p-value Hypothesis Testing
Example
(continued)
2.6832 ≤ μ ≤ 2.9968
◼ Probably not!
σKnown
Known σUnknown
Unknown
(Z test) (t test)
The test statistic is:
X−μ
t STAT =
S
n
Example: Two-Tail Test
( Unknown)
The average wage of a
pharmacist in New York is
said to be $168 per week.
To determine if this is true, a
random sample of 25
pharmacists is taken and
resulted in an X of $172.50 H0: μ = 168
and an S of $15.40. Test the H1: μ 168
appropriate hypotheses at
= 0.05.
(Assume the population distribution is normal)
CV Example Solution:
Two-Tail t Test
Data
Null Hypothesis µ= $ 168.00
Level of Significance 0.05
Sample Size 25
Sample Mean $ 172.50
Sample Standard Deviation $ 15.40
Intermediate Calculations
Standard Error of the Mean $ 3.08 =B8/SQRT(B6)
Degrees of Freedom 24 =B6-1
t test statistic 1.46 =(B7-B4)/B11
Two-Tail Test
p-value > α Lower Critical Value
Upper Critical Value
-2.0639 =-TINV(B5,B12)
2.0639 =TINV(B5,B12)
So do not reject H0 p-value 0.157 =TDIST(ABS(B13),B12,2)
Do Not Reject Null Hypothesis =IF(B18<B5, "Reject null hypothesis",
"Do not reject null hypothesis")
Connection of Two Tail Tests to
Confidence Intervals
◼ For X = 172.5, S = 15.40 and n = 25, the 95%
confidence interval for µ is:
166.14 ≤ μ ≤ 178.86
μ X
Critical value
Upper-Tail Tests
H0: μ ≤ 3
◼ There is only one
critical value, since H1: μ > 3
the rejection area is
in only one tail
Critical value
Example: Upper-Tail t Test
for Mean ( unknown)
A phone industry manager thinks that
customer monthly cell phone bills have
increased, and now average over $52 per
month. The company wishes to test this
claim. (Assume a normal population)
= 0.10
X−μ 53.1 − 52
t STAT = = = 0.55
S 10
n 25
Example: Decision
(continued)
Reach a decision and interpret the result:
Reject H0
= 0.10