roc {BDgraph} | R Documentation |
Build a ROC curve
Description
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 prin
ted, plot
ted, 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
.
Usage
roc( pred, actual, auc = TRUE, smooth = FALSE, plot = FALSE, quiet = TRUE, ... )
Arguments
pred |
adjacency matrix (or a vector) corresponding to an estimated graph.
It can be an object with |
actual |
adjacency matrix (or a vector) corresponding to the actual graph structure in which |
smooth |
if TRUE, the ROC curve is passed to |
auc |
compute the area under the curve (AUC)? If |
plot |
plot the ROC curve? If |
quiet |
if |
... |
further arguments to be passed to |
Value
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 |
predictor vector converted to numeric as used to build the ROC
curve. Patients whose response is not |
original.predictor , original.response |
response and predictor vectors as passed in argument. |
levels |
levels of the response as defined in argument. |
controls |
predictor values for the control observations. |
cases |
predictor values for the cases. |
percent |
if the sensitivities, specificities and AUC are reported in percent, as defined in argument. |
direction |
direction of the comparison, as defined in argument. |
fun.sesp |
function used to compute sensitivities and specificities. Will be re-used in bootstrap operations. |
sensitivities |
sensitivities defining the ROC curve. |
specificities |
specificities defining the ROC curve. |
thresholds |
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).
Author(s)
Reza Mohammadi a.mohammadi@uva.nl; Lucas Vogels l.f.o.vogels@uva.nl
References
Tom Fawcett (2006) “An introduction to ROC analysis”. Pattern Recognition Letters 27, 861–874, 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:10.1186/1471-2105-12-77.
See Also
plotroc
, pROC::plot.roc()
, pROC::auc()
, pROC::print.roc()
, bdgraph
, bdgraph.mpl
, compare
Examples
## Not run:
set.seed( 5 )
# Generating multivariate normal data from a 'scale-free' graph
data.sim = bdgraph.sim( n = 200, p = 15, graph = "scale-free", vis = TRUE )
# Running BDMCMC algorithm
sample.bdmcmc = bdgraph( data = data.sim, algorithm = "bdmcmc", iter = 10000 )
# ROC curve for BDMCMC algorithm
roc.bdmcmc = BDgraph::roc( pred = sample.bdmcmc, actual = data.sim, plot = TRUE )
# Running RJMCMC algorithm
sample.rjmcmc = bdgraph( data = data.sim, algorithm = "rjmcmc", iter = 10000 )
# ROC curve for RJMCMC algorithm
roc.rjmcmc = BDgraph::roc( pred = sample.rjmcmc, actual = data.sim, plot = TRUE )
# ROC curve for both BDMCMC and RJMCMC algorithms
pROC::ggroc( list( BDMCMC = roc.bdmcmc, RJMCMC = roc.rjmcmc ) )
## End(Not run)