contingency table 2x2
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

ABCDEFGHIJKLMNOPQRST
1
2x2 Contigency table for medical screening test given sensitivity, specificity, and base rate
2
January 2011
3
by Edwardson Tan
4
5
6
base ratefrequency of the disease/condition in the population (expressed as fraction of population)
7
sensitivityP(test is positive | person has the condition)
8
specificityP(test is negative | person doesn't have the condition)
9
10
11
ProbabilitiesPerson has the disease/conditionTotalsConditional Probabilites
12
YesNoTest result correctTest result erroneous
13
test positiveABA + BA / (A + B)P(yes | positive)B / (A + B)False positive = P(no | positive)
14
test negativeCDC + DD / (C + D)P(no | negative)C / (C + D)False negative = P(yes | negative)
15
TotalsA+CB+D1
16
17
A = P(true & positive)
18
B = P(false & positive)
19
C = P(true & negative)
20
D = P(false & negative)
21
22
Sensitivity = A / (A+C)
23
Specificity = D / (B+D)
24
base rate = A+C
25
26
A+B+C+D = 1
27
A = sensitivity * base rate
28
C = (1 - sensitivity) * base rate
29
B + D = 1 - base rate
30
B = (1- specificity) * (1 - base rate)
31
D = specificity * (1 - base rate)
32
P(has condition | test positive) = true positive = P(A | A+B) = A / (A+B)
33
P(no condition | test negative) = true negative = P(D | C+D) = D / (C+D)
34
P(no condition | test positive) = false positive = P(B | A+B) = B / (A + B)
35
P(has condition | test negative) = false negative = P(C | C+D) = C / (C + D)
36
37
true positive = (sensitivity * base rate) / [(sensitivity * base rate) + (1 - specificity)*(1 - base rate)]
38
true negative = [specificity * (1 - base rate)] / [specificity * (1 - base rate) + (1 - sensitivity) * base rate]
39
false positive = 1 - true positive rate
40
false negative = 1 - true negative rate
41
42
43
EXAMPLE
44
45
base rate0.05frequency of the disease/condition in the population (expressed as fraction of population)
46
sensitivity0.9P(test is positive | person has the condition)
47
specificity0.9P(test is negative | person doesn't have the condition)
48
sample size1000number of people (used for second table below)
49
50
ProbabilitiesPerson has the disease/conditiontotalsConditional Probabilites
51
YesNoTest result correctTest result erroneous
52
test positive0.0450.0950.1432.14%P(has condition | positive)67.86%False positive = P(no condition | positive)
53
test negative0.0050.8550.8699.42%P(no condition | negative)0.58%False negative = P(has condition | negative)
54
totals0.050.951
55
56
57
Number of personsPerson has the disease/conditiontotals
58
YesNo
59
test positive4595140
60
test negative5855860
61
totals509501000
62
63
cells A to D are computed by multiplying probabilities of corresponding cell by sample size
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100