source('utils.R') set.seed(12345) DF = load_table_11_5_data() # Now perform boostraps of the above dataframe: # library(boot) B = 500 samplemedian = function(x, d){ return(quantile(x[d], 0.8)) } 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))