# Load in example dataset d
data(d)
# Create labels for race
races = c("White","Black","Mexican American","Other")
# Test whether race is associated with 1-year mortality
logtable1 = tablog(x=d$race,y=d$death_1yr,xlabels=c("Race",races))
# Test whether age, sex, race, and treatment group are associated with 1-year mortality
logtable2 = tablog(x=d[,c("age","sex","race","group")],y=d$death_1yr,
xlabels=c("Age","Male","Race",races,"Treatment"))
# Click on logtable1 and logtable2 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