> library(boot) > data(aircondit) > aircondit$hours [1] 3 5 7 18 43 85 91 98 100 130 230 487 > t.test(aircondit$hours) One Sample t-test data: aircondit$hours t = 2.7483, df = 11, p-value = 0.01895 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 21.52561 194.64105 sample estimates: mean of x 108.0833 > samplemean = function(x, i) { mean(x[i]) } > b = boot(aircondit$hours, samplemean, 1000) > boot.ci(b) BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS Based on 1000 bootstrap replicates CALL : boot.ci(boot.out = b) Intervals : Level Normal Basic 95% ( 33.2, 181.6 ) ( 18.9, 166.3 ) Level Percentile BCa 95% ( 49.8, 197.3 ) ( 59.9, 236.6 ) Calculations and Intervals on Original Scale Some BCa intervals may be unstable