knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of AdjKMCIF is to create the covariate-adjusted Kaplan-Meier and cumulative incidence functions.
More specific introduction of the package can be found at https://lesly1031.github.io/AdjKMCIF/
You can install the development version of AdjKMCIF from GitHub with:
# install.packages("devtools") devtools::install_github("Lesly1031/AdjKMCIF",dependencies = TRUE)
library(AdjKMCIF) library(tidyverse) library(DT) library(data.table) 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
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)
result1_1 = boot_ci_adj_km(boot_n = 100, ci_cut = c(0.025, 0.975), data = bmt, time = "t2", status = "d3", group = "arm", covlist = c("z1", "z3"), stratified_cox = "No", reference_group = NULL)
adjKM_CI_plot(result1_1, bmt)
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
result1 = adjusted_CIF(data = bmt, time = "t2", status = "CenCI", group = "arm", covlist = c("z1", "z3"), event_code = 1, stratified = "No", reference_group = NULL) table_res1 = spread(result1, class, prob) head(table_res1)
Figure
adjCIF_plot(result1, data = bmt)
result1_boot = 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)
Figure
adjCIF_CI_plot(result1_boot, bmt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.