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

Algorithm

TP

FP

FN

TN

Sensitivity

Specificity

PPV

NPV

Kappa

Type 1 Proportion (%)

Calculated

True

All Ages

 Ratio of type 1 to type 2 codes ≥ 0.5 (A)

50

97

10

10,039

83.3 (71.5, 91.7)

99.0 (98.8, 99.2)

34.0 (26.4, 42.3)

99.9 (99.8, 100.0)

0.48

1.4

0.6

 Ratio of type 1 to type 2 codes ≥ 4 (B)

43

32

17

10,104

71.7 (58.6, 82.5)

99.7 (99.6, 99.8)

57.3 (45.4, 68.7)

99.8 (99.7, 99.9)

0.63

0.7

 At least 1 insulin prescription within 90 days (C)

58

615

2

9521

96.7 (88.5, 99.6)

93.9 (93.5, 94.4)

8.6 (6.6, 11.0)

100.0 (99.9, 100.0)

0.15

6.6

 Multiple daily injections with no other glucose-lowering medication prescription (D)

32

9

28

10,127

53.3 (40.0, 66.3)

99.9 (99.8, 100.0)

78.0 (62.4, 89.4)

99.7 (99.6, 99.8)

0.63

0.4

 A and C

49

52

11

10,084

81.7 (69.6, 90.5)

99.5 (99.3, 99.6)

48.5 (38.4, 58.7)

99.9 (99.8, 99.9)

0.61

1.0

 A and D

28

5

32

10,131

46.7 (33.7, 60.0)

100.0 (99.9, 100.0)

84.8 (68.1, 94.9)

99.7 (99.6, 99.8)

0.60

0.3

 B and C

42

19

18

10,117

70.0 (56.8, 81.2)

99.8 (99.7, 99.9)

68.9 (55.7, 80.1)

99.8 (99.7, 99.9)

0.69

0.6

 B and D

25

4

35

10,132

41.7 (29.1, 55.1)

100.0 (99.9, 100.0)

86.2 (68.3, 96.1)

99.7 (99.5, 99.8)

0.56

0.3

 A or C

59

660

1

9476

98.3 (91.1, 100.0)

93.5 (93.0, 94.0)

8.2 (6.3, 10.5)

100.0 (99.9, 100.0)

0.14

7.1

 A or D

54

101

6

10,035

90.0 (79.5, 96.2)

99.0 (98.8, 99.2)

34.8 (27.4, 42.9)

99.9 (99.9, 100.0)

0.50

1.5

 B or C*

59

628

1

9508

98.3 (91.1, 100.0)

93.8 (93.3, 94.3)

8.6 (6.6, 10.9)

100.0 (99.9, 100.0)

0.15

6.7

 B or D

50

37

10

10,099

83.3 (71.5, 91.7)

99.6 (99.5, 99.7)

57.5 (46.4, 68.0)

99.9 (99.8, 100.0)

0.68

0.9

Age < 20 years

 Ratio of type 1 to type 2 codes ≥ 0.5 (A)

23

9

0

26

100.0 (85.2, 100.0)

74.3 (56.7, 87.5)

71.9 (53.3, 86.3)

100.0 (86.8, 100.0)

0.70

55.2

39.7

 Ratio of type 1 to type 2 codes ≥ 4 (B)

21

5

2

30

91.3 (72.0, 98.9)

85.7 (69.7, 95.2)

80.8 (60.6, 93.4)

93.8 (79.2, 99.2)

0.75

44.8

 At least 1 insulin prescription within 90 days (C)

23

13

0

22

100.0 (85.2, 100.0)

62.9 (44.9, 78.5)

63.9 (46.2, 79.2)

100.0 (84.6, 100.0)

0.57

62.1

 Multiple daily injections with no other glucose-lowering medication prescription (D)

16

3

7

32

69.6 (47.1, 86.8)

91.4 (76.9, 98.2)

84.2 (60.4, 96.6)

82.1 (66.5, 92.5)

0.63

32.8

 A and C

23

8

0

27

100.0 (85.2, 100.0)

77.1 (59.9, 89.6)

74.2 (55.4, 88.1)

100.0 (87.2, 100.0)

0.73

53.4

 A and D

16

2

7

33

69.6 (47.1, 86.8)

94.3 (80.8, 99.3)

88.9 (65.3, 98.6)

82.5 (67.2, 92.7)

0.66

31.0

 B and C

21

5

2

30

91.3 (72.0, 98.9)

85.7 (69.7, 95.2)

80.8 (60.6, 93.4)

93.8 (79.2, 99.2)

0.75

44.8

 B and D

15

2

8

33

65.2 (42.7, 83.6)

94.3 (80.8, 99.3)

88.2 (63.6, 98.5)

80.5 (65.1, 91.2)

0.62

29.3

 A or C

23

14

0

21

100.0 (85.2, 100.0)

60.0 (42.1, 76.1)

62.2 (44.8, 77.5)

100.0 (83.9, 100.0)

0.54

63.8

 A or D

23

10

0

25

100.0 (85.2, 100.0)

71.4 (53.7, 85.4)

69.7 (51.3, 84.4)

100.0 (86.3, 100.0)

0.66

56.9

 B or C

23

13

0

22

100.0 (85.2, 100.0)

62.9 (44.9, 78.5)

63.9 (46.2, 79.2)

100.0 (84.6, 100.0)

0.57

62.1

 B or D

22

6

1

29

95.7 (78.1, 99.9)

82.9 (66.4, 93.4)

78.6 (59.0, 91.7)

96.7 (82.8, 99.9)

0.76

48.3

Age 20–39 years

 Ratio of type 1 to type 2 codes ≥ 0.5 (A)

21

53

5

700

80.8 (60.6, 93.4)

93.0 (90.9, 94.7)

28.4 (18.5, 40.1)

99.3 (98.4, 99.8)

0.39

9.5

3.3

 Ratio of type 1 to type 2 codes ≥ 4 (B)

19

16

7

737

73.1 (52.2, 88.4)

97.9 (96.6, 98.8)

54.3 (36.6, 71.2)

99.1 (98.1, 99.6)

0.61

4.5

 At least 1 insulin prescription within 90 days (C)

25

80

1

673

96.2 (80.4, 99.9)

89.4 (87.0, 91.5)

23.8 (16.0, 33.1)

99.9 (99.2, 100.0)

0.35

13.5

 Multiple daily injections with no other glucose-lowering medication prescription (D)

13

3

13

750

50.0 (29.9, 70.1)

99.6 (98.8, 99.9)

81.3 (54.4, 96.0)

98.3 (97.1, 99.1)

0.61

2.1

 A and C

20

23

6

730

76.9 (56.4, 91.0)

96.9 (95.5, 98.1)

46.5 (31.2, 62.3)

99.2 (98.2, 99.7)

0.56

5.5

 A and D

10

1

16

752

38.5 (20.2, 59.4)

99.9 (99.3, 100.0)

90.9 (58.7, 99.8)

97.9 (96.6, 98.8)

0.53

1.4

 B and C

18

8

8

745

69.2 (48.2, 85.7)

98.9 (97.9, 99.5)

69.2 (48.2, 85.7)

98.9 (97.9, 99.5)

0.68

3.3

 B and D

10

1

16

752

38.5 (20.2, 59.4)

99.9 (99.3, 100.0)

90.9 (58.7, 99.8)

97.9 (96.6, 98.8)

0.53

1.4

 A or C

26

110

0

643

100.0 (86.8, 100.0)

85.4 (82.7, 87.8)

19.1 (12.9, 26.7)

100.0 (99.4, 100.0)

0.28

17.5

 A or D

24

55

2

698

92.3 (74.9, 99.1)

92.7 (90.6, 94.5)

30.4 (20.5, 41.8)

99.7 (99.0, 100.0)

0.43

10.1

 B or C

26

88

0

665

100.0 (86.8, 100.0)

88.3 (85.8, 90.5)

22.8 (15.5, 31.6)

100.0 (99.4, 100.0)

0.34

14.6

 B or D

22

18

4

735

84.6 (65.1, 95.6)

97.6 (96.2, 98.6)

55.0 (38.5, 70.7)

99.5 (98.6, 99.9)

0.65

5.1

Age ≥ 40 years

 Ratio of type 1 to type 2 codes ≥ 0.5 (A)

6

35

5

9313

54.5 (23.4, 83.3)

99.6 (99.5, 99.7)

14.6 (5.6, 29.2)

99.9 (99.9, 100.0)

0.23

0.4

0.1

 Ratio of type 1 to type 2 codes ≥ 4 (B)

3

11

8

9337

27.3 (6.0, 61.0)

99.9 (99.8, 99.9)

21.4 (4.7, 50.8)

99.9 (99.8, 100.0)

0.24

0.1

 At least 1 insulin prescription within 90 days (C)

10

522

1

8826

90.9 (58.7, 99.8)

94.4 (93.9, 94.9)

1.9 (0.9, 3.4)

100.0 (99.9, 100.0)

0.03

5.7

 Multiple daily injections with no other glucose-lowering medication prescription (D)

3

3

8

9345

27.3 (6.0, 61.0)

100.0 (99.9, 100.0)

50.0 (11.8, 88.2)

99.9 (99.8, 100.0)

0.35

0.1

 A and C

6

21

5

9327

54.5 (23.4, 83.3)

99.8 (99.7, 99.9)

22.2 (8.6, 42.3)

99.9 (99.9, 100.0)

0.31

0.3

 A and D

2

2

9

9346

18.2 (2.3, 51.8)

100.0 (99.9, 100.0)

50.0 (6.8, 93.2)

99.9 (99.8, 100.0)

0.27

0.0

 B and C

3

6

8

9342

27.3 (6.0, 61.0)

99.9 (99.9, 100.0)

33.3 (7.5, 70.1)

99.9 (99.8, 100.0)

0.30

0.1

 B and D

0

1

11

9347

0.0 (0.0, 28.5)

100.0 (99.9, 100.0)

Undefined

99.9 (99.8, 99.9)

0.00

0.0

 A or C

10

536

1

8812

90.9 (58.7, 99.8)

94.3 (93.8, 94.7)

1.8 (0.9, 3.3)

100.0 (99.9, 100.0)

0.03

5.8

 A or D

7

36

4

9312

63.6 (30.8, 89.1)

99.6 (99.5, 99.7)

16.3 (6.8, 30.7)

100.0 (99.9, 100.0)

0.26

0.5

 B or C

10

527

1

8821

90.9 (58.7, 99.8)

94.4 (93.9, 94.8)

1.9 (0.9, 3.4)

100.0 (99.9, 100.0)

0.03

5.7

 B or D

6

13

5

9335

54.5 (23.4, 83.3)

99.9 (99.8, 99.9)

31.6 (12.6, 56.6)

99.9 (99.9, 100.0)

0.40

0.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