source('utils.R') set.seed(12345) DF = load_table_11_5_data() sf = make_kaplan_meir_survival_curve(DF) #postscript("../../WriteUp/Graphics/Chapter11/ex_11_1_plot.eps", onefile=FALSE, horizontal=FALSE) plot(sf, do.points=FALSE, xlab='months to death or end of trial', ylab='survival probality', main='Kaplan-Meir Survial Curve for Treated Patients') grid() #dev.off() # Now perform boostraps of the above dataframe: # library(boot) B = 500 res = boot(DF$time, samplemedian, B) s = sd(res$t) print(sprintf('t0= %5.3f; 95%% CI=(%5.3f, %5.3f)', res$t0, res$t0 - 2*s, res$t0 + 2*s))