Sampling proportions
Imagine drawing counters from a jar and replacing each one before the next draw. Count green as “yes.” How much does the share of green counters vary from sample to sample?
What changes when you quadruple the sample size?
Hold the true rate at 60%. Predict how the spread will change from 25 to 100 trials per sample, then compare the two distributions.
Simulation results
- Theoretical spread
- Simulated sample SD
- Observed coverage
Compare sample sizes
| Trials per sample | Theoretical SD (pp) | Simulated SD (pp) | Covered / drawn |
|---|
Compare the widths of the two distributions. Which result supports your prediction?
Distribution of sample proportions
Histogram values
Confidence intervals
Interval values
| Sample | Yes count | Estimate | 95% interval | Covers? |
|---|
Teacher notes and model details
Model and notation
Each trial has two outcomes and the same fixed yes probability p. The model assumes independent trials. In each sample of n trials, X counts yes outcomes and the sample proportion is p̂ = X/n. Its theoretical standard deviation is √[p(1 − p)/n]. A spread of 0.05 on the proportion scale is 5 percentage points (pp).
Reading the results
The simulated SD measures the spread of the sample proportions, using the number of samples minus one in its variance denominator. Quadrupling n halves theoretical SD at a fixed rate. Increasing the number of samples makes the simulation summary more stable.
Each sample produces a two-sided 95% Wilson score interval without continuity correction. Observed coverage counts intervals that include the fixed p across all draws. Actual coverage depends on p and n. For example, with p = 0.5 and n = 10, counts 2 through 8 cover 0.5, giving exact coverage of 1002/1024, about 97.85%.
New runs use a fresh seed. Select Fix seed and enter the recorded seed to replay a result with the same rate, sample size and number of samples. In the comparison, both runs start from the same seed. Each run groups the stream of trial outcomes into its own sample size.
Sampling proportions · revision 1 · seeded generator AMSTAT-SIM Rev001