adjCIF_plot.Rd
Use results from adjusted_CIF() and input dataset to generate adjusted CIF plot (users can also produce a figure by using ggplot2)
adjCIF_plot(res, data)
results from adjusted_CIF()
the input dataset
Adjusted CIF plot 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 without CI
result = adjusted_CIF(data = bmt, time = "t2", status = "CenCI", group = "arm",
covlist = c("z1", "z3"), event_code = 1, stratified = "Yes", reference_group = "arm:2")
adjCIF_plot(result, data = bmt)