No announcement yet.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unclear on roctab sensitivity and specificity calculation

    I have a question about how sensitivity and specificity are calculated in -roctab- as I have had discrepancies between the stata values and hand calculated values.
    Take the example from the help file for instance, at the cut off point >=2, the 2x2 table should look like this
    disease <=1 >=2
    0 33 (TN) 25
    1 3 48 (TP)
    The -roctab- sensitivity and specificity is: 94.12% (sensitivity) and 56.90% (specificity)
    Hand calculated sensitivity and specificity is: 65.75% (sensitivity) and 91.67% (specificity)

    If someone could point me in the right direction, that would be great!


  • #2
    -roctab- is getting it right; your hand calculations are incorrect. Sensitivity and specificity are defined as the probabilities of a correct rating, conditional on disease status. So the sensitivity in your table (interpreting >= 2 as a positive test and <= 1 as a negative test) is 48/(48+3) = 0.941, which is what -roctab- shows. What you have calculated is 48/(48+25) = 0.6575, but that is not the sensitivity. You have used the number of positive tests as the denominator, and that statistic is the positive predictive value. Similarly your 91.67% hand-calculated figure is the negative predictive value of the test, not its specificity.