# Is a Sensitivity-Specificity curve equal to a horizontally flipped ROC?

So I need to plot a Sensitivity-Specificity curve. Since ROCs represent TPR (sensitivity) against FPR (or 1 - Specificity), can I just plot TPR against 1 - FPR as in the code below to obtain a Sens-Spec curve?

import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve

...

fpr, tpr, _ = roc_curve(y_test, y_score)
spec = 1 - fpr

#first plot (ROC)
plt.figure()
plt.plot(spec,tpr)

#second plot (Sens-Spec?)
plt.figure()
plt.plot(spec,tpr)


I plotted the results and compared it to the actual ROC, but I'm not sure if this is a correct way to do it or if I'm missing something.

• ROC = sensitivity vs. 1 - specificity. So sens vs spec is just flipped for one axis. Neither ROC nor sens vs spec are relevant because they make the error of transposed conditionals; each point is a conditional probability that conditions on what is unknown to compute the probability of what is already known. Commented Sep 1, 2022 at 15:45
• @FrankHarrell thank you. That's what I was thinking but needed someone to confirm it. Commented Sep 1, 2022 at 17:02

Yes. The pROC package in R even writes the x-axis this way.
library(pROC)