View source: R/adjust_CIF_plot.R
adjCIF_CI_plot | R Documentation |
Use results from boot_ci_adj_cif() and input dataset to generate adjusted CIF plot with bootstrap CI (users can also produce a figure by using ggplot2)
adjCIF_CI_plot(res, data)
res |
results from boot_ci_adj_cif() |
data |
the input dataset |
Adjusted CIF plot with CI will be shown after running this function
library(KMsurv) data(bmt) bmt$arm <- bmt$group bmt$arm = factor(as.character(bmt$arm), levels = c("2", "1", "3")) bmt$z3 = as.character(bmt$z3) bmt$CenCI <- 0 for (ii in 1:137) { if (bmt$d3[ii] == 0) { bmt$CenCI[ii] <- 0 } else { if (bmt$d2[ii] == 1) { bmt$CenCI[ii] <- 1 } else { bmt$CenCI[ii] <- 2 } } } bmt$t2 = bmt$t2 * 12/365.25 # Adjusted CIF plot with bootstrap CI result = boot_ci_adj_cif(boot_n = 100, ci_cut = c(0.025, 0.975), data = bmt, time = "t2", status = "CenCI", group = "arm", covlist = c("z1", "z3"), event_code = 1, "No", NULL) adjCIF_CI_plot(result, data = bmt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.