View source: R/adjust_KM_plot.R
adjKM_plot | R Documentation |
Use results from adjusted_KM() and input dataset to generate adjusted survival plot (users can also produce a figure by using ggplot2)
adjKM_plot(res, data)
res |
results from adjusted_KM() |
data |
the input dataset |
Adjusted KM plot will be shown after running this function
# Data preparation 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$t2 = bmt$t2 * 12/365.25 # Cox model result1 = adjusted_KM(data = bmt, time = "t2", status = "d3", group = "arm", covlist = c("z1", "z3"), stratified_cox = "No", reference_group = NULL) adjKM_plot(result1, data = bmt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.