Description Usage Arguments Details Value Author(s) References See Also Examples
The receiver operating characteristic (ROC) curve for two constituent distributions F and G is defined as
R(t; F, G) = 1  G(F^{1}(1  t))
for t \in [0, 1]. It is typically used to assess the performance of a diagnostic test used to discriminate between healthy and diseased individuals based on a continuous variable.
1 
cases 
A vector of measurements for the cases. 
controls 
A vector of measurements for the controls. 
grid 
A vector specifying the grid where the ROC curve is computed on. 
smooth 
Logical, indicating whether ROC curve and AUC should also be computed based on the smoothed logconcave density estimator. 
In Rufibach (2011) it was shown that the ROC curve based on logconcave density estimates exhibit nice properties for finite sample sizes as well as asymptotically. Its performance is typically much better than that of the empirical ROC curve and only, if at all, sligthly worse compared to the binormal model when in fact the underlying densities are normal. However, logconcavity encompasses many parametric densities, so this new model is much more flexible than the binormal one, at little efficiency sacrifice.
m 
Number of control measurements. 
n 
Number of case measurements. 
fROC 
Estimated ROC curve based on the logconcave density estimate. 
fROC.smooth 
Estimated ROC curve based on the smoothed logconcave density estimate. 
res0 

res1 

Kaspar Rufibach, kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch
Duembgen, L. and Rufibach, K. (2009). Maximum likelihood estimation of a log–concave density and its distribution function: basic properties and uniform consistency. Bernoulli, 15(1), 40–68.
Duembgen, L. and Rufibach, K. (2011). logcondens: Computations Related to Univariate LogConcave Density Estimation. Journal of Statistical Software, 39(6), 1–28. http://www.jstatsoft.org/v39/i06
Rufibach, K. (2012). A smooth ROC curve estimator based on logconcave density estimates. Int. J. Biostat., 8(1), 1–29.
Confidence intervals at given falsepositive fractions for the ROC curve based on logconcave densities can be computed using confIntBootLogConROC_t0
. For the computation of the AUC the function ROCx
is used. In the example below we analyze the
pancreas
data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36  ## ROC curve for pancreas data
data(pancreas)
status < factor(pancreas[, "status"], levels = 0:1,
labels = c("healthy", "diseased"))
var < log(pancreas[, "ca199"])
cases < var[status == "diseased"]
controls < var[status == "healthy"]
## compute and plot empirical ROC curve
## code modified from https://stat.ethz.ch/pipermail/rhelp/2008October/178531.html
xx < c(Inf, sort(unique(c(cases, controls))), Inf)
sens < sapply(xx, function(x){mean(cases >= x)})
spec < sapply(xx, function(x){mean(controls < x)})
## compute logconcave ROC curve
grid < seq(0, 1, by = 1 / 500)
roc.logcon < logConROC(cases, controls, grid)
## plot
plot(0, 0, xlim = c(0, 1), ylim = c(0, 1), type = 'l',
main = "ROC curves for pancreas data", xlab = "1  specificity",
ylab = "sensitivity", pty = 's')
legend("bottomright", c("empirical ROC", "logconcave ROC", "smooth logconcave ROC"),
lty = c(1, 1, 2), lwd = 2, col = 2:4, bty = "n")
segments(0, 0, 1, 1, col = 1)
lines(1  spec, sens, type = 'l', col = 2, lwd = 2)
lines(grid, roc.logcon$fROC, col = 3, lwd = 2)
lines(grid, roc.logcon$fROC.smooth, col = 4, lwd = 2, lty = 2)
## Not run:
## bootstrap confidence intervals at 1  specificity = 0.2 and 0.8:
res < confIntBootLogConROC_t0(controls, cases, grid = c(0.2, 0.8), conf.level = 0.95,
M = 1000, smooth = TRUE, output = TRUE)
res
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.