Confidence intervals

Confidence interval for one variance

Estimate the population variance and standard deviation using the chi-square distribution. Key in quality control and process analysis.

Calculator

Enter the sample standard deviation and sample size to get the intervals for variance and standard deviation.

Result pending…

Explanation

While intervals for the mean use the normal or t distribution (which are symmetric), the interval for the variance uses the chi-square distribution, which is skewed and positive. That's why the interval limits are not equidistant from the point estimate \(s^2\).

This interval is fundamental in statistical process control (SPC), where not only the mean of a process matters but also its variability. It also appears in meta-analysis, experimental design, and measurement process audits.

Formula for the variance

Let \(C\) denote the confidence level and \(\alpha=1-C\) the total area outside the interval. For 95% confidence, \(C=0.95\), \(\alpha=0.05\) and \(\alpha/2=0.025\) in each tail.

\( \left[\dfrac{(n-1)s^2}{\chi^2_{1-\alpha/2,\, n-1}},\;\; \dfrac{(n-1)s^2}{\chi^2_{\alpha/2,\, n-1}}\right] \)

  • \(s^2\): sample variance (with divisor \(n-1\)).
  • \(n\): sample size.
  • \(\chi^2_{1-\alpha/2,\, n-1}\): upper percentile of the chi-square distribution (percentile \(1-\alpha/2\), right tail); it is the larger value and goes in the denominator of the lower limit of the CI.
  • \(\chi^2_{\alpha/2,\, n-1}\): lower percentile of the chi-square distribution (percentile \(\alpha/2\), left tail); it is the smaller value and goes in the denominator of the upper limit of the CI.

Formula for the standard deviation

\( \left[\sqrt{\dfrac{(n-1)s^2}{\chi^2_{1-\alpha/2,\, n-1}}},\;\; \sqrt{\dfrac{(n-1)s^2}{\chi^2_{\alpha/2,\, n-1}}}\right] \)

It is obtained by taking the square root of each limit of the variance CI.

Worked example

A bottling line fills bottles with \(s = 2.3\) ml based on \(n = 25\) measurements. With 95% confidence (\(C=0.95\), \(\alpha=0.05\), \(df = 24\), \(\chi^2_{0.975} \approx 39.36\), \(\chi^2_{0.025} \approx 12.40\)):

\( \sigma^2 \in \left[\frac{24 \cdot 5.29}{39.36},\;\frac{24 \cdot 5.29}{12.40}\right] \approx [3.23,\; 10.24] \text{ ml}^2 \)

\( \sigma \in [1.80,\; 3.20] \text{ ml} \)

Assumptions of the chi-square interval

This interval assumes that the underlying variable follows a normal distribution. Unlike the CI for the mean, the CI for the variance is not protected by the central limit theorem: it is very sensitive to deviations from normality. If the data are not normal, consider transformations or robust methods.

How to interpret the result

The interval for \(\sigma^2\) is the range of values of the population variance compatible with the data at the chosen confidence level. The interval for \(\sigma\) expresses the same uncertainty in the original units of the variable: it is obtained simply by taking the square root of each limit. In frequentist terms, if you repeated the experiment many times and built the CI with the same method, a proportion \(C\) of those intervals would contain the true variance \(\sigma^2\). The chi-square distribution is skewed and only takes positive values, which is why the interval is not symmetric: the upper limit is farther from \(s^2\) than the lower limit.

In the chart, the green region under the chi-square curve is the confidence zone and the red tails (each with area \(\alpha/2\)) mark the lower \(\chi^2_{\alpha/2,\,n-1}\) and upper \(\chi^2_{1-\alpha/2,\,n-1}\) percentiles. The larger \(n\) is, the more symmetric and concentrated the chi-square distribution becomes and, as a result, the interval will be narrower and closer to symmetric.

  • Width and uncertainty: a very wide interval reflects high uncertainty about the true variability of the process, usually due to a small sample size. With large samples, the CI narrows considerably.
  • Upper limit in quality control: if the goal is to control the dispersion of a process, the upper limit \(U(\sigma^2)\) is the most relevant value; exceeding a specification value with that limit indicates that the variability may exceed what is tolerated even with the current data.
  • Connection with hypothesis testing: if a reference value \(\sigma_0^2\) falls outside the interval, the data would reject \(H_0\!: \sigma^2 = \sigma_0^2\) at level \(\alpha = 1 - C\) in the equivalent two-sided chi-square test. If \(\sigma_0^2\) falls inside the interval, there is no evidence to reject it.

Frequently asked questions

  • Why isn't the interval symmetric around s²? Because the chi-square distribution is skewed; the upper and lower percentiles are not equidistant from the center.
  • Can I use this CI if the data aren't normal? It's not recommended; the chi-square interval is very sensitive to non-normality. Run normality tests first.
  • What happens if n is very small? The interval will be very wide, reflecting the high uncertainty with few observations.