Create advanced Works with: Any AI

Bootstrap and Simulation Walkthrough

Few shot

Estimate uncertainty with resampling.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

Rate this prompt

Loading ratings…

Teach me to estimate uncertainty by resampling, using my data. Statistic of interest: [STATISTIC]. Data description and size: [DATA_DESCRIPTION]. Language: [LANGUAGE].

Walk through:
1. The idea in plain words and when the bootstrap works poorly (very small samples, extreme statistics such as the maximum, dependent data).
2. A step-by-step algorithm: resample with replacement n values, compute the statistic, repeat 5,000 or more times, take percentiles (2.5 and 97.5) for a percentile interval.
3. Complete code with a fixed random seed, vectorized resampling, and a plot of the bootstrap distribution.
4. A worked example on a tiny dataset of 8 invented numbers, showing three resamples and their means so I see what is happening.
5. How to adapt for the difference between two groups, for a median, and for grouped or paired data (resample whole clusters).
6. A comparison with the formula-based interval and what to conclude if they differ.
7. Checks: does the result change with a different seed or number of repeats?
End with the wording for reporting the interval.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

Related prompts