Chapter 7 Resampling and simulation in R

In this chapter we will use R to undestand how to resample data and perform numerical simulations.

7.3 The bootstrap

The bootstrap is useful for creating confidence intervals in cases where we don’t have a parametric distribution. One example is for the median; let’s look at how that works. We will start by implementing it by hand, to see more closely how it works. We will start by collecting a sample of individuals from the NHANES dataset, and the using the bootstrap to obtain confidence intervals on the median for the Height variable.

Lower CI limit Median Upper CI limit
161.6 167.65 171.1