Confidence interval calculator
Confidence interval for a mean (Student’s t or normal) and for a proportion (Wilson, with Wald for comparison).
Result
[0.17205; 0.5159]
- Calculation
- Wilson: centre = (p̂ + z²/2n)/(1 + z²/n), half-width = z·√(p̂(1−p̂)/n + z²/4n²)/(1 + z²/n)
- Margin of error
- ± 0.17192
- Critical value
- 1.96
- Observed proportion p̂
- 0.32
- Wald interval (for comparison)
- [0.13714; 0.50286]
- Observed counts
- 8 successes, 17 failures
Notes (2)
The true proportion is estimated to lie in [0.17205; 0.5159] (Wilson interval).
Over many samples, 95% of the intervals built this way would contain the true value.
Calculation, assumptions and sources
OverviewConfidence interval for a mean, with the population standard deviation unknown (Student’s t) or known (normal), and for a proportion.
Confidence interval for a mean, with the population standard deviation unknown (Student’s t) or known (normal), and for a proportion. For the proportion, the Wilson interval is used. The Wald interval, shown for comparison, can leave [0; 1] or collapse to a point when no success is observed; this case is flagged.
Method & formulasmean, σ unknown: x̄ ± t(1−α/2, n−1) · s/√n
The interval is the estimate plus or minus a critical value times the standard error; only the distribution providing the critical value changes between cases. Estimating the standard deviation from the sample adds uncertainty, which Student’s t accounts for: at n = 5 its critical value is 2.78 against 1.96 for the normal, a 42% wider interval. The centre of the Wilson interval is shifted from p̂ toward 1/2, which keeps it inside [0; 1].
- Confidence level
- the proportion of intervals that would contain the true value if sampling were repeated many times.
- Margin of error
- half the width of the interval; it shrinks as 1/√n.
- Wilson interval
- an interval for a proportion (Wilson, 1927) whose actual coverage stays close to the stated level even for p near 0 or 1, unlike Wald’s.
Validity domainThe interval on a mean assumes random sampling and, for small samples, an approximately normal population; normality is not tested.
The interval on a mean assumes random sampling and, for small samples, an approximately normal population; normality is not tested. On a large sample the central limit theorem makes the assumption mild, but a sampling bias remains whatever the size. No finite-population correction is applied (it matters beyond ~5% of the population).
Interpreting the confidence levelThe true value is fixed; it is the interval that varies from sample to sample.
The true value is fixed; it is the interval that varies from sample to sample. Reading it as “a 95% chance that the true value lies in the interval” is wrong in frequentist statistics. That statement belongs to the Bayesian credible interval, which is not computed here.