Description Usage Arguments Value Author(s) Examples
View source: R/plot_sscaROC_CB.R
A function to plot the confidence band of covariate-adjusted ROC in specific subpopulations.
1 | plot_sscaROC_CB(myROC_CB, add = TRUE, ...)
|
myROC_CB |
Output from sscaROC_CB() function. |
add |
Whether to add confidence band to existing plot (TRUE) or draw a new one (FALSE). Default is TRUE. |
... |
Any parameters related with the plot. |
No values will be return. This function is for plotting only.
Ziyi Li<zli16@mdanderson.org>
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 37 38 39 40 41 42 43 44 | n1 = n0 = 500
## generate data
Z_D1 <- rbinom(n1, size = 1, prob = 0.3)
Z_D2 <- rnorm(n1, 0.8, 1)
Z_C1 <- rbinom(n0, size = 1, prob = 0.7)
Z_C2 <- rnorm(n0, 0.8, 1)
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_C1 == 0) + Y_C_Z1 * (Z_C1 == 1) + Z_C2
M1 <- Y_D_Z0 * (Z_D1 == 0) + Y_D_Z1 * (Z_D1 == 1) + 1.5 * Z_D2
diseaseData <- data.frame(M = M1, Z1 = Z_D1, Z2 = Z_D2)
controlData <- data.frame(M = M0, Z1 = Z_C1, Z2 = Z_C2)
userFormula = "M~Z1+Z2"
target_covariates = c(1, 0.7, 0.9)
myROC <- sscaROC(diseaseData,
controlData,
userFormula,
target_covariates,
global_ROC_controlled_by = "sensitivity",
mono_resp_method = "none")
# default nbootstrap is 100
# set nboostrap as 10 here to improve example speed
myROCband <- sscaROC_CB(diseaseData,
controlData,
userFormula,
mono_resp_method = "none",
target_covariates,
global_ROC_controlled_by = "sensitivity",
CB_alpha = 0.95,
logit_CB = FALSE,
nbootstrap = 10,
nbin = 100,
verbose = FALSE)
plot_sscaROC(myROC, lwd = 1.6)
plot_sscaROC_CB(myROCband, col = "purple", lty = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.