Definitions & Key takeaways

Sensitivity and specificity are two important statistical measures used to evaluate the performance of medical tests, such as diagnostic tests for diseases.

Sensitivity measures the ability of a test to correctly identify those who have the disease. It is the proportion of people with a disease who test positive. This means that a test with high sensitivity can correctly identify most individuals who have the disease, while a test with low sensitivity will miss many cases of the disease. Sensitivity is calculated by dividing the number of true positives, by the total number of all people who have the condition - the true positives and false negatives.

Specificity, on the other hand, measures the ability of a test to correctly identify those who do not have the disease. It is the proportion of people without a disease who correctly test negative. This means that a test with high specificity can correctly identify most individuals who do not have the disease, while a test with low specificity will result in many false positive results. Specificity is calculated by dividing the number of true negatives by the total number of all people who don't have the condition - the true negatives and false positives.

Let’s say a new screening test is developed to figure out if people have diabetes before they start showing symptoms. Before using the test, we have to make sure that the test works - in other words, can the test correctly identify if a person has diabetes or not?
This is the test’s validity, and it has two components - sensitivity and specificity. A test with high sensitivity will correctly identify most people who have the condition, and a test with high specificity will correctly identify most people who don’t have the disease.
So let’s say that we recruit a 1000 people - 100 people who have diabetes and 900 people who don’t to put our diabetes test to the test!
We can organize the results using a 2 by 2 table, where the true disease status, positive or negative, of the individual is on the top of the box and the results of the screening test, positive or negative, are on the side, and each of the cells is labeled a, b, c, or d.
In this situation, a positive test indicates that a person has diabetes. So let’s look at this table closer, a person who gets a positive test result and has positive disease status, so has diabetes, is called a true positive.
A person who gets a negative test result and a negative disease status, so doesn’t have diabetes, would be a true negative.
A person who gets a positive test result even though they don’t have diabetes, would be a false positive. And lastly a person who gets a negative test result even though they have diabetes, would be a false negative.
To calculate sensitivity, we divide the number of true positives by the total number of people who have diabetes - so cell a divided by the sum of cell a and cell c.
A test with perfect sensitivity would have 100 true positives in cell a, because the test would correctly identify everyone who has diabetes, and zero false negatives in cell c.
To calculate specificity, we divide the number of true negatives by the total number of people who do not have diabetes - so cell d divided by the sum of cell d and cell b.
A test with perfect specificity would have 900 true negatives in cell d, because the test would correctly identify everyone who doesn’t have diabetes, and zero false positives, in cell b.
But no test is 100% perfect, so let’s say that cell a contains 80 true positives, cell b contains 100 false positives, cell c contains 20 false negatives, and cell d contains 800 true negatives.
In this situation, the sensitivity would be 80%, because there are 100 people who truly have diabetes - cell a plus cell c, and 80 of them - in cell a - are true positives.
In other words, this test will correctly identify 80% of people who have diabetes. The specificity would be 89%, because 900 people don’t have diabetes, cell d plus cell b, and 800 of them - in cell d - are true negatives.
In other words, this test will correctly identify 89% of people who don’t have diabetes. Sometimes deciding if a person has a condition is a matter of yes or no - like having a cavity or not having a cavity - but other conditions are on the continuous scale, like blood glucose level.
For these conditions, there has to be a cut- off point that makes the test result either positive or negative. For example, let’s say there are 20 individuals with diabetes and 20 individuals without diabetes who get their blood sugar levels tested.
Even though the blood sugar levels of people with diabetes tends to be higher, there’s no clear cut-off point because there’s a lot of overlap in the blood glucose levels of people with and without diabetes.
Let’s say that we pick a high cut- off value. Then, bringing back our 2 by 2 table, we can see that we might end up with only 2 false positives, but 15 false negatives, so the test has high specificity and low sensitivity, and a large number of people that have diabetes won’t be diagnosed.
That can be a serious problem for conditions that need to be diagnosed early, either because they develop quickly or can only be cured in the early stages.
On the other hand, let’s say that we pick a low cut- off value. Then we might end up with only 3 false negatives, but 14 false positives, so the test has high sensitivity and low specificity, and a large number of people that don’t have diabetes will be misdiagnosed as having it!
That can lead to extra anxiety and a lot of extra expense related to unnecessary medical workups for something that they don’t even have.
So there’s always a trade- off between sensitivity and specificity, so choosing an appropriate cut- off point should depend on the severity of the disease being screened for, the effectiveness of available treatments, and whether the effectiveness is greater if the treatment is administered earlier rather than later.
Now, to calculate sensitivity and specificity, we would have to know the number of individuals who truly have the condition or don’t.
But this usually isn’t the case, since the whole purpose of testing is to figure out if a person has a certain condition.
So, a newly developed test is often compared to an existing gold standard test - the best known test that already exists.
For example, the gold standard test for diabetes is the oral glucose tolerance test, which involves measuring blood glucose levels before and after drinking a certain amount of glucose sugar.
But the oral glucose tolerance test takes multiple hours to complete and it can’t really be used to screen a lot of people at a time, so a new test called the fasting plasma glucose test was developed because it’s simpler and faster.
The fasting plasma glucose test only requires one blood sample and is usually taken in the morning, after a person has fasted overnight.
But before it was put into practice, the fasting plasma glucose test was compared to the oral glucose tolerance test, to make sure it had a relatively high sensitivity and specificity.
Oftentimes, an individual will be tested using two tests, either sequentially or simultaneously. In sequential or two- stage testing, the first test is usually less expensive, less invasive, or less uncomfortable - like the fasting plasma glucose test - and people who test positively are tested again with a more expensive, more invasive, or more uncomfortable test - like the oral glucose tolerance test - and the second test usually has greater sensitivity and specificity.
If a person is positive for both tests, that person is considered to have the condition. On the flip side, people who are negative for the first test or second test are considered to not have the condition.
Ideally, the first test should identify as many people with diabetes as possible, in other words as get as many true positive test results as possible, since getting a negative on the first test means that a person won’t go on to take the second test.
Because of this, it’s better to identify someone in the first test as false positive rather than false negative, so the first test often has a higher sensitivity than specificity.
So, the group of people going into the second test will be mostly true positives and false positives, with very few false negatives.
Then, the second test should rule out the majority of those false positives, so it will often have higher specificity than sensitivity.
In sequential testing, since there are two chances for a person to test negatively, the number of true negatives increases, which results in an increase in the net or combined specificity of the two tests.
For sequential testing, the net specificity is calculated by multiplying the specificities from each test, and then subtracting them by the sum of the two specificities.
For example, let’s say the specificity of the first test is 80% - or 0.8 - and the specificity of the second test is 90% - or 0.9.
In that situation, the equation will look like this: the sum of 0.8 and 0.9, minus the product of 0.8 and 0.9. This gives us 1.7 minus 0.72, for a net specificity of 0.98, or 98%.
This net specificity is higher than the specificities of each individual test. The net sensitivity of two sequential tests is calculated by multiplying the sensitivity of the first test by the sensitivity of the second test.
For example, if the first test’s sensitivity is 70% and the second test’s sensitivity is 90%, then the net sensitivity is 0.7 times 0.9, so 0.63, or 63%.
For sequential testing, the net sensitivity is typically lower than the sensitivities of each individual test, but this is a trade-off for having such a high net specificity.
In simultaneous testing, the two tests are performed on the same individual at the same time. A person is considered to have the condition if they are positive for either test, and if both tests are positive as well.
This means that a person is considered to not have the condition only if they are negative for both tests. This leads to an increase in the number of true positives and a decrease in the number of false negatives, which increases the net sensitivity of the tests.
For simultaneous testing, the net specificity is calculated by multiplying the specificity of the first test by the specificity of the second test.
For example, if the specificity of the first test is 60% and the specificity of the second test is 90%, then the net specificity is 0.6 times 0.9, so 0.54, or 54%.
One important thing to notice is that this equation is similar to the one used to calculate net sensitivity for sequential testing, except in sequential testing the two sensitivities were multiplied, and in simultaneous testing the two specificities are multiplied.
The net sensitivity of two simultaneous tests is calculated by multiplying the sensitivities from each test, and then subtracting them by the sum of the two sensitivities.
For example, let’s say the sensitivity of the first test is 70% - or 0.7 - and the sensitivity of the second test is 90% - or 0.9 - so the calculation will be the sum of 0.7 and 0.9, minus the product of 0.7 and 0.9.
This gives us 1.6 minus 0.63, so the net sensitivity is 0.97, or 97%, which is higher than the sensitivities of each individual test.
Again, this equation is only slightly different than the one used to calculate net specificity for sequential tests. Alright, as a quick recap, a test’s validity refers to how well a test can correctly identify people who have a certain condition - the sensitivity - and people who don’t have a condition - the specificity.
Sensitivity is calculated by dividing the number of true positives, by the total number of all people who have the condition - the true positives and false negatives.
Specificity is calculated by dividing the number of true negatives by the total number of all people who don’t have the condition - the true negatives and false positives.
For sequential testing, the net sensitivity is calculated by multiplying the sensitivity of the first test by the sensitivity of the second test, and the net specificity is calculated by multiplying the specificities from each test, and then subtracting them by the sum of the two specificities.
For simultaneous testing, the net sensitivity is calculated by multiplying the sensitivities from each test, and then subtracting them by the sum of the two sensitivities, and the net specificity is calculated by multiplying the specificity of the first test by the specificity of the second test.
In general, specificity and sensitivity are inversely related, so tests with higher sensitivity will have lower specificity, and vice versa.