# Lifetimes in hours of a sample of n=5 # light bulbs x <- c(125, 217, 325, 412, 1220) # Compute sample mean and sample standard deviation xmean <- mean(x) xmean xstd <- sqrt(var(x)) xstd # Estimate the median lifetime x50 <- quantile(x, 0.5) x50 # Obtain 1000 bootstrap replicates of the # estimate of the median from a samples of # size 5 y <- bootstrap(x, median, 1000) summary(y) names(y) # Construct a histogram of the bootstrap values par(fin=c(8,8),cex=1.2) lab <- "1000 Bootstrap Median Estimates (n=5)" hist(y$replicates, main=lab)