Title: Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing
1Introduction to Biostatistics(BIO/EPI 540)
Lecture 11 Hypothesis Testing
Acknowledgement Thanks to Professor Pagano
(Harvard School of Public Health) for lecture
material
2Testing
No human investigation can be called true
science without passing through mathematical
tests. Leonardo da Vinci (1452-1519)
(in Treatise on Painting)
3Sampling Paradigm
Inference
µ,
s
Population
,S
Sample
4Inference
- Sample mean is an estimate of
- Sample variance (S) is an estimate
- of
- Confidence intervals and
- hypothesis tests are equivalent
- techniques to quantify uncertainty
- in sample derived inferences
- regarding population parameters
µ
s2
5Confidence Interval - Illustration
We know that cholesterol levels in US men 20-24
yrs are normally distributed with sX ? 46
mg/100ml. We obtain a sample of n25 and want
to infer µ.
6Use of C.I. to infer value
value of µ
7Population mean 211?
IF 95 C.I.
? 200 mg/100ml (182,218)
8Population mean 211?
IF 95 C.I.
? 200 mg/100ml (182,218)
? 190 mg/100ml (172,208)
9Population mean 211?
IF 95 C.I.
? 200 mg/100ml (182,218)
? 190 mg/100ml (172,208)
? 175 mg/100ml (157,193)
10If true
- Alternatively IF
- 211 and ? 46 and we take a
- sample of size n25 from this pop.,
- then the Central Limit Theorem
- says that the sample mean is
- approx. normal with mean ? 211
- and std. dev. 46/5 i.e.
11Hypothesis Testing
- Hypothesis Testing Trial by jury
12Hypothesis Testing Trial by jury
Individual on trial. Is he/she innocent?
Evidence
Trial
13Hypothesis Testing Trial by jury
Individual on trial. Is he/she innocent?
Evidence
Trial
Person Person
Innocent Guilty
14Hypothesis Testing Trial by jury
Individual on trial. Is he/she innocent?
Evidence
Trial
Jury Person Person
Jury Innocent Guilty
Not Guilty
Guilty
15Hypothesis Testing Trial by jury
Individual on trial. Is he/she innocent?
Evidence
Trial
Jury Person Person
Jury Innocent Guilty
Not Guilty ?
Guilty ?
16Hypothesis Testing Trial by jury
Individual on trial. Is he/she
innocent?
Evidence
Trial
Jury Person Person
Jury Innocent Guilty
Not Guilty ? x
Guilty x ?
17Hypothesis Testing
Test of Hypothesis that ? ?0?
Evidence
Trial
Evidence
Trial
Jury Person Person
Jury Innocent Guilty
Not Guilty ? x
Guilty x ?
18Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Trial
Trial
Jury Person Person
Jury Innocent Guilty
Not Guilty ? x
Guilty x ?
19Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Jury Person Person
Jury Innocent Guilty
Not Guilty ? x
Guilty x ?
20Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Jury Population Population
Jury Innocent Guilty
Not Guilty ? x
Guilty x ?
21Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Jury Population Population
Jury ? ?0 Guilty
Not Guilty ? x
Guilty x ?
22Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Jury Population Population
Jury ? ?0 ? ? ?0
Not Guilty ? x
Guilty x ?
23Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Us Population Population
Us ? ?0 ? ? ?0
Not Guilty ? x
Guilty x ?
24Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Us Population Population
Us ? ?0 ? ? ?0
Not reject ? x
Guilty x ?
25Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Us Population Population
Us ? ?0 ? ? ?0
Not reject ? x
Reject x ?
26Hypothesis Testing
Test of Hypothesis that ? ?0?
Sample
Analysis
Us Population Population
Us ? ?0 ? ? ?0
Not reject ? Type II
Reject Type I ?
27Possible errors in analysis results
Probability of Type I error is ? i.e. the
probability of rejecting the null hypothesis
when it is true. Probability of Type II error
is ? i.e the probability of not rejecting the
null hypothesis when it is false. 1-? is the
power of the test.
28Hypothesis testing about ?
1o Hypothesize a value (?0)
2o Take a random sample (n).
3o Is it likely that the sample came from a population with mean ?0 (? 0.05) ?
292 sided hypothesis test -Illustration
We know that cholesterol levels in US men 20-74
yrs are normally distributed with sX ? 46
mg/100ml and µ 211. We obtain a random sample
of 12 hypertensive smokers and obtain a sample
mean of 217 mg/100ml. We want to test whether
their population mean is the same as that of the
general population?
H0 ? 211
HA ? ? 211
302 sided hypothesis test -Illustration
H0 ? 211
HA ? ? 211
? 46 mg/100ml
12 hypertensive smokers have
31P-value
Some prefer to quote the p-value. The p-value
answers the question, What is the probability of
get- ting as large, or larger, a Discrepancy
given the null hypothesis is true?
Question Do hypertensive smokers have the same
mean as the general population?
32Rejecting the null hypothesis
- Assume a specific threshold of Type I error, a
- Typically a 0.05
- If p value lt a ? Reject null
33P-value
Some prefer to quote the p-value. The p-value
answers the question, What is the probability of
get- ting as large, or larger, a Discrepancy
given the null hypothesis is true?
Answer Do not reject the null hypothesis. No
evidence that hypertensive smokers have a
different mean than general population
34Summary
Decide on statistic
Determine which values of
are
consonant with the hypothesis that ? ?0 and
which ones are not.
Look at
and decide.
35Alternative hypothesis
Need to set up 2 hypotheses to cover all
possibilities for ?. Choice of 3 possibilities
1. Two-sided H0 ? ?0
1. Two-sided HA ? ? ?0
36Example - One-sided alternative
Blood glucose level of healthy persons has ?
9.7 mmol/L and ? 2.0 mmol/L
H0 ? ? 9.7
HA ? gt 9.7
Sample of 64 diabetics yields
Do diabetics have blood glucose levels that are
higher on average when compared to the general
population?
37Example - One-sided alternative
Blood glucose level of healthy persons has ?
9.7 mmol/L and ? 2.0 mmol/L
H0 ? ? 9.7
HA ? gt 9.7
n 64
p-value ltlt 0.001
Answer Reject the null hypothesis. Significant
evidence that diabetics have a higher mean level
of glucose when compared to the general population
38Alternative hypothesis
Need to set up 2 hypotheses to cover all
possibilities for ?. Choice of 3 possibilities
Two-sided H0 ? ?0
Two-sided HA ? ? ?0
One-sided H0 ? ? ?0
One-sided HA ? lt ?0
One-sided H0 ? ? ?0
One-sided HA ? gt ?0
39Summary
- Hypothesis testing
- Type I and II errors
- Power
- Two sided hypothesis test
- One sided hypothesis test