Sampling Error Calculator Formula
Understand the math behind the sampling error calculator. Each variable explained with a worked example.
Formulas Used
Sampling Error
sampling_error = z * sqrt(p * (1 - p) / n)Sampling Error (%)
error_pct = z * sqrt(p * (1 - p) / n) * 100Standard Error of Proportion
se_prop = sqrt(p * (1 - p) / n)Lower CI
lower_ci = p - z * sqrt(p * (1 - p) / n)Upper CI
upper_ci = p + z * sqrt(p * (1 - p) / n)Variables
| Variable | Description | Default |
|---|---|---|
p | Proportion (p) | 0.5 |
n | Sample Size | 400 |
z | Z-Value (e.g., 1.96 for 95%) | 1.96 |
How It Works
How to Calculate Sampling Error for Proportions
Formula
Sampling Error = z * sqrt(p * (1-p) / n)
Sampling error is the margin of error in estimating a population proportion from a sample. It depends on the confidence level (z), the proportion (p), and the sample size (n). Maximum error occurs at p = 0.5. The confidence interval is p +/- sampling error.
Worked Example
A poll of 400 people finds 50% support (p = 0.5) at 95% confidence.
p = 0.5n = 400z = 1.96
- 01SE = sqrt(0.5 * 0.5 / 400) = sqrt(0.000625) = 0.025
- 02Sampling error = 1.96 * 0.025 = 0.049
- 03As a percentage: +/- 4.9%
- 04CI: (0.451, 0.549) or 45.1% to 54.9%
Ready to run the numbers?
Open Sampling Error Calculator