Bootstrap confidence intervals
Building a bootstrap confidence interval
- Resample the sample with replacement, same size, and record the statistic (e.g. the median).
- Repeat this many times (1000 or more), building a bootstrap distribution of that statistic.
- The confidence interval is the middle 95% of that distribution — the values from the 2.5th percentile up to the 97.5th percentile.
- Software (such as iNZight) does the resampling; your job is to read off and interpret the interval.
What the interval means
- A 95% bootstrap confidence interval is a range of plausible values for the population statistic.
- Interpret it in context: "I am confident that the population median [quantity] lies between [low] and [high]."
- A wider interval means more uncertainty. Small samples give wide intervals; a larger sample gives a narrower, more useful one.
Comparing two groups
- To compare two groups, bootstrap each group and record the difference between their medians each time.
- The bootstrap distribution of the difference gives a confidence interval for the difference between the two population medians — the basis for making a call.
Bootstrapping the difference (Brand A battery life − Brand B battery life, in hours) 1000 times gives a 95% confidence interval of to hours. Interpret this interval.
Reading the interval
The interval is for the difference between the two population medians, and it runs from to hours — entirely positive.
In context
I am confident that the population median battery life of Brand A is between and hours longer than Brand B. The interval is fairly wide, so the exact size of the difference is uncertain — a larger sample would narrow it.
Test yourself
Practice by grade
One question each at Achieved, Merit and Excellence. Have a go, then compare with the model answer.
A 95% bootstrap confidence interval for the population median height of a tree species is m to m. Interpret it in context.
A 95% bootstrap CI for the difference in median commute time (Town X − Town Y, minutes) is to minutes. Interpret this interval in context.
Two studies estimate the same population median. Study P (n = 30) gives a 95% CI of 20 to 60; Study Q (n = 400) gives 36 to 44. Explain what the difference in width tells you and which estimate is more useful.