Skip to main content

Table 3 Test characteristics of single (A–D) and combination algorithms for classifying type 1 diabetes compared to the reference standard in the derivation cohort, stratified by age at diagnosis. Sensitivity, specificity, positive predictive value (PPV) and negative predictive value (NPV) are percentages with 95% confidence intervals. Cohen’s kappa coefficient represents agreement after agreement due to chance is removed (1.0 indicates perfect agreement) [31]. The “Type 1 Proportion” columns refer to the percentage of people in the cohort with diabetes classified as having type 1 using each algorithm (“Calculated”) and the reference standard (“True”). The best overall algorithms are marked (* = highest sensitivity, = highest PPV, = highest kappa coefficient)

From: Development and validation of algorithms to classify type 1 and 2 diabetes according to age at diagnosis using electronic health records

AlgorithmTPFPFNTNSensitivitySpecificityPPVNPVKappaType 1 Proportion (%)
CalculatedTrue
All Ages
 Ratio of type 1 to type 2 codes ≥ 0.5 (A)50971010,03983.3 (71.5, 91.7)99.0 (98.8, 99.2)34.0 (26.4, 42.3)99.9 (99.8, 100.0)0.481.40.6
 Ratio of type 1 to type 2 codes ≥ 4 (B)43321710,10471.7 (58.6, 82.5)99.7 (99.6, 99.8)57.3 (45.4, 68.7)99.8 (99.7, 99.9)0.630.7
 At least 1 insulin prescription within 90 days (C)586152952196.7 (88.5, 99.6)93.9 (93.5, 94.4)8.6 (6.6, 11.0)100.0 (99.9, 100.0)0.156.6
 Multiple daily injections with no other glucose-lowering medication prescription (D)3292810,12753.3 (40.0, 66.3)99.9 (99.8, 100.0)78.0 (62.4, 89.4)99.7 (99.6, 99.8)0.630.4
 A and C49521110,08481.7 (69.6, 90.5)99.5 (99.3, 99.6)48.5 (38.4, 58.7)99.9 (99.8, 99.9)0.611.0
 A and D2853210,13146.7 (33.7, 60.0)100.0 (99.9, 100.0)84.8 (68.1, 94.9)99.7 (99.6, 99.8)0.600.3
 B and C42191810,11770.0 (56.8, 81.2)99.8 (99.7, 99.9)68.9 (55.7, 80.1)99.8 (99.7, 99.9)0.690.6
 B and D2543510,13241.7 (29.1, 55.1)100.0 (99.9, 100.0)86.2 (68.3, 96.1)99.7 (99.5, 99.8)0.560.3
 A or C596601947698.3 (91.1, 100.0)93.5 (93.0, 94.0)8.2 (6.3, 10.5)100.0 (99.9, 100.0)0.147.1
 A or D54101610,03590.0 (79.5, 96.2)99.0 (98.8, 99.2)34.8 (27.4, 42.9)99.9 (99.9, 100.0)0.501.5
 B or C*596281950898.3 (91.1, 100.0)93.8 (93.3, 94.3)8.6 (6.6, 10.9)100.0 (99.9, 100.0)0.156.7
 B or D50371010,09983.3 (71.5, 91.7)99.6 (99.5, 99.7)57.5 (46.4, 68.0)99.9 (99.8, 100.0)0.680.9
Age < 20 years
 Ratio of type 1 to type 2 codes ≥ 0.5 (A)239026100.0 (85.2, 100.0)74.3 (56.7, 87.5)71.9 (53.3, 86.3)100.0 (86.8, 100.0)0.7055.239.7
 Ratio of type 1 to type 2 codes ≥ 4 (B)21523091.3 (72.0, 98.9)85.7 (69.7, 95.2)80.8 (60.6, 93.4)93.8 (79.2, 99.2)0.7544.8
 At least 1 insulin prescription within 90 days (C)2313022100.0 (85.2, 100.0)62.9 (44.9, 78.5)63.9 (46.2, 79.2)100.0 (84.6, 100.0)0.5762.1
 Multiple daily injections with no other glucose-lowering medication prescription (D)16373269.6 (47.1, 86.8)91.4 (76.9, 98.2)84.2 (60.4, 96.6)82.1 (66.5, 92.5)0.6332.8
 A and C238027100.0 (85.2, 100.0)77.1 (59.9, 89.6)74.2 (55.4, 88.1)100.0 (87.2, 100.0)0.7353.4
 A and D16273369.6 (47.1, 86.8)94.3 (80.8, 99.3)88.9 (65.3, 98.6)82.5 (67.2, 92.7)0.6631.0
 B and C21523091.3 (72.0, 98.9)85.7 (69.7, 95.2)80.8 (60.6, 93.4)93.8 (79.2, 99.2)0.7544.8
 B and D15283365.2 (42.7, 83.6)94.3 (80.8, 99.3)88.2 (63.6, 98.5)80.5 (65.1, 91.2)0.6229.3
 A or C2314021100.0 (85.2, 100.0)60.0 (42.1, 76.1)62.2 (44.8, 77.5)100.0 (83.9, 100.0)0.5463.8
 A or D2310025100.0 (85.2, 100.0)71.4 (53.7, 85.4)69.7 (51.3, 84.4)100.0 (86.3, 100.0)0.6656.9
 B or C2313022100.0 (85.2, 100.0)62.9 (44.9, 78.5)63.9 (46.2, 79.2)100.0 (84.6, 100.0)0.5762.1
 B or D22612995.7 (78.1, 99.9)82.9 (66.4, 93.4)78.6 (59.0, 91.7)96.7 (82.8, 99.9)0.7648.3
Age 20–39 years
 Ratio of type 1 to type 2 codes ≥ 0.5 (A)2153570080.8 (60.6, 93.4)93.0 (90.9, 94.7)28.4 (18.5, 40.1)99.3 (98.4, 99.8)0.399.53.3
 Ratio of type 1 to type 2 codes ≥ 4 (B)1916773773.1 (52.2, 88.4)97.9 (96.6, 98.8)54.3 (36.6, 71.2)99.1 (98.1, 99.6)0.614.5
 At least 1 insulin prescription within 90 days (C)2580167396.2 (80.4, 99.9)89.4 (87.0, 91.5)23.8 (16.0, 33.1)99.9 (99.2, 100.0)0.3513.5
 Multiple daily injections with no other glucose-lowering medication prescription (D)1331375050.0 (29.9, 70.1)99.6 (98.8, 99.9)81.3 (54.4, 96.0)98.3 (97.1, 99.1)0.612.1
 A and C2023673076.9 (56.4, 91.0)96.9 (95.5, 98.1)46.5 (31.2, 62.3)99.2 (98.2, 99.7)0.565.5
 A and D1011675238.5 (20.2, 59.4)99.9 (99.3, 100.0)90.9 (58.7, 99.8)97.9 (96.6, 98.8)0.531.4
 B and C188874569.2 (48.2, 85.7)98.9 (97.9, 99.5)69.2 (48.2, 85.7)98.9 (97.9, 99.5)0.683.3
 B and D1011675238.5 (20.2, 59.4)99.9 (99.3, 100.0)90.9 (58.7, 99.8)97.9 (96.6, 98.8)0.531.4
 A or C261100643100.0 (86.8, 100.0)85.4 (82.7, 87.8)19.1 (12.9, 26.7)100.0 (99.4, 100.0)0.2817.5
 A or D2455269892.3 (74.9, 99.1)92.7 (90.6, 94.5)30.4 (20.5, 41.8)99.7 (99.0, 100.0)0.4310.1
 B or C26880665100.0 (86.8, 100.0)88.3 (85.8, 90.5)22.8 (15.5, 31.6)100.0 (99.4, 100.0)0.3414.6
 B or D2218473584.6 (65.1, 95.6)97.6 (96.2, 98.6)55.0 (38.5, 70.7)99.5 (98.6, 99.9)0.655.1
Age ≥ 40 years
 Ratio of type 1 to type 2 codes ≥ 0.5 (A)6355931354.5 (23.4, 83.3)99.6 (99.5, 99.7)14.6 (5.6, 29.2)99.9 (99.9, 100.0)0.230.40.1
 Ratio of type 1 to type 2 codes ≥ 4 (B)3118933727.3 (6.0, 61.0)99.9 (99.8, 99.9)21.4 (4.7, 50.8)99.9 (99.8, 100.0)0.240.1
 At least 1 insulin prescription within 90 days (C)105221882690.9 (58.7, 99.8)94.4 (93.9, 94.9)1.9 (0.9, 3.4)100.0 (99.9, 100.0)0.035.7
 Multiple daily injections with no other glucose-lowering medication prescription (D)338934527.3 (6.0, 61.0)100.0 (99.9, 100.0)50.0 (11.8, 88.2)99.9 (99.8, 100.0)0.350.1
 A and C6215932754.5 (23.4, 83.3)99.8 (99.7, 99.9)22.2 (8.6, 42.3)99.9 (99.9, 100.0)0.310.3
 A and D229934618.2 (2.3, 51.8)100.0 (99.9, 100.0)50.0 (6.8, 93.2)99.9 (99.8, 100.0)0.270.0
 B and C368934227.3 (6.0, 61.0)99.9 (99.9, 100.0)33.3 (7.5, 70.1)99.9 (99.8, 100.0)0.300.1
 B and D011193470.0 (0.0, 28.5)100.0 (99.9, 100.0)Undefined99.9 (99.8, 99.9)0.000.0
 A or C105361881290.9 (58.7, 99.8)94.3 (93.8, 94.7)1.8 (0.9, 3.3)100.0 (99.9, 100.0)0.035.8
 A or D7364931263.6 (30.8, 89.1)99.6 (99.5, 99.7)16.3 (6.8, 30.7)100.0 (99.9, 100.0)0.260.5
 B or C105271882190.9 (58.7, 99.8)94.4 (93.9, 94.8)1.9 (0.9, 3.4)100.0 (99.9, 100.0)0.035.7
 B or D6135933554.5 (23.4, 83.3)99.9 (99.8, 99.9)31.6 (12.6, 56.6)99.9 (99.9, 100.0)0.400.2
  1. Abbreviations: TP true positive, FP false positive, FN false negative, TN true negative
  2. If there were no true positive cases identified, the positive predictive was indicated as “undefined”
  3. See Supplementary Table 5 (Additional File 1) for algorithms using renal function criteria