# Load in example dataset d
data(d)
# Create labels for race
races = c("White","Black","Mexican American","Other")
# Test whether race is associated with survival
coxtable1 = tabcox(x=d$race,time=d$time,delta=d$delta,xlabels=c("Race",races))
# Test whether age, sex, race, and treatment group are associated with survival
coxtable2 = tabcox(x=d[,c("age","sex","race","group")],time=d$time,delta=d$delta,
xlabels=c("Age","Male","Race",races,"Treatment"))
# Click on coxtable1 and coxtable2 in the Workspace tab of RStudio to see the tables
# that could be copied and pasted into a report or manuscript.
Run the code above in your browser using DataLab