plot_caROC: Plot covariate-adjusted ROC.

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot_caROC.R

Description

Function to plot the ROC curve generated from caROC().

Usage

1
plot_caROC(myROC, ...)

Arguments

myROC

ROC output from caROC() function.

...

Arguments to tune generated plots.

Details

This function can be used to plot other ROC curve, as long as the input contains two components "sensitivity" and "specificity".

Value

Plot the ROC curve.

Author(s)

Ziyi Li <zli16@mdanderson.org>

Examples

 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
n1 = n0 = 500

## generate data
Z_D <- rbinom(n1, size = 1, prob = 0.3)
Z_C <- rbinom(n0, size = 1, prob = 0.7)

Y_C_Z0 <- rnorm(n0, 0.1, 1)
Y_D_Z0 <- rnorm(n1, 1.1, 1)
Y_C_Z1 <- rnorm(n0, 0.2, 1)
Y_D_Z1 <- rnorm(n1, 0.9, 1)

M0 <- Y_C_Z0 * (Z_C == 0) + Y_C_Z1 * (Z_C == 1)
M1 <- Y_D_Z0 * (Z_D == 0) + Y_D_Z1 * (Z_D == 1)

diseaseData <- data.frame(M = M1, Z = Z_D)
controlData <- data.frame(M = M0, Z = Z_C)
userFormula = "M~Z"

ROC1 <- caROC(diseaseData,controlData,userFormula,
                 mono_resp_method = "none")
ROC2 <- caROC(diseaseData,controlData,userFormula,
                 mono_resp_method = "ROC")

plot_caROC(ROC1)
plot_caROC(ROC2, col = "blue")

ziyili20/caROC documentation built on March 28, 2021, 2:52 a.m.