pdf("ex0903.pdf") ex0903dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0903.dat", width=c(8,8,8,8,8), col.names=c("pair", "remiss","group","remisstime","censor")) ex0903 <- data.frame(ex0903dat) attach(ex0903) ex0903 # Load the survival analysis package library(survival) # Obtain survival tables and curves by group surv.byreg <- survfit(Surv(remisstime, censor==0)~group) summary(surv.byreg) plot(surv.byreg) # Conduct the Log-Rank test to compare survival curves survdiff(Surv(remisstime,censor==0)~group) # Fit the Proportional Hazards Model ex0903.cph <- coxph(Surv(remisstime,censor==0) ~ group) summary(ex0903.cph) dev.off()