Specificity and sensitivity
Had a lecture the other day which talked about "measurement error" validity and reliability." One of the concepts covered was the measurement error of categorical data, "usually referred to as misclassification." It went on to talk about the analysis of misclassification using a two by two matrix; however, it did it in a way that is extremely confusing and, unfortunately, very standard amongst medical teaching: what I call 'the a/(a+c) and b/(b+d) method'. I've also learnt about sensitivity and specificity another way which I think is far superior, so here I will explain that method, and also what the problems are with the a/(a+c) and b/(b+d) method.
The basic premise is that you are studying a disease for which you have a new test and you want to figure out how good that test is compared to the 'gold-standard' or reference test that you already have. Of course, that gold-standard may not be the one that you would use in every day practise: it could be too expensive, or not tolerated by patients, or not suitable for any number of reasons. But what we do assume is that you know how to find out how many people truly have the disease in question. Have a look at the grid:
| Gold standard |
| |
| + | - |
-----------+---------+---------+
New + | | |
------+---------+---------+
test - | | |
-----------+---------+---------+
As you can see, there are four quadrants: '++', '+-', '-+' and '--'. Traditionally, these are called 'a', 'b', 'c' and 'd' and people then learn the various fractions. However, this can be very confusing if the columns (or the rows) are switched around, as people have a tendancy to label the boxes in the same order - 'a', 'b', 'c' and 'd' - which consequently means they get the calculations wrong. And, not surprisingly, in exams (and in real life, too) data is often not presented in this 'classical' grid as i've shown above.
So, how to do it? Well, how about calling things by their real names instead? Like, 'true positives', 'false positives', 'false negatives' and 'true negatives'? If we do that, we end up with a table that looks like this:
| Gold standard |
| |
| + | - |
-----------+---------+---------+
New + | TP | FP |
------+---------+---------+
test - | FN | TN |
-----------+---------+---------+
TP = True Positive
FP = False Positive
FN = False Negative
TN = True Negative
This means our sensitivity and specificity calculations look like this:
Sensitivity = TP/(TP+FN)
Specificity = TN/(FP+TN)
And, it is then easy to remember: Trues on Top - that is, that the number correctly identified (as true or false) by the new test (as compared to the gold standard) is the numerator, and the total (according to the gold standard) is the denominator.
This method also holds if we switch the table around. Take, for example, the following, with the '+' and '-' columns for the gold standard switched over:
| Gold standard |
| |
| - | + |
-----------+---------+---------+
New + | FP | TP |
------+---------+---------+
test - | TN | FN |
-----------+---------+---------+
TP = True Positive
FP = False Positive
FN = False Negative
TN = True Negative
One can quite easily figure out the formulae again, as they are identical to how they were previously:
Sensitivity = TP/(TP+FN)
Specificity = TN/(FP+TN)
Yet, if you had called the boxes 'a', 'b', 'c' and 'd' before, they may now be called something like 'b', 'a', 'd' and 'c' which makes no logical sense and is something quite easily forgotten (in exams or real life).
One final thing to remember - which is sensitivity and which is specificity? This one is slightly counterintuitive, but I think that as long as you remember it's backwards, you'll be fine. What do I mean by that? Well, often, sensitivity is abbreviated to Sn, and specificity is abbreviated to Sp. From this, we just need to remember that Sn corresponds to the True Positives, and Sp corresponds to the True Negatives:
Sensitivity = Sn = TP/(TP+FN)
Specificity = Sp = TN/(FP+TN)
I hope this helps you remember the difference between the two.
Note, we can also use this table to calculate several other things:
the positive predictive value (PPV) of a new test = TP/(TP+FP)
the negative predictive value (NPV) of a new test = TN/(TN+FN)
the true prevalence of a disease = (TP+FN)/TP+FP+TN+FN)
test bias = ratio of estimated prevalence to true prevalence = (TP+FP)/(TP+FN)
However, these are not what the main focus of this article is about, and I think are relatively self-explanatory (or not worth spending too much time on).
