Estimation of standard errors with bootstrapping
In the following, we discuss the bootstrap in detail also by taking hands-on R. Before the estimation of the standard error is in focus, some definitions are repeated in more detail.
Let's consider the following toy example with the following seven numbers. We use such a small sample and toy example just to explain the bootstrap in R. The estimator of interest should be the arithmetic mean in our example:
x <- c(5, 7, 8, 2, 15, 12, 3)
We next define the bootstrap sample. A bootstrap sample is random sample
with replacement from the sample . One bootstrap sample is given by:
## for reproducibility we use a seed set.seed (123) ## bootstrap sample (with replacement) s1 <- sample(x, replace = TRUE) s1 ## [1] 8 12 8 3 3 5 2
We see that this bootstrap sample does not include a 7 and a 15, but two times the 3 and 8. This can happen since we sample with replacement, meaning that if we draw a number, it will be replaced so that the next...