Hypothesis Testing
Hypothesis Testing
Hypothesis Testing
Luca Aguilar
May 2017
Introduction Tests for key distributions Relation between intervals and tests Classical approach
Overview
1 Introduction
1 Introduction
1 Introduction
H0 : p = p0 .
Introduction Tests for key distributions Relation between intervals and tests Classical approach
p p0
Z0 = p .
p0 (1 p0 )/n
p p0
Z0 = p .
p0 (1 p0 )/n
p p0
Z0 = p .
p0 (1 p0 )/n
p-value
Definition
The probability, under the null hypothesis, of observing a value
of the test statistic that is at least as extreme as its value for the
data.
p-value
p p0
Z0 = p .
p0 (1 p0 )/n
p-value
p-value
p-value
p-value
p-value
p-value
p-value
p-value
So, if the alternative hypothesis had been H1 : p 6= 0.55,
we would have rejected the null hypothesis H0 : p = 0.55
in favour of the alternative hypothesis at the 5%
significance level because 0.016 is less than 0.05.
If the alternative hypothesis had been H1 : p 0.55 we
would not have rejected the null hypothesis in favour of
the alternative hypothesis at the 5% significance level
because 0.992 is (much) greater than 0.05.
If the alternative hypothesis had been H1 : p 0.55 we
would have rejected the null hypothesis in favour of the
alternative hypothesis at the 5% significance level
because 0.008 is smaller than 0.05.
So, clearly, the result of a hypothesis test very much
depends on the alternative hypothesis being investigated,
not just the null hypothesis.
Introduction Tests for key distributions Relation between intervals and tests Classical approach
Example 2
Example 2
Example 2
Example 3
Example 3
Table 1 Summary of hypothesis tests with the column headings denoting: D, distribution; NH, null hypothesis; AH,
alternative hypothesis; TS, test statistic; SD, sampling distribution under the null hypothesis; PV, p-value.
D NH AH TS SD PV
pp0
Bernoulli p = p0 p 6= p0 Z0 = r N(0, 1) 2(|z0 |)
p0 (1p0 )
n
p < p0 (z0 )
p > p0 1 (z0 )
pp0
Binomial p = p0 p 6= p0 Z0 = r N(0, 1) 2(|z0 |)
p0 (1p0 )
kn
p < p0 (z0 )
p > p0 1 (z0 )
X
Poisson = 0 6= 0 Z0 = q 0 N(0, 1) 2(|z0 |)
0
n
< 0 (z0 )
> 0 1 (z0 )
Exponential = 0 =6 0 Z0 = 0 1 n N(0, 1) 2(|z0 |)
< 0 1 (z0 )
> 0 (z0 )
X 0
Normal = 0 6= 0 T0 = S
tn1 2Ft,n1 (|t0 |)
n
< 0 Ft,n1 (t0 )
> 0 1 Ft,n1 (t0 )
(n1)S 2
2 = 02 2 6= 02 C0 = 2n1 2 min F2 ,n1 (c0 ), 1 F2 ,n1 (c0 )
2
0
2 < 02 F2 ,n1 (c0 )
2 > 02 1 F2 ,n1 (c0 )
Introduction Tests for key distributions Relation between intervals and tests Classical approach
Table 2: Summary of the two types of errors that can occur when
performing an hypothesis test.
Accept H0 Reject H0
H0 true X Type I error
H0 false Type II error X