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) * 100

Standard 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

VariableDescriptionDefault
pProportion (p)0.5
nSample Size400
zZ-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
  1. 01SE = sqrt(0.5 * 0.5 / 400) = sqrt(0.000625) = 0.025
  2. 02Sampling error = 1.96 * 0.025 = 0.049
  3. 03As a percentage: +/- 4.9%
  4. 04CI: (0.451, 0.549) or 45.1% to 54.9%

Ready to run the numbers?

Open Sampling Error Calculator