Statistics and research

Confidence interval calculator

Confidence intervals for a mean (t interval, from data or summary statistics) or a proportion (Wilson, Clopper–Pearson, Jeffreys, Agresti–Coull and Wald).

Runs in your browser. What you enter stays on this page and is not uploaded.

Results

Mean0.7595% CI-0.52978 to 2.0298
Sample size n
10
Mean
0.75
Standard deviation
1.78901
Standard error s / √n
0.56573464
Critical t (9 df)
2.2621572
Margin of error t · SE
1.2797807
95% confidence interval (t)
-0.52978066 to 2.0297807
Interval if σ were known (z)
-0.35881951 to 1.8588195

The t interval assumes independent observations from a roughly normal population; for n of about 30 or more it is robust to moderate skew.

Method and limits

How to use it

For a mean, enter n, the mean and the standard deviation, or paste the raw data. For a proportion, enter the number of successes and the number of trials. Set the confidence level (95% is usual).

Formulas

  • Mean (t interval): x̄ ± tα/2, n−1 · s / √n.
  • Wilson score: (p̂ + z²/2n ± z √(p̂(1 − p̂)/n + z²/4n²)) / (1 + z²/n); with continuity correction as Newcombe’s method 4.
  • Clopper–Pearson exact: the α/2 and 1 − α/2 quantiles of Beta(x, n − x + 1) and Beta(x + 1, n − x).
  • Jeffreys: quantiles of Beta(x + ½, n − x + ½). Agresti–Coull: Wald interval around (x + z²/2)/(n + z²). Wald: p̂ ± z √(p̂(1 − p̂)/n).

Which proportion interval?

Wilson is a good default: its coverage stays close to the nominal level for small samples and for proportions near 0 or 1 (Brown, Cai and DasGupta 2001). Clopper–Pearson never under-covers but is wide. Avoid Wald when n is small or p̂ is near 0 or 1 — it can even give limits of exactly 0.

Assumptions and limits

  • Independent observations, and a random or representative sample.
  • The t interval assumes a roughly normal population; with 30 or more observations it is robust to moderate skew, but not to strong outliers.
  • A 95% interval means that the procedure captures the true value in 95% of repeated samples — not that this interval has a 95% chance of containing it.

Worked example

Sleep data (R’s sleep dataset, group 1): n = 10, mean 0.75, SD 1.789. SE = 0.5657, t0.025, 9 = 2.2622, so the 95% interval is −0.530 to 2.030 — the same as R’s t.test. For 81 successes in 263 trials, p̂ = 0.308; Wilson gives 0.2553 to 0.3662 and Clopper–Pearson 0.2527 to 0.3676, matching Newcombe (1998), Table I.

References

Related tools

Share this page

Remind me to visit Contifield

Adds a repeating reminder to your calendar, titled “Contifield Reminder: Visit www.contifield.com”.