Sex Ratio Confidence Interval
A study observed 52% girl births in 300 births near power plants. How sure are we about that 52% — what range of rates is actually consistent with the data?
Resampling-based confidence interval
The idea. There's no list of 300 individual births to resample from — only the observed rate. So instead we simulate new 300-birth studies from scratch, each birth an independent coin flip at the observed 52% rate. Do that thousands of times and the spread of resulting rates is our uncertainty about the true rate.
Resampling-based confidence interval
Resampling-based estimate, n = 300Our fixed observation (left) stays put, while each new simulated resample (right) — 300 independent births at the observed 52% rate — redraws beside it, and that resample's rate joins the distribution below.
Sample size and confidence interval width
The idea. The resampling above used n = 300. Holding the observed rate fixed at 52% — asking only "how wide would the interval have been if this same rate came from a study of a different size?" — isolates the effect of sample size alone, apart from how much a fresh draw's own estimate happens to wander (that's the separate question the coverage sim below explores). Compare n = 150, 300, and 600: smaller studies leave the interval strikingly wide, while larger ones narrow it down a great deal — all still at the same 95% confidence level.
Confidence interval width vs. sample size
fixed at observed rate: 52%Each bar is a fresh 95% confidence interval, resampled from scratch at n = 150, 300, and 600 — all three centered on the same 52%. Click "Resample" to redraw all three: the exact bounds jitter a little each time, but the width ordering — smaller n, wider interval — holds every time.
What does "95% confidence" actually mean?
The idea. A confidence level is a statement about the procedure, not about any one interval. There's no way to demonstrate that without assuming a true rate to check against — so we carry forward the same working assumption the resampling above already makes: that the true rate really is 52%. Run many independent 300-birth studies at that rate, build a fresh confidence interval from each one, and about 95% of those intervals should end up containing 52% — with about 1 in 20 visibly missing it, even though every one came from a perfectly valid application of the method.
Interval coverage across repeated studies
The curve above is the true distribution of a single study's point estimate. "Illustrate one interval" draws a fresh 300-birth study at the assumed true rate, shows it as "our observation" (left) with a dashed line up to its own point on the curve, then resamples from that one study — a single resample at a time (right) — to build its confidence interval, and drops just that one interval into the list below — the other 39 stay put. Each dot marks its own point estimate; blue intervals cross the true-rate line, red ones miss it entirely.