Most clinical tests are not 100% accurate for determining the presence of a condition. Typically, we assign some cutoff and say that test values above that cutoff are "positive" and below that are "negative". For any choice of cutoff, however, some people without the condition will get false-positive (FP) results and some with the condition will get false-negative (FN) results. The fraction of people with the condition who get true-positive (TP) results is called the sensitivity. The fraction of those without the condition that get true-negative (TN) results is called the specificity. By adjusting the cutoff, you can improve the sensitivity (fewer FNs) but at the cost of reducing the specificity (more FPs).
This simulation draws people randomly from a box where some have the condition and some don't. You can set those numbers. It then assigns positive or negative test results to each one, with the probabilities given by the sensitivity and specificity of the test. In this case, the condition is diabetes and the test is the fasting capillary glycemia (FCG) level.
The following is the receiver operating characteristics (ROC) curve of the diabetes screening test using FCG. Data are taken from Diabetes Care, 17, 11 (1994).
|
Adjust FCG cutoff to see how the TP, TN, FP and FN change:
Although the sensitivity and specificity depend on the cutoff chosen, the number of TNs, FNs, TPs, and FPs you see depend also on how prevalent the condition is in the population.
Two other commonly asked questions are:
1. If a patient gets a positive test result, what is the chance that the patient really has diabetes? Let's denote this probability by P(Diabetes|+).
2. If a patient gets a negative test result, what is the chance that the patient doesn't have diabetes? Let's denote this probability by P(No Diabetes|-).
It is easy to see that
P(Diabetes|+) = True positives/total positives = NTP/(NTP + NFP)
P(No Diabetes|-) = True negatives/total negatives = NTN/(NTN + NFN)
Here NTP = TP×Ndiabetes is the number of true positives and Ndiabetes is the number of people with diabetes in the population; NFP = FP×NnoDiabetes is the number of false positives and NnoDiabetes is the number of people without diabetes in the population; NTN = TN×NnoDiabetes is the number of true negatives and NFN = FN×Ndiabetes is the number of false negatives.
Parameters (you can change the values and then click the submit button below):
You can change the cutoff and population prevalence and rerun the simulation. Or you can keep those parameters fixed and rerun the simulation, just to see the statistical variation in the outcomes from batch to batch.
|
|
Click the following button to rerun the simulation to see the statistical variation.