Two bootstrap intervals, and when they differ
Today let's take one bootstrap distribution and cut it at two different places, and see how much that choice actually moves the answer.
A small insurer has twelve claims filed this month, in dollars: 185, 205, 198, 220, 210, 192, 230, 178, 1850, 240, 202, 215. Eleven of them sit under $250. The twelfth, $1850, is nearly eight times the next largest claim in the batch.
The strip below stands for those twelve claims, one badge per claim, numbered in the order just listed. Press "Draw again" and watch which claims get picked more than once, and which get left out entirely, when R resamples all twelve with replacement.
Claim 9 is the badge to watch. Every draw either includes it, once or several times, or leaves it out completely, and that single difference changes everything about the resample it lands in.
Twelve claims, one mean, and the percentile bootstrap
The twelve claims and their mean come first, since every number after this builds on them.
$343.75 is the sample mean, the one number that summarizes all twelve claims. It sits well above most of the individual claims, which cluster under $250, because the $1850 claim alone drags it up.
That one number came from this one month's twelve claims. A different month, a different twelve claims, a different mean. The bootstrap builds an interval around $343.75 without any formula for how far it could move, by resampling the twelve claims themselves.
sample(claims, 12, replace = TRUE) draws twelve claims with replacement from the original twelve, the same mechanic the widget above just showed. replicate(2000, ...) does that, and recomputes the mean, 2000 times, and boot_means holds every one of those 2000 resampled means.
Look at the summary. The median resampled mean, 342.7, sits close to the original $343.75. But the mean of the 2000 resampled means, 348.5, sits a little higher than that median, and the top end reaches all the way to 899.1, far past the bottom end's 190.3. A distribution whose mean sits above its median, with a long reach on the high side and a short one on the low side, is right-skewed. That shape is not an accident. It is the $1850 claim, showing up zero, one, two or more times across the 2000 resamples, stretching the high side every time it repeats.
Those 2000 resampled means already contain a 95% interval, with no formula at all. Cut off the bottom 2.5% and the top 2.5%, and what is left in the middle is the interval.
$199.75 to $623.00. That is the percentile bootstrap interval for the mean claim amount, read straight off the 2000 resampled means with two calls to quantile().
The two dashed lines sit exactly at $199.75 and $623.00, the two numbers quantile() just handed back. Almost all of the 2000 resampled means pile up on the left of that picture, under $250, with a thin scatter of much bigger means stretching out to the right. The percentile interval cuts straight through that shape regardless of whether the shape is lopsided. It just takes whatever sits at the 2.5% and 97.5% marks.