1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks...

39
1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano rvard School of Public Health) for lecture material
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    221
  • download

    0

Transcript of 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks...

Page 1: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

1

Introduction to Biostatistics

(BIO/EPI 540)

Lecture 11: Hypothesis Testing

Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health) for lecture material

Page 2: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

2

No human investigation can be called true science without passing through mathematical tests.

Leonardo da Vinci (1452-1519) (in Treatise on Painting)

Testing

Page 3: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

3

Sampling Paradigm

Population

Sample

Inference

μ,

σ

,S

Page 4: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

4

Inference

•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

μ

σ2

Page 5: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

5

We know that cholesterol levels inUS men 20-24 yrs are normally distributed with σX 46 mg/100ml.

We obtain a sample of n=25 and want to infer μ.

Confidence Interval - Illustration

Page 6: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

6

value of μ

Use of C.I. to infer value

Page 7: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

7

IF 95% C.I.

200 mg/100ml (182,218)

Population mean = 211?

Page 8: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

8

XIF 95% C.I.

200 mg/100ml (182,218)

190 mg/100ml (172,208)

Population mean = 211?

Page 9: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

9

IF 95% C.I.

200 mg/100ml (182,218)

190 mg/100ml (172,208)

175 mg/100ml (157,193)

Population mean = 211?

Page 10: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

10

Alternatively IF= 211 and = 46 and we take a sample of size n=25 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.

If true

Page 11: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

11

Hypothesis Testing

Hypothesis Testing Trial by jury

Page 12: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

12

Individual on trial. Is he/she innocent?

Evidence Trial

Hypothesis Testing & Trial by jury

Page 13: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

13

Individual on trial. Is he/she innocent?

Evidence Trial

Person

Innocent Guilty

Hypothesis Testing & Trial by jury

Page 14: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

14

Individual on trial. Is he/she innocent?

Evidence Trial

JuryPerson

Innocent Guilty

Not Guilty

Guilty

Hypothesis Testing & Trial by jury

Page 15: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

15

Individual on trial. Is he/she innocent?

Evidence Trial

JuryPerson

Innocent Guilty

Not Guilty

Guilty

Hypothesis Testing & Trial by jury

Page 16: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

16

Individual on trial. Is he/she innocent?

Evidence Trial

JuryPerson

Innocent Guilty

Not Guilty x

Guilty x

Hypothesis Testing & Trial by jury

Page 17: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

17

Evidence Trial

JuryPerson

Innocent Guilty

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Evidence Trial

Hypothesis Testing

Page 18: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

18

Trial

JuryPerson

Innocent Guilty

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Trial

Hypothesis Testing

Page 19: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

19

JuryPerson

Innocent Guilty

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 20: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

20

JuryPopulation

Innocent Guilty

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 21: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

21

JuryPopulation

= 0 Guilty

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 22: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

22

JuryPopulation

= 0 0

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 23: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

23

UsPopulation

= 0 0

Not Guilty x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 24: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

24

UsPopulation

= 0 0

Not reject x

Guilty x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 25: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

25

UsPopulation

= 0 0

Not reject x

Reject x

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 26: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

26

UsPopulation

= 0 0

Not reject Type II

Reject Type I

Test of Hypothesis that = 0? Sample Analysis

Hypothesis Testing

Page 27: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

27

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 rejectingthe null hypothesis when it is false.

1- is the power of the test.

Possible errors in analysis results

Page 28: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

28

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) ?

Hypothesis testing about :

Page 29: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

29

We know that cholesterol levels inUS men 20-74 yrs are normally

distributed with σX 46 mg/100mland μ = 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?

2 sided hypothesis test -Illustration

H0 : = 211

HA : 211

Page 30: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

30

H0 : = 211

HA : 211 = 46 mg/100ml

12 hypertensive smokers have:

217 2110.45

n 46/ 12x

zm

s0- -

= = =/

217 mg/ 100mlx =

2 sided hypothesis test -Illustration

Page 31: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

31

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?”

P-value

Question: Do hypertensive smokers have the same mean as the general population?

Page 32: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

32

Rejecting the null hypothesis

• Assume a specific threshold of Type I error, α– Typically α = 0.05

• If p value < α Reject null

Page 33: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

33

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?”

P-value

Answer: Do not reject the null hypothesis.No evidence that hypertensive smokers have a different mean than general population

Page 34: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

34

Decide on statistic:

Determine which values of consonant with the hypothesisthat = 0 and which ones are not.

are

Look at and decide.

Summary

Page 35: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

35

Need to set up 2 hypotheses to cover all possibilities for . Choice of 3 possibilities:

1. Two-sidedH0 : = 0

HA : 0

Alternative hypothesis

Page 36: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

36

Blood glucose levelof healthy personshas = 9.7 mmol/Land = 2.0 mmol/L

H0 : 9.7

HA : > 9.7

Sample of 64 diabetics yields

Example - One-sided alternative

Do diabetics have blood glucose levels that are higher on averagewhen compared to the general population?

Page 37: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

37

Blood glucose levelof healthy personshas = 9.7 mmol/Land = 2.0 mmol/L

H0 : 9.7

HA : > 9.7

n = 64

p-value << 0.001

Example - One-sided alternative

Answer: Reject the null hypothesis.Significant evidence that diabetics have a higher mean level of glucose when compared to the general population

Page 38: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

38

Need to set up 2 hypotheses to cover all possibilities for . Choice of 3 possibilities:

Two-sidedH0 : = 0

HA : 0

One-sidedH0 : 0

HA : < 0

One-sidedH0 : 0

HA : > 0

Alternative hypothesis

Page 39: 1 Introduction to Biostatistics (BIO/EPI 540) Lecture 11: Hypothesis Testing Acknowledgement: Thanks to Professor Pagano (Harvard School of Public Health)

39

Summary

• Hypothesis testing: – Type I and II errors– Power

• Two sided hypothesis test

• One sided hypothesis test