 # Function auroc: how can i get the ROC plot data?

Hello there

mixOmics did a great job in my study area. When i run the example, like:

``````data(breast.tumors)
X <- breast.tumors\$gene.exp
Y <- breast.tumors\$sample\$treatment
splsda.breast <- splsda(X, Y, ncomp = 2, keepX = c(25, 25))
auc.splsda = auroc(splsda.breast, roc.comp = 2)
``````

it will get ROC plot, like:

and i want to get the plot data, like:
`auc.splsda\$graph.Comp2\$data`

Well, i dont understand why the plot data just look like below, it doesn’t seem to correspond to the plot result. Actuall, when i use the data with more than 4 groups, the same problem was shown which the data doesnt correspond to the plot result. So, am i understand right about this problem? How can i get the ROC plot data?

``````                  Specificity Sensitivity      Outcome
(1.24, Inf]               100  100.000000 AF vs BE : 1
(1.16,1.24]                95  100.000000 AF vs BE : 1
(1.1,1.16]                 90  100.000000 AF vs BE : 1
(1.07,1.1]                 85  100.000000 AF vs BE : 1
(1.06,1.07]                80  100.000000 AF vs BE : 1
(1.05,1.06]                75  100.000000 AF vs BE : 1
(1.02,1.05]                70  100.000000 AF vs BE : 1
(0.977,1.02]               65  100.000000 AF vs BE : 1
(0.953,0.977]              60  100.000000 AF vs BE : 1
(0.919,0.953]              55  100.000000 AF vs BE : 1
(0.869,0.919]              50  100.000000 AF vs BE : 1
(0.845,0.869]              45  100.000000 AF vs BE : 1
(0.831,0.845]              40  100.000000 AF vs BE : 1
(0.818,0.831]              35  100.000000 AF vs BE : 1
(0.775,0.818]              30  100.000000 AF vs BE : 1
(0.727,0.775]              25  100.000000 AF vs BE : 1
(0.717,0.727]              20  100.000000 AF vs BE : 1
(0.687,0.717]              15  100.000000 AF vs BE : 1
(0.581,0.687]              10  100.000000 AF vs BE : 1
(0.427,0.581]               5  100.000000 AF vs BE : 1
(0.341,0.427]               0    0.000000 AF vs BE : 1
(0.302,0.341]               0    3.703704 AF vs BE : 1
(0.269,0.302]               0    7.407407 AF vs BE : 1
(0.24,0.269]                0   11.111111 AF vs BE : 1
(0.2,0.24]                  0   14.814815 AF vs BE : 1
(0.184,0.2]                 0   18.518519 AF vs BE : 1
(0.18,0.184]                0   22.222222 AF vs BE : 1
(0.176,0.18]                0   25.925926 AF vs BE : 1
(0.166,0.176]               0   29.629630 AF vs BE : 1
(0.126,0.166]               0   33.333333 AF vs BE : 1
(0.0923,0.126]              0   37.037037 AF vs BE : 1
(0.0869,0.0923]             0   40.740741 AF vs BE : 1
(0.082,0.0869]              0   44.444444 AF vs BE : 1
(0.0714,0.082]              0   48.148148 AF vs BE : 1
(0.0588,0.0714]             0   51.851852 AF vs BE : 1
(0.0518,0.0588]             0   55.555556 AF vs BE : 1
(0.0372,0.0518]             0   59.259259 AF vs BE : 1
(0.00668,0.0372]            0   62.962963 AF vs BE : 1
(-0.0319,0.00668]           0   66.666667 AF vs BE : 1
(-0.0604,-0.0319]           0   70.370370 AF vs BE : 1
(-0.0722,-0.0604]           0   74.074074 AF vs BE : 1
(-0.0955,-0.0722]           0   77.777778 AF vs BE : 1
(-0.131,-0.0955]            0   81.481481 AF vs BE : 1
(-0.175,-0.131]             0   85.185185 AF vs BE : 1
(-0.217,-0.175]             0   88.888889 AF vs BE : 1
(-0.239,-0.217]             0   92.592593 AF vs BE : 1
(-Inf,-0.239]               0   96.296296 AF vs BE : 1
0  100.000000 AF vs BE : 1
``````

Hi @huwanjin,

The `auc.splsda\$graph.Comp2` object is a `ggplot` object which is plotted when you print it. The `\$data` entry in the object simply reflects data created and used by ggplot to visualise the output, not the data used or generated by the model.

The `auroc` function simply uses the splsda model to predict the original data and generates the `AUC` plots for each component based on these predictions.

Hope it helps,

Al

Hi:

The `auroc` function created the ROC plot, right? Back to the question I asked at the beginning. The label of the x coordinate of the ROC plot is `100-Specificity(%).` But when using the script `auc.splsda\$graph.Comp2\$data` to show the plot data, i found that the header of the second column of data is `Specificity`, actually the correct header should be `100-Specificity(%)`, you can check the part of plot data:

``````(0.341,0.427]               0    0.000000 AF vs BE : 1
(0.302,0.341]               0    3.703704 AF vs BE : 1
(0.269,0.302]               0    7.407407 AF vs BE : 1
(0.24,0.269]                0   11.111111 AF vs BE : 1
(0.2,0.24]                  0   14.814815 AF vs BE : 1
(0.184,0.2]                 0   18.518519 AF vs BE : 1
(0.18,0.184]                0   22.222222 AF vs BE : 1
(0.176,0.18]                0   25.925926 AF vs BE : 1
(0.166,0.176]               0   29.629630 AF vs BE : 1
(0.126,0.166]               0   33.333333 AF vs BE : 1
(0.0923,0.126]              0   37.037037 AF vs BE : 1
(0.0869,0.0923]             0   40.740741 AF vs BE : 1
(0.082,0.0869]              0   44.444444 AF vs BE : 1
(0.0714,0.082]              0   48.148148 AF vs BE : 1
(0.0588,0.0714]             0   51.851852 AF vs BE : 1
(0.0518,0.0588]             0   55.555556 AF vs BE : 1
(0.0372,0.0518]             0   59.259259 AF vs BE : 1
(0.00668,0.0372]            0   62.962963 AF vs BE : 1
(-0.0319,0.00668]           0   66.666667 AF vs BE : 1
(-0.0604,-0.0319]           0   70.370370 AF vs BE : 1
(-0.0722,-0.0604]           0   74.074074 AF vs BE : 1
(-0.0955,-0.0722]           0   77.777778 AF vs BE : 1
(-0.131,-0.0955]            0   81.481481 AF vs BE : 1
(-0.175,-0.131]             0   85.185185 AF vs BE : 1
(-0.217,-0.175]             0   88.888889 AF vs BE : 1
(-0.239,-0.217]             0   92.592593 AF vs BE : 1
(-Inf,-0.239]               0   96.296296 AF vs BE : 1
0  100.000000 AF vs BE : 1
``````

The second column of data should definitely be x coordinate of the ROC plot, which is `100-Specificity(%)`.

Although it is a small problem, it is easy to make users get confused. Maybe there are some ways to solve this problem?

I hope I clarified my question.

Thanks