🌐 ZH-TW

📊 Confidence Interval Calculator

Critical Values Table

Z Critical Values (n ≥ 30)

  • 90% Confidence: Z = 1.645
  • 95% Confidence: Z = 1.96
  • 99% Confidence: Z = 2.576

T Critical Values (small sample)

Degrees of Freedom (df) t(90%) t(95%) t(99%)
指南

瞭解更多

01

What is a Confidence Interval?

A confidence interval represents the probability that a population parameter (mean, proportion, etc.) falls within a specific range. A 95% confidence level means that out of 100 samples, 95 will contain the true parameter, and a higher confidence level produces a wider interval. The margin of error E = critical value × (SD / √n), so a larger sample size produces a smaller margin of error. Use the Z-distribution (normal approximation) when n ≥ 30 and the T-distribution (more conservative, heavier tails) when n < 30.

02

Definition and Basic Concepts of Confidence Intervals

A Confidence Interval (CI) represents an interval expected to contain a population parameter (mean, proportion, standard deviation, etc.) based on sample data. For example, if 500 college students have a mean height of 170cm with SD of 10cm, and the 95% CI is [168.1cm, 171.9cm], we interpret: "The mean height of all college students is between 168.1cm and 171.9cm with 95% confidence." Confidence levels are typically 90%, 95%, 99%, where 95% means "if we repeat sampling 100 times, about 95 intervals will contain the true parameter."

03

Z-Distribution vs T-Distribution: When to Use Which?

Use the Z-distribution (standard normal) when sample size is sufficiently large (generally n ≥ 30) because the Central Limit Theorem ensures the sampling distribution approximates normal. Z critical values are fixed: 90% = 1.645, 95% = 1.96, 99% = 2.576. Use the T-distribution for small samples (n < 30), which has heavier tails and provides more conservative estimates. The T-distribution depends on degrees of freedom (df = n - 1).

04

Calculating Confidence Interval for Means with Examples

Calculate the confidence interval for a population mean using CI = x̄ ± (critical value × s / √n). Example: 25 students have a mean math score of 75 with SD of 12. For a 95% CI, since n=25 < 30, use the T-distribution. Degrees of freedom df = 24, t(95%, df=24) = 2.064. Standard error SE = 12 / √25 = 2.4, margin of error E = 2.064 × 2.4 = 4.95. Therefore the 95% CI = [70.05, 79.95].

05

Confidence Interval for Proportions (Binomial Distribution)

Calculate the confidence interval for a population proportion using CI = p̂ ± Z × √[p̂(1-p̂) / n]. Example: Out of 800 voters, 480 support candidate A. Sample proportion p̂ = 480/800 = 0.6 (60%). For a 95% CI, Z(95%) = 1.96, SE = √[0.6 × 0.4 / 800] = 0.0173, E = 1.96 × 0.0173 = 0.034 (3.4%). 95% CI = [56.6%, 63.4%].

06

Determining Sample Size: Achieving Desired Margin of Error

Calculate the required sample size for a desired margin of error E and confidence level using n = (Z × σ / E)². Example: For 95% confidence with margin of error ±2 points and population SD of 15 points, n = (1.96 × 15 / 2)² = 216.09 → minimum 217 samples required. To halve the margin of error, sample size must increase 4-fold.

07

Common Misconceptions and Correct Interpretation of CIs

Interpreting a 95% CI [168cm, 172cm] as "95% probability the true mean is in this interval" is incorrect in frequentist statistics. The parameter is fixed (though unknown), so probability is either 0% or 100%. Correct interpretation: "If we repeat this sampling procedure 100 times, about 95 of the constructed intervals will contain the true mean." The CI refers to the long-run frequency of capturing the parameter across repeated sampling.

常見問題

When do I use the Z vs T distribution?
Use the Z-distribution (normal approximation) when sample size n is 30 or more, and the T-distribution (degrees of freedom df = n - 1) when n is under 30. The T-distribution has heavier tails for a more conservative estimate.
How is the margin of error calculated?
The margin of error E = critical value × (SD / √n). A larger sample size produces a smaller margin of error and therefore a narrower confidence interval.