7_Hypothesis testing-
7_Hypothesis testing-
population proportion
Population
Sample
The Hypothesis Testing
Process
Suppose the sample mean age was X = 20.
This is significantly lower than the claimed mean
population age of 50.
If the null hypothesis were true, the probability of
getting such a different sample mean would be very
small, so you reject the null hypothesis .
In other words, getting a sample mean of 20 is so
unlikely if the population mean was 50, you
conclude that the population mean must not be 50.
The Hypothesis Testing
Process
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 ... ... if in fact this were
the population mean…
The Test Statistic and
Critical Values
If the sample mean 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 H ?
0
The critical value of a test statistic creates a
“line in the sand” for decision making.
The Test Statistic and
Critical Values
Distribution of the test statistic
Region of Region of
Rejection Rejection
Critical Values
Errors in Decision Making
Type I Error
Reject a true null hypothesis
Considered a serious type of error
The probability of a Type I Error is
Actual Situation
H0: μ ≥ 50
Lower-tail test
H1: μ < 50
0
Hypothesis Testing: σ Known
X μ
Z
σ
n
Determine the critical Z values for a specified
level of significance from a table or by using Excel
Decision Rule: If the test statistic falls in the rejection
region, reject H0 ; otherwise do not reject H0
Hypothesis Testing: σ Known
H 0: μ = 3
There are two
H 1: μ ≠
cutoff values
(critical values), 3
defining the /2 /2
regions of
rejection
3 X
Reject H0 Do not reject H0 Reject H0
-Z +Z Z
0
Lower Upper
critical critical
value value
Hypothesis Testing: σ Known
n = 100, X = 2.84
(σ = 0.8 is assumed known from past company records)
So the test statistic is: Z
X μ
2.84 3
.16
2.0
σ 0.8 .08
n 100
Hypothesis Testing: σ Known
Is the test statistic in the rejection region?
= .05/2 = .05/2
X = 2.84 is translated to a Z
score of Z = -2.0 /2 = .025 /2 = .025
P(Z 2.0) .0228 .0228 .0228
P(Z 2.0) .0228
p-value
=.0228 + .0228 -1.96 0 1.96 Z
= .0456 -2.0 2.0
Hypothesis Testing: σ Known
p-Value Approach
Compare the p-value with
If p-value < , reject H0
2.6832 ≤ μ ≤ 2.9968
Critical value
Hypothesis Testing: σ Known
Upper Tail Tests
There is only one critical value, since the
rejection area is in only one tail.
Critical value
Hypothesis Testing: σ Known
Upper Tail Test Example
A phone industry manager thinks that customer
monthly cell phone bills have increased, and now
average more than $52 per month. The company
wishes to test this claim. Past company records
indicate that the standard deviation is about $10.
1- = .90
= .10
X μ 53.1 52
Z 0.88
σ 10
n 64
Hypothesis Testing: σ Known
Upper Tail Test Example
Reach a decision and interpret the result:
Reject H0
1- = .90
= .10
0 1.28
Z = .88
Reject H0
P( X 53.1)
= .10
53.1 52.0
P Z
10/ 64
0
Do not reject
1.28
Reject H0 P(Z 0.88) 1 .8106
H0
Z = .88 .1894
X μ
t n -1
S
n
Hypothesis Testing:
σ Unknown Example
The mean cost of a hotel room in New York is said
to be $168 per night. A random sample of 25 hotels
resulted in X = $172.50 and S = 15.40. Test at the
= 0.05 level.
H0: μ=
168 H1:
μ 168
Hypothesis Testing:
σ Unknown Example
H0: μ = 168
Determine the regions of rejection
H1: μ ≠ 168
α = 0.05
n = 25 α/2=.025 α/2=.025
is unknown, so
use a t statistic Reject H0 Reject H0
Do not reject H0 t n-1,α/2
Critical Value: -t n-1,α/2 0
t24 = ± 2.0639 -2.0639 2.0639
Hypothesis Testing:
σ Unknown Example
X μ 172.50 168
t n 1 1.46
S 15.40
n 25
a/2=.025 a/2=.025
-t n-1,α/2 t n-1,α/2
0 1.46
-2.0639 2.0639
Do not reject H0: not sufficient evidence
that true mean cost is different from $168
Hypothesis Testing:
Connection to Confidence Intervals
For X = 172.5, S = 15.40 and n = 25, the 95%
confidence interval is:
15.4 15.4
172.5 - (2.0639) to 172.5 (2.0639)
25 25
166.14 ≤ μ ≤ 178.86
p
Z
(1 )
n
Hypothesis Testing
Proportions Example
A marketing company claims that it receives
8% responses from its mailing. To test this
claim, a random sample of 500 were
surveyed with 30 responses. Test at the
= .05 significance level.
First, check:
n π = (500)(.08) = 40
n(1-π) = (500)(.92) = 460
Hypothesis Testing
Proportions Example
0 z
-1.96 1.96
Hypothesis Testing
Proportions Example
Test Statistic: Decision:
p .06 .08 Do not reject H0 at
Z 1.648
(1 ) .08(1 .08) = .05
n 500 Conclusion:
There isn’t sufficient
evidence to reject the
.025 .025
company’s claim of
0 z 8% response rate.
-1.96 1.96
-1.646
Potential Pitfalls and
Ethical Considerations
Use randomly collected data to reduce selection
biases
Do not use human subjects without informed
consent
Choose the level of significance, α, before data
collection
Do not employ “data snooping” to choose between
one-tail and two-tail test, or to determine the level of
significance
Do not practice “data cleansing” to hide
observations that do not support a stated hypothesis
Report all pertinent findings