# setup chunk options knitr::opts_chunk$set( echo = FALSE ) # load packages library(tableone) library(survival) # other packages
# use Load Mayo Clinic Primary Biliary Cirrhosis Data as example catVars <- c("status","trt","ascites","hepato","spiders","edema","stage") listVars <- colnames(pbc)[!(colnames(pbc) %in% c("id"))] table1 <- CreateTableOne(vars = listVars, data = pbc, factorVars = catVars,strata = c("trt")) kableone(table1)
surv <- survfit(Surv(time, status) ~ x, data = aml) plot(surv, lty = 1:2)
test1 <- list(start=c(1,2,5,2,1,7,3,4,8,8), stop=c(2,3,6,7,8,9,9,9,14,17), event=c(1,1,1,1,1,1,1,0,0,0), x=c(1,0,0,1,0,1,1,1,0,0)) summary(coxph(Surv(start, stop, event) ~ x, test1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.