I iterated delong tests through a list of values that I wanted to compare. I got the results which looks like this:
$`7 V 8`
DeLong's test for two correlated ROC curves
data: test1 and test2
Z = 6.6128, p-value = 3.771e-11
alternative hypothesis: true difference in AUC is not equal to 0
95 percent confidence interval:
0.04771894 0.08792131
sample estimates:
AUC of roc1 AUC of roc2
0.8122934 0.7444732
I was wondering if it is possible to get the values (for Z, p-Value, CI, AUC ROC1 and AUC ROC2) of each delong test into a dataframe/table. I tried to extract it but it seems not to work if you use
roc.test(test1, test2, reuse.auc=TRUE, method="delong", na.rm=TRUE)
Does anyone has an idea on this?
Thanks so much!!
Best!
The results of the
roc.testfunction is an S3 object of class htest. It follows the conventions for saving the results of hypothesis tests in R, and prints/works nicely with the base (stats) R functions.The broom package has a
glancefunction which can convert it to a more programmer-friendly tabular format:Make sure to keep the object marked as an
htestobject and don't accidentally convert it to a list, otherwise theglancefunction wouldn't know how to handle it.