Confidence Interval Calculator
What is a Confidence Interval?
A confidence interval is a range of values that is likely to contain an unknown population parameter. It is calculated from a sample of data and gives an indication of how precise our estimate is.
Understanding Confidence Levels
The confidence level (usually expressed as a percentage) indicates the probability that the confidence interval contains the true population parameter. Common confidence levels include 90%, 95%, and 99%.
For example, a 95% confidence interval means that if we were to take 100 different samples and compute a 95% confidence interval for each sample, then approximately 95 of the 100 confidence intervals would contain the true population parameter.
Confidence Interval Formula
For a population mean with known standard deviation, the formula is:
CI = x̄ ± z × (σ / √n)
Where:
- CI = Confidence Interval
- x̄ = Sample mean
- z = Z-score (critical value) based on the confidence level
- σ = Population standard deviation
- n = Sample size
For a population mean with unknown standard deviation (using the t-distribution), the formula is:
CI = x̄ ± t × (s / √n)
Where:
- CI = Confidence Interval
- x̄ = Sample mean
- t = t-score (critical value) based on the confidence level and degrees of freedom (n-1)
- s = Sample standard deviation
- n = Sample size
Margin of Error
The margin of error is half the width of the confidence interval. It represents the maximum likely difference between the observed sample statistic and the true population parameter.
Margin of Error = z × (σ / √n)
or
Margin of Error = t × (s / √n)
Applications of Confidence Intervals
- Political polling and election forecasts
- Medical research and clinical trials
- Quality control in manufacturing
- Market research and consumer surveys
- Scientific experiments and research studies
Example
A researcher measures the heights of 100 males and finds a mean height of 175 cm with a standard deviation of 7 cm. To calculate a 95% confidence interval for the true mean height of all males:
- Sample mean (x̄) = 175 cm
- Sample size (n) = 100
- Sample standard deviation (s) = 7 cm
- For 95% confidence, t ≈ 1.984 (with 99 degrees of freedom)
CI = 175 ± 1.984 × (7 / √100) = 175 ± 1.984 × 0.7 = 175 ± 1.39 = (173.61, 176.39)
We can be 95% confident that the true mean height of all males is between 173.61 cm and 176.39 cm.