Sensitivity & Specificity ( Andy Ni)

24
Sensitivity & Specificity Categorical Data Analysis (CHL5210) Tutorial Presentation Andy (Ai) Ni Oct 9, 2007

description

Laboratory technology and development trick

Transcript of Sensitivity & Specificity ( Andy Ni)

Page 1: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Categorical Data Analysis (CHL5210)Tutorial Presentation

Andy (Ai) NiOct 9, 2007

Page 2: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Measure how ‘good’ a test is at detecting binary features of interest (disease/no disease)

Page 3: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

There are 100 people with 30 having disease A

A test designed to identify who has the disease and who does not

We want to evaluate how good the test is

Page 4: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Disease+

Disease-

Total

Test+

25 2 27

Test-

5 68 73

Total 30 70 100

Page 5: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

25/30sensitivity

68/70specificity

Disease+

Disease-

Total

Test+

25 2 27

Test-

5 68 73

Total 30 70 100

Page 6: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Sensitivity = P (test+ | disease+)

Specificity = P (test- | disease-)

Page 7: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Usually the ‘true’ disease status is determined by some ‘gold standard’ method

For a specific test, sensitivity increases as specificity decreases and vice versa

Page 8: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Is a test perfect if it has high sensitivity AND high specificity?

Suppose there are 1 million people with 0.1% infected with HIV

A test can identify HIV infected people with 99.9% sensitivity and 99.9% specificity

Page 9: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

HIV+

HIV-

Total

Test+

999 999 1,998

Test-

1 998,001 998,002

Total 1,000 999,000 1,000,000

Page 10: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

999/1,998

PPV998,001/998,002

NPV

HIV+

HIV-

Total

Test+

999 999 1,998

Test-

1 998,001 998,002

Total 1,000 999,000 1,000,000 0.1%Prevalence

Page 11: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Positive Predictive Value (PPV)

= P (disease+ | test+)

Negative Predictive Value (NPV)

= P (disease- | test-)

Prevalence = P (disease+)

Page 12: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

The lower the prevalence, the lower the PPV, and the higher the NPV

The higher the prevalence, the higher the PPV, and the lower the NPV

Page 13: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Type I error = P (reject Ho | Ho+)

Page 14: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Type I error = P (reject Ho | Ho+)

= 1 – P (accept Ho | Ho+)

Page 15: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Type I error = P (reject Ho | Ho+)

= 1 – P (accept Ho | Ho+)

Disease -test -

Page 16: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Type I error = P (reject Ho | Ho+)

= 1 – P (accept Ho | Ho+)

So type I error is in fact (1 – specificity)

Disease -test -

Page 17: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Power = 1 – Type II error

Page 18: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Power = 1 – Type II error = 1 – P (accept Ho | Ho-)

Page 19: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Power = 1 – Type II error = 1 – P (accept Ho | Ho-)

= P (reject Ho | Ho-)

Page 20: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Power = 1 – Type II error = 1 – P (accept Ho | Ho-)

= P (reject Ho | Ho-)

Disease+Test+

Page 21: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

Power = 1 – Type II error = 1 – P (accept Ho | Ho-)

= P (reject Ho | Ho-)

So power is in fact sensitivity

Disease+Test+

Page 22: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

SAS code There is no direct procedure for

sensitivity and specificity Use proc freq to do the job

Page 23: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

To get the 2X2 table

data sample; input Test Disease Count;datalines;0 0 6 0 1 2 1 0 4 1 1 11;run;

proc freq data=sample;weight Count;tables Test*Disease;run;

Page 24: Sensitivity &  Specificity ( Andy  Ni)

Sensitivity & Specificity

To get the CI and test

title ‘sensitivity’;

proc freq data=sample;

where Disease=1;

weight Count;

tables Test;

exact binomial;

run;