| roc {BDgraph} | R Documentation |
This function builds a ROC curve specifically for graph structure learning and returns a “roc” object, a list of class
“roc”. This object can be printed, plotted, or
passed to the functions pROC::roc(), pROC::ci(), pROC::smooth.roc()
and pROC::coords(). Additionally, two roc objects can be compared with pROC::roc.test().
This function is based on the roc function of R package pROC.
roc( pred, actual, auc = TRUE, smooth = FALSE, plot = FALSE, ... )
pred |
An adjacency matrix corresponding to an estimated graph.
It can be an object with |
actual |
An adjacency matrix corresponding to the actual graph structure in which a_{ij}=1 if there is a link between notes i and j, otherwise a_{ij}=0.
It can be an object with |
smooth |
if TRUE, the ROC curve is passed to |
auc |
compute the area under the curve (AUC)? If |
plot |
plot the ROC curve? If |
... |
further arguments to be passed to |
If the data contained any NA value and na.rm=FALSE, NA is
returned. Otherwise, if smooth=FALSE, a list of class
“roc” with the following fields:
auc |
if called with |
ci |
if called with |
response |
the response vector. Patients whose response is not
|
predictor |
the predictor vector converted to numeric as used to build the ROC
curve. Patients whose response is not |
original.predictor, original.response |
the response and predictor vectors as passed in argument. |
levels |
the levels of the response as defined in argument. |
controls |
the predictor values for the control observations. |
cases |
the predictor values for the cases. |
percent |
if the sensitivities, specificities and AUC are reported in percent, as defined in argument. |
direction |
the direction of the comparison, as defined in argument. |
fun.sesp |
the function used to compute sensitivities and specificities. Will be re-used in bootstrap operations. |
sensitivities |
the sensitivities defining the ROC curve. |
specificities |
the specificities defining the ROC curve. |
thresholds |
the thresholds at which the sensitivities and specificities were computed. See below for details. |
call |
how the function was called. See |
If smooth=TRUE a list of class “smooth.roc” as returned
by pROC::smooth(), with or without additional elements
auc and ci (according to the call).
Reza Mohammadi a.mohammadi@uva.nl
Tom Fawcett (2006) “An introduction to ROC analysis”. Pattern Recognition Letters 27, 861–874. DOI: doi: 10.1016/j.patrec.2005.10.010.
Xavier Robin, Natacha Turck, Alexandre Hainard, et al. (2011) “pROC: an open-source package for R and S+ to analyze and compare ROC curves”. BMC Bioinformatics, 7, 77. DOI: doi: 10.1186/1471-2105-12-77.
pROC::auc(), pROC::plot.roc(), pROC::print.roc(), bdgraph
## Not run: set.seed( 100 ) # Generating multivariate normal data from a 'random' graph data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE ) # Running sampling algorithm based on GGMs sample.ggm <- bdgraph( data = data.sim, method = "ggm", iter = 10000 ) # ROC curve for GGM method roc.ggm <- roc( pred = sample.ggm, actual = data.sim, plot = TRUE ) # Running sampling algorithm based on GCGMs sample.gcgm <- bdgraph( data = data.sim, method = "gcgm", iter = 10000 ) # ROC curve for GGM and GCGM methods roc.gcgm <- roc( pred = sample.gcgm, actual = data.sim, plot = TRUE ) ggroc( list( roc.ggm = roc.ggm, roc.gcgm = roc.gcgm ) ) ## End(Not run)