Understanding Statistical Uncertainty Through Interactive Visualization
Confidence intervals
Standard error
App
Explore how sample size affects sampling distribution using simulated samples of 100 individuals.
Author
Alasdair Warwick
Published
December 31, 2024
App
This interactive visualization allows you to explore how sample size affects the sampling distribution and the calculation of confidence intervals (CI). Adjust the sample size and confidence level, then take samples to see the results.
Adjust the sample size and confidence level using the provided controls. Click the “Take 100 Samples” button to generate new sample means and visualize the results.
Visual Guide
The population distribution and sample means distribution are displayed as histograms. The red line represents the population mean, and the blue dashed lines represent the confidence interval.
Population Mean: The average value of the entire population.
Sample Mean: The average value of a sample taken from the population.
Standard Error: The standard deviation of the sample means, indicating the variability of the sample means.
Confidence Interval: A range of values that is likely to contain the population mean with a certain level of confidence.
Key concepts
Sample Size and Precision: As sample size increases, the standard error decreases (proportional to \(\frac{1}{\sqrt{n}}\)), making estimates more precise
Confidence Intervals: A 95% CI means if we repeated sampling many times, about 95% of intervals would contain the true population mean
Interpretation: When reading “mean = 120 (95% CI: 115-125)”, this suggests we’re 95% confident the true population mean lies between 115-125
Sample vs Population: In real studies, we only have one sample and don’t know the true population mean - the CI helps express our uncertainty
Equations
Mean (\(\mu\)): \[ \mu = \frac{1}{N} \sum_{i=1}^{N} x_i \]