Problem 1: In a study on 200 subjects, radiographic detection of caries was compared to a gold standard based on a combination of tests. Radiographs failed to detect 40% of the actual lesions and detected caries at 5% of the sites where it was not detected by the gold standard. The results show that:
b. Radiographs have a low sensitivity and high specificity
Problem 2: Consider the following table for self-reported hypertension versus true hypertension status obtained by blood pressure measurements. Calculate the sensitivity, specificity, false positive rate, false negative rate, predictive value positive and predictive value negative.
library(epiR)
epiR::epi.tests(matrix(c(80,3,20,47), ncol = 2))
Disease + Disease - Total
Test + 80 20 100
Test - 3 47 50
Total 83 67 150
Point estimates and 95 % CIs:
---------------------------------------------------------
Apparent prevalence 0.67 (0.59, 0.74)
True prevalence 0.55 (0.47, 0.63)
Sensitivity 0.96 (0.9, 0.99)
Specificity 0.7 (0.58, 0.81)
Positive predictive value 0.8 (0.71, 0.87)
Negative predictive value 0.94 (0.83, 0.99)
---------------------------------------------------------
do.call(rbind, epiR::epi.tests(matrix(c(80,3,20,47), ncol = 2), verbose = T))
est lower upper
aprev 0.666667 0.58516 0.74144
tprev 0.553333 0.47007 0.63445
se 0.963855 0.89799 0.99248
sp 0.701493 0.57728 0.80721
diag.acc 0.846667 0.77886 0.90025
diag.or 62.666667 17.67243 222.21686
nnd 1.502973 1.25049 2.10408
youden 0.665348 0.47527 0.79969
ppv 0.800000 0.70816 0.87334
npv 0.940000 0.83452 0.98745
plr 3.228916 2.23161 4.67192
nlr 0.051525 0.01678 0.15821
..sens.spec(83/150, 80/83, 47/67, 150)
$table
disease
test pos neg Sum
pos 80 20 100
neg 3 47 50
Sum 83 67 150
$probabilities
PPV P(D+|T+) P(D-|T+) NPV P(D-|T-) P(D+|T-) LR+ LR-
0.800000 0.200000 0.940000 0.060000 3.228916 0.051525
Problem 3:
a = 46
b = 165
c = 37
d = 180
prob.3.x = matrix(c(a,b,c,d), byrow = T, ncol = 2)
dimnames(prob.3.x) = list(D = 1:0, X = 1:0)
prob.3.x
X
D 1 0
1 46 165
0 37 180
Sensitivity = 0.60
Specificity = 0.90
A = a * Sensitivity + b * (1 - Specificity)
B = b * Specificity + a * (1 - Sensitivity)
C = c * Sensitivity + d * (1 - Specificity)
D = d * Specificity + c * (1 - Sensitivity)
prob.3.z = matrix(c(A,B,C,D), byrow = T, ncol = 2)
dimnames(prob.3.z) = list(D = 1:0, Z = 1:0)
Sensitivity = 0.60 Specificity = 0.90 A = a * Sensitivity + b * (1 - Specificity) = 44.1 B = b * Specificity + a * (1 - Sensitivity) = 166.9 C = c * Sensitivity + d * (1 - Specificity) = 40.2 D = d * Specificity + c * (1 - Sensitivity) = 176.8
prob.3.z
Z
D 1 0
1 44.1 166.9
0 40.2 176.8
Problem 4:
a = 60
b = 70
c = 200
d = 400
prob.3.x = matrix(c(a,b,c,d), byrow = T, ncol = 2)
dimnames(prob.3.x) = list(D = 1:0, X = 1:0)
epiR::epi.2by2(prob.3.x)
Disease + Disease - Total Inc risk * Odds
Exposed + 60 70 130 46.2 0.857
Exposed - 200 400 600 33.3 0.500
Total 260 470 730 35.6 0.553
Point estimates and 95 % CIs:
---------------------------------------------------------
Inc risk ratio 1.38 (1.11, 1.72)
Odds ratio 1.71 (1.17, 2.52)
Attrib risk * 12.82 (3.46, 22.18)
Attrib risk in population * 2.28 (-2.84, 7.41)
Attrib fraction in exposed (%) 27.78 (10.24, 41.89)
Attrib fraction in population (%) 6.41 (1.5, 11.08)
---------------------------------------------------------
* Cases per 100 population units
Sensitivity = 0.50
Specificity = 0.50
A = a * Sensitivity + b * (1 - Specificity)
B = b * Specificity + a * (1 - Sensitivity)
C = c * Sensitivity + d * (1 - Specificity)
D = d * Specificity + c * (1 - Sensitivity)
prob.3.z = matrix(c(A,B,C,D), byrow = T, ncol = 2)
dimnames(prob.3.z) = list(D = 1:0, Z = 1:0)
epiR::epi.2by2(prob.3.z)
Disease + Disease - Total Inc risk * Odds
Exposed + 65 65 130 50 1
Exposed - 300 300 600 50 1
Total 365 365 730 50 1
Point estimates and 95 % CIs:
---------------------------------------------------------
Inc risk ratio 1 (0.83, 1.21)
Odds ratio 1 (0.68, 1.46)
Attrib risk * 0 (-9.48, 9.48)
Attrib risk in population * 0 (-5.4, 5.4)
Attrib fraction in exposed (%) 0 (-20.88, 17.27)
Attrib fraction in population (%) 0 (-3.43, 3.32)
---------------------------------------------------------
* Cases per 100 population units
true OR = (60 * 400) / (70 * 200) = 1.71
Sensitivity = 0.5 Specificity = 0.5 A = a * Sensitivity + b * (1 - Specificity) = 65 B = b * Specificity + a * (1 - Sensitivity) = 65 C = c * Sensitivity + d * (1 - Specificity) = 300 D = d * Specificity + c * (1 - Sensitivity) = 300
prob.3.z
Z
D 1 0
1 65 65
0 300 300
misclassified OR = (65 * 300) / (65 * 300) = 1
Example by Drew et al
A = 122
B = 442
C = 101
D = 479
m1 = A + B
m0 = C + D
prob.3.z = matrix(c(A,B,C,D), byrow = T, ncol = 2)
dimnames(prob.3.z) = list(D = 1:0, Z = 1:0)
prob.3.z
Z
D 1 0
1 122 442
0 101 479
Sensitivity = 0.60
Specificity = 0.90
a = (Specificity * m1 - B) / (Sensitivity + Specificity - 1)
b = (Sensitivity * m1 - A) / (Sensitivity + Specificity - 1)
c = (Specificity * m0 - D) / (Sensitivity + Specificity - 1)
d = (Sensitivity * m0 - C) / (Sensitivity + Specificity - 1)
prob.3.x = matrix(c(a,b,c,d), byrow = T, ncol = 2)
dimnames(prob.3.x) = list(D = 1:0, X = 1:0)
prob.3.x
X
D 1 0
1 131.2 432.8
0 86.0 494.0
Problem 5:
A = 90
B = 60
C = 300
D = 500
m1 = A + B
m0 = C + D
prob.5.z = matrix(c(A,B,C,D), byrow = T, ncol = 2)
dimnames(prob.5.z) = list(D = 1:0, Z = 1:0)
prob.5.z
Z
D 1 0
1 90 60
0 300 500
Sensitivity = 0.96
Specificity = 0.70
a = (Specificity * m1 - B) / (Sensitivity + Specificity - 1)
b = (Sensitivity * m1 - A) / (Sensitivity + Specificity - 1)
c = (Specificity * m0 - D) / (Sensitivity + Specificity - 1)
d = (Sensitivity * m0 - C) / (Sensitivity + Specificity - 1)
prob.5.x = matrix(c(a,b,c,d), byrow = T, ncol = 2)
dimnames(prob.5.x) = list(D = 1:0, X = 1:0)
prob.5.x <- round(prob.5.x, 2)
Observed odds ratio = 2.5
A = 90; B = 60; C = 300; D = 500; m1 = 150; m0 = 800
Sensitivity = 0.96; Specificity = 0.70
Thus,
68.1881.8290.91709.09prob.5.x
X
D 1 0
1 68.18 81.82
0 90.91 709.09
True odds ratio = 6.5