# Confidence Interval

On SUMMARY tables, the Statisics - Cells menu contains options to show the **Upper Confidence Interval** and **Lower Confidence Interval**. The level used for the measurement is determined by the overall level which is set under **Edit > Project Options > Customize > Statistical Assumptions** (default is 95%).

On a crosstab, there are no built-in options, but you can use the following rules to add confidence intervals to the table:

- Calculate Confidence Intervals for Crosstabs with Numeric Questions
- Calculate Confidence Intervals for Crosstabs with Categorical Questions

## Default confidence intervals

In most instances in Q, the lower and upper bounds of confidence intervals are computed using whichever is appropriate of:

[math]\displaystyle{ \bar x \pm t_{\alpha/2, df}s_{\bar x} }[/math] or [math]\displaystyle{ \bar x \pm z_{\alpha/2}s_{\bar x} }[/math]

where:

- [math]\displaystyle{ \bar x }[/math] is the observed Average, %, Column %, Row %, Probability %, Total % or Coefficient,
- [math]\displaystyle{ s_{\bar x} }[/math] is the estimated or computed Standard Error which includes any computer and/or specified design effects,
- [math]\displaystyle{ t_{\alpha/2, df} }[/math] is the [math]\displaystyle{ \alpha/2 }[/math]th quantile of student's
*t*-distribution, - [math]\displaystyle{ df }[/math] is [math]\displaystyle{ n - 1 }[/math], and
- [math]\displaystyle{ z_{\alpha/2} }[/math] is the [math]\displaystyle{ \alpha/2 }[/math]th quantile of the normal distribution.

## Confidence intervals for percentages with unweighted samples

The Agresti-Coull interval is used to computed confidence intervals for categorical questions where there are no weights, except where **Weights and significance** in Statistical Assumptions has been set to **Un-weighted sample size in tests** or when Extra deff is not 1. The Agresti-Coull interval is given by:

[math]\displaystyle{ \tilde{\bar x} \pm z_{\alpha/2} \sqrt{\frac{\tilde{\bar x}(1 - \tilde{\bar x})}{\tilde{n}}} }[/math]

where:

- [math]\displaystyle{ \tilde{n} = n + z_{\alpha/2}^2 }[/math],
- [math]\displaystyle{ n }[/math] is Base n,
- [math]\displaystyle{ \tilde{\bar x} = \frac{x + \frac{{z}_{\alpha/2}^2}{2}}{\tilde{n}} }[/math], and
- [math]\displaystyle{ x }[/math] is n.

## Confidence intervals where **Weights and significance** has been set to **Un-weighted sample size in tests**

Where **Weights and significance** in Statistical Assumptions has been set to **Un-weighted sample size in tests**, confidence intervals are computed using:

[math]\displaystyle{ \bar x \pm t_{\alpha/2, n - 1}s_{\bar x} }[/math]

where:

- [math]\displaystyle{ s_{\bar x} = \sqrt{\frac{d_{eff} \bar x (1 - \bar x)}{n - b}} }[/math] if [math]\displaystyle{ \bar x }[/math] represents a proportion,
- [math]\displaystyle{ s_{\bar x} = s_ x \sqrt{\frac{d_{eff}}{n}} }[/math] otherwise,
- [math]\displaystyle{ s_x }[/math] is the Standard Deviation,
- [math]\displaystyle{ d_{eff} }[/math] is Extra deff,
- [math]\displaystyle{ b }[/math] is 1 if
**Bessel's correction**is selected for**Proportions**in Statistical Assumptions and 0 otherwise.

## Notes

- In most situations, the statistical tests computed by Q will
*not*correspond to conclusions drawn if attempting to construct tests from the confidence intervals. There are many reasons for this, including:- Multiple Comparison Corrections.
- Use of non-parametric tests in Q.
- The confidence intervals having statistical properties that make them sub-optimal from a testing perspective.

- To keep this page relatively short, [math]\displaystyle{ s }[/math] is used in the formulas above where it is more conventional to use [math]\displaystyle{ \sigma }[/math].
- Whereas the The Agresti-Coull interval is an improvement on the default formula for computing the confidence intervals, the formula used when
**Weights and significance**in Statistical Assumptions has been set to**Un-weighted sample size in tests**, is generally inferior and is only included for the purposes of aiding comparison with results computed using this formula in other programs.