Basics of Hypothesis Testing
Basics of Hypothesis Testing
Basics of Hypothesis Testing
In Chapter 9:
9.1 Null and Alternative Hypotheses
9.2 Test Statistic
9.3 P-Value
9.4 Significance Level
9.5 One-Sample z Test
9.6 Power and Sample Size
Statistics
Source
Population
Sample
Notation
Vary
No
Yes
Calculated
No
Yes
x ~ N , SE x
where SE x
n
Hypothesis Testing
x 0
SE x
and SE x
n
40
64
x 0 173 170
0.60
SE x
5
zstat
x 0 185 170
3.00
SE x
5
Reasoning Behinzstat
x ~ N 170,5
9.3 P-value
The P-value answer the question: What is the
probability of the observed test statistic or one
more extreme when H0 is true?
This corresponds to the AUC in the tail of the
Standard Normal distribution beyond the zstat.
Convert z statistics to P-value :
For Ha: > 0 P = Pr(Z > zstat) = right-tail beyond zstat
For Ha: < 0 P = Pr(Z < zstat) = left tail beyond zstat
For Ha: 0 P = 2 one-tailed P-value
Two-Sided P-Value
One-sided Ha
AUC in tail
beyond zstat
Two-sided Ha
consider potential
deviations in both
directions
double the onesided P-value
Examples: If one-sided P
= 0.0010, then two-sided
P = 2 0.0010 = 0.0020.
If one-sided P = 0.2743,
then two-sided P = 2
0.2743 = 0.5486.
Interpretation
P-value answer the question: What is the
probability of the observed test statistic
when H0 is true?
Thus, smaller and smaller P-values
provide stronger and stronger evidence
against H0
Small P-value strong evidence
Interpretation
Conventions*
P > 0.10 non-significant evidence against H0
0.05 < P 0.10 marginally significant evidence
0.01 < P 0.05 significant evidence against H0
P 0.01 highly significant evidence against H0
Examples
P =.27 non-significant evidence against H0
P =.01 highly significant evidence against H0
* It is unwise to draw firm borders for significance
z stat
x 0
where SE x
SE x
n
z stat
15
SE x
5
n
9
x 0 112 .8 100
2.56
SE x
5
Correct
retention
Type II error
Reject H0
Type I error
Correct rejection
probability of a Type I error
Probability of a Type II error
Power
probability of a Type II error
= Pr(retain H0 | H0 false)
(the | is read as given)
1 Power probability of avoiding a
Type II error
1 = Pr(reject H0 | H0 false)
Power of a z test
1 z1
2
| 0 a | n
where
(z) represent the cumulative probability
of Standard Normal Z
0 represent the population mean under
the null hypothesis
a represents the population mean under
the alternative hypothesis
| 0 a | n
1 z1
|
170
190
|
16
1.96
40
0.04
0.5160
z1 z1
2
where
1 desired power
desired significance level (two-sided)
population standard deviation
= 0 a the difference worth detecting
z1 z1
40 (1.28 1.96)
20
41.99
Illustration: conditions
for 90% power.