Exchange the x-axis and y-axis in order to flip ROC curve I have a continuous variable X and a binary response outcome D.
The ROC curve I got for D with respect to X is below the diagonal line, as shown in the following picture.
In this ROC curve, the true positive rate(y-axis) is defined as P{X>c|D=1}, and the false positive rate(x-axis) is P{X>c|D=0}.
I want to flip the ROC curve. The true positive rate should be changed to P{X>c|D=0}, and the false positive rate should be changed to P{X>c|D=1}.
Could I exchange the x-axis and y-axis in order to flip the ROC curve?


When your ROC curve is below the diagonal line, and your AUC is < 0.5, this means that your classifier is worse than random. In other words, it works well, but wrong.
What you want is actually to swap your definition of a positive case, so that instead of saying an observations is positive when X > c, and negative when X <= c, it becomes positive when X <= c, and negative when X > c.
As a consequence, the true positive rate is now defined as P(X<=c|D=1), and the false positive rate is P{X<=c|D=0}.
Not only will your ROC curve flip above the line, but your classifier will make much more sense as well.
