# More details on bootstrap procedure to estimate confidence interval of sample SD

I originally asked the question in this post, where I explained that I only have 25 measures at my disposal. Hence, computing the sample SD $\sigma_x$ and assume it's the one from the distribution looks to be very optimistic and I wanted to compute a confidence interval.

It was suggested to me to use the bootstrapping method, but I'm not sure how exactly to use it; I believe that I would have to proceed as follows:

• make some assumption over the underlying probability distribution behind my sample, for example, I assume that it is normal, and apply the parameter I estimated : $\mathcal{N}(s, \sigma_x)$
• Generate $n$ samples of size 25 (precisely the same size as my original sample)
• Compute the sample SD of each of the 25
• And then look at the (85%) which are the closest to the mean; they all will be in the 85% interval.

I guess I got it right , but I have to make an assumption on the underlying distribution, which I would really like to avoid.

Is there another way to go, or did I misunderstand somehting?

Yes, you missed something, or rather added something. You're doing parametric bootstrap, which is only appropriate if you know something about the kind of distribution you expect. Furthermore, you'd estimate that parametric distribution using mle. In your case, where you have no idea the distribution, leave out the assumption of normality and use simple case resampling. Get your sample from the data, not from the theoretical distribution. So just resample 25 from your sample of 25 WITH replacement. Do that a large number of times and you can generate a confidence interval. If I assume your data is y then in R the code might typically be....

library(boot)
sdb <- function(y, i) sd(y[i])  #boot needs a function of y that can index y
b <- boot(y, sdb, 1000)
boot.ci(b)


But, you might prefer to do such a simple example by more explicit means and therefore see what's really going on and play with the guts of it. Note that b below is not the same thing as b above.

b <- sapply( 1:1000, function(x) {
s <- sample(y, 25, replace = TRUE)
sd(s) } )
b <- sort(b)
#low end of CI
b
#hi end of CI
b

• By resampling, I understandood pick them in a random order.... but I guess that with replacement means that one of the "resamples" could possibly be 25 times the same value (possibly). I simply take my 25 values, and randomly $n$ of them to have the "resample" and to that 1000 times right? – SRKX Dec 10 '11 at 15:20
• right... do it a 1000 times for a quick look... 10,000 times for a more solid result – John Dec 10 '11 at 15:43