# Confidence interval

Confidence intervals at the level of 95% for 100 samples of size 30 from a normally distributed population. Of these, 94 intervals cover the exact expected value μ = 5; the other 6 don't.

A confidence interval , short  KI (also confidence interval , confidence level or expected range called) is in the statistics an interval that the precision of position estimation of a parameter (for. Example, a mean value is to be specified). The confidence interval specifies the range which, if a random experiment is repeated infinitely, includes the true position of the parameter with a certain probability (the confidence level).

A frequently used confidence level is 95%, so that in this case - if the random experiment is repeated in the same way - a 95% confidence interval will cover the unknown “true” parameter in approximately 95% of all cases.

The frequently used formulation that the true value lies with 95% probability in the confidence interval, i. that is, in the present calculated interval, is strictly speaking incorrect, since the true value is assumed to be given (fixed) and not to be stochastic .

On closer inspection, the upper and lower bounds of the confidence interval are stochastic because they contain random variables . Consequently, the correct formulation is: When calculating a confidence interval, its interval boundaries enclose the true parameter in 95% of cases and not in 5% of cases. The confidence interval is constructed in such a way that the true parameter is covered with the probability if the estimation procedure is repeated for many samples . ${\ displaystyle \ beta _ {j}}$${\ displaystyle 1- \ alpha}$

The estimation of parameters with the help of confidence intervals is called interval estimation , the corresponding estimator a range or interval estimator . One advantage over point estimators is that one can read the significance directly from a confidence interval : a wide interval for a given confidence level indicates a small sample size or a high variability in the population .

Confidence intervals are to be delimited by forecast intervals as well as confidence and forecast bands .

## definition

Let be a random sample , an unknown parameter, and a confidence level . The confidence interval for the parameter is the interval with the two limits and , so that: ${\ displaystyle X_ {1: n}}$${\ displaystyle \ vartheta}$${\ displaystyle \ gamma \ in (0,1)}$${\ displaystyle \ gamma \ cdot 100 \, \%}$${\ displaystyle \ vartheta}$ ${\ displaystyle T_ {u} = h_ {u} (X_ {1: n})}$${\ displaystyle T_ {v} = h_ {v} (X_ {1: n})}$

${\ displaystyle \ mathbb {P} \ left (T_ {u} \ leq \ vartheta \ leq T_ {v} \ right) = \ gamma \ quad \ mathrm {f {\ ddot {u}} r \; all \; } \ vartheta \ in \ Theta}$

### Explanations

#### Confidence level

A confidence interval ( ) is often used in statistics. The confidence level is also called the coverage probability . ${\ displaystyle 95 \%}$${\ displaystyle \ gamma = 0.95}$${\ displaystyle \ gamma \ cdot 100 \%}$

#### Interval limits

For the statistics and is always accepted. The realizations and of and form the estimation interval . The boundaries of the confidence interval are functions of the random sample and are therefore also random. In contrast, the unknown parameter is fixed. ${\ displaystyle T_ {u}}$${\ displaystyle T_ {v}}$${\ displaystyle T_ {u} ${\ displaystyle t_ {u}}$${\ displaystyle t_ {v}}$${\ displaystyle T_ {u}}$${\ displaystyle T_ {v}}$ ${\ displaystyle [t_ {u}, t_ {v}]}$${\ displaystyle X_ {1: n}}$${\ displaystyle \ vartheta}$

#### Confidence intervals are random

If the random experiment is repeated in an identical manner, then a confidence interval will cover the unknown parameter in all cases. Since the unknown parameter is not a random variable, however, it cannot be said that there is a confidence interval with probability . Such an interpretation is reserved for the Bayesian counterpart of the confidence interval, the so-called credibility intervals . ${\ displaystyle \ gamma \ cdot 100 \, \%}$${\ displaystyle \ vartheta}$${\ displaystyle \ gamma \ cdot 100 \, \%}$${\ displaystyle \ vartheta}$${\ displaystyle \ vartheta}$${\ displaystyle \ gamma \ cdot 100 \, \%}$${\ displaystyle \ gamma}$

Often you bet . The probability can be interpreted as a relative frequency : If one uses intervals for a large number of confidence estimates that each have the same level , the relative frequency with which the specific intervals cover the parameter approaches the value . ${\ displaystyle \ gamma = 1- \ alpha}$${\ displaystyle 1- \ alpha}$${\ displaystyle 1- \ alpha}$${\ displaystyle 1- \ alpha}$

## Formal definition

### Framework

A statistical model and a function are given ${\ displaystyle (X, {\ mathcal {A}}, (P _ {\ vartheta}) _ {\ vartheta \ in \ Theta})}$

${\ displaystyle g \ colon \ Theta \ to \ Gamma}$,

which in the parametric case is also called the parameter function. The set contains the values ​​that can be the result of an estimate. Mostly is${\ displaystyle \ Gamma}$${\ displaystyle \ Gamma \ subset \ mathbb {R} ^ {n}}$

### Confidence Range

An illustration

${\ displaystyle C \ colon X \ to {\ mathcal {P}} (\ Gamma)}$

is called a confidence range, confidence range, range estimator, or range estimator if it meets the following condition:

• For all the amount is in included. (M)${\ displaystyle \ gamma \ in \ Gamma}$${\ displaystyle A (\ gamma): = \ {x \ in X \ mid \ gamma \ in C (x) \}}$${\ displaystyle {\ mathcal {A}}}$

A confidence range is therefore a mapping that initially assigns an arbitrary subset of to each observation ( here is the power set of the set , i.e. the set of all subsets of ) ${\ displaystyle x \ in X}$${\ displaystyle \ Gamma}$${\ displaystyle {\ mathcal {P}} (\ Gamma)}$${\ displaystyle \ Gamma}$${\ displaystyle \ Gamma}$

The condition (M) ensures that a probability can be assigned to all sets . This is needed to define the confidence level. ${\ displaystyle A (\ gamma)}$

### Confidence interval

If and is always an interval for each , then a confidence interval is also called. ${\ displaystyle \ Gamma \ subset \ mathbb {R}}$${\ displaystyle C (x)}$${\ displaystyle x \ in X}$${\ displaystyle C}$

Are confidence intervals in the form

${\ displaystyle C_ {1} (x) = (- \ infty, b ^ {+} (x)], \; C_ {2} (x) = [b ^ {-} (x), b ^ {+ } (x)] \; \; {\ text {or}} \; \; C_ {3} (x) = [b ^ {-} (x), + \ infty)}$,

defined, this is also called the upper and lower confidence bounds. ${\ displaystyle b ^ {+} (x)}$${\ displaystyle b ^ {-} (x)}$

### Confidence level and level of error

A confidence range is given . Then a confidence range is called the confidence level or security level , if ${\ displaystyle C}$${\ displaystyle C}$${\ displaystyle 1- \ alpha}$

${\ displaystyle P _ {\ vartheta} (\ {x \ in X \ mid g (\ vartheta) \ in C (x) \}) \ geq 1- \ alpha \ quad \ mathrm {f {\ ddot {u}} r \; all \;} \ vartheta \ in \ Theta}$.

The value is then also called the level of error. A more general formulation is possible with form hypotheses (see form hypotheses # Confidence ranges for form hypotheses ). ${\ displaystyle \ alpha}$

For the above-mentioned special cases with confidence ranges with upper and lower confidence bound, the result is

${\ displaystyle P _ {\ vartheta} (g (\ vartheta) \ leq b ^ {+} (x)) \ geq 1- \ alpha}$

or.

${\ displaystyle P _ {\ vartheta} (b ^ {-} (x) \ leq g (\ vartheta) \ leq b ^ {+} (x)) \ geq 1- \ alpha}$

and

${\ displaystyle P _ {\ vartheta} (b ^ {-} (x) \ leq g (\ vartheta)) \ geq 1- \ alpha \ quad \ mathrm {f {\ ddot {u}} r \; all \; } \ vartheta \ in \ Theta}$

## Description of the procedure

One is interested in the unknown parameter of a population . This is estimated by an estimator from a sample of the size . It is assumed that the sample is a simple random sample that roughly reflects the population and that the estimate should therefore be close to the true parameter. The estimator is a random variable with a distribution that contains the parameter . ${\ displaystyle \ vartheta}$${\ displaystyle n}$${\ displaystyle \ vartheta}$

First of all, with the help of the distribution, you can specify an interval that covers the unknown true parameter with a probability . We determine e.g. For example, the 95% confidence interval for the true expected value of a population, then this means that we are determining a confidence interval that contains the expected value for an average of 95 out of 100 random samples of the same size. ${\ displaystyle \ vartheta}$${\ displaystyle \ gamma = 1- \ alpha}$${\ displaystyle \ mu}$

## example

The method can be demonstrated on the basis of a normally distributed feature with the unknown expected value and the known variance : The expected value of this normal distribution is to be estimated. The unbiased estimator is used: the sample mean . ${\ displaystyle \ mu}$ ${\ displaystyle \ sigma ^ {2}}$${\ displaystyle \ mu}$ ${\ displaystyle {\ overline {X}}}$

Central fluctuation interval from${\ displaystyle {\ overline {X}}}$

The expected value of the population is estimated using our sample

Estimator: ${\ displaystyle {\ overline {X}} = {\ frac {1} {n}} \ sum _ {i = 1} ^ {n} X_ {i}}$
Point estimate: ${\ displaystyle {\ hat {\ mu}} = {\ overline {x}} = {\ frac {1} {n}} \ sum _ {i = 1} ^ {n} x_ {i} \ ,,}$

where the random variable stands for the ith observation (before the sample was drawn). The sample mean follows a normal distribution with expected value and variance (see sample mean # properties ) ${\ displaystyle X_ {i}}$ ${\ displaystyle (i = 1, \ dotsc, n)}$${\ displaystyle \ mu}$${\ displaystyle {\ frac {\ sigma ^ {2}} {n}}}$

${\ displaystyle {\ overline {X}} \ sim {\ mathcal {N}} \ left (\ mu, {\ frac {\ sigma ^ {2}} {n}} \ right) \,}$.

The limits of the central fluctuation interval

${\ displaystyle [{\ overline {x}} _ {u}; {\ overline {x}} _ {o}]}$,

that which is covered by the probability are determined by the relationship ${\ displaystyle \ mu}$${\ displaystyle 1- \ alpha}$

${\ displaystyle P ({\ overline {x}} _ {u} \ leq {\ overline {X}} \ leq {\ overline {x}} _ {o}) = 1- \ alpha}$.

One standardized to the standard normal distribution and obtained for the standardized random variable ${\ displaystyle {\ mathcal {N}} (0,1)}$

${\ displaystyle Z = {\ frac {{\ overline {X}} - \ mu} {\ sigma / {\ sqrt {n}}}}}$

the probability

${\ displaystyle P \ left ({- z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} \ leq {\ frac {{\ overline {X}} - \ mu} {\ sigma / {\ sqrt {n}}}} \ leq z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)}} \ right) = 1- \ alpha}$,

where the - is the quantile of the standard normal distribution . If one resolves for the unknown parameter , the result is ${\ displaystyle \ textstyle z _ {\ left (1 - {\ frac {\ alpha} {2}} \ right)}}$${\ displaystyle (1 - {\ tfrac {\ alpha} {2}})}$${\ displaystyle \ mu}$

${\ displaystyle P \ left ({{\ overline {X}} - z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} {\ frac {\ sigma} {\ sqrt {n }}} \ leq \ mu \ leq {\ overline {X}} + z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} {\ frac {\ sigma} {\ sqrt { n}}}} \ right) = 1- \ alpha}$

the confidence interval for${\ displaystyle (1- \ alpha)}$${\ displaystyle \ mu}$

Possible location of the unknown parameter in the estimation interval around the observed .${\ displaystyle \ mu}$${\ displaystyle {\ overline {x}}}$
${\ displaystyle KI_ {1- \ alpha} (\ mu) = \ left [{{\ overline {X}} - z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} { \ frac {\ sigma} {\ sqrt {n}}}; \ {\ overline {X}} + z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} {\ frac { \ sigma} {\ sqrt {n}}}} \ right].}$

The estimation interval, the realization of a confidence interval based on a specific sample, then results as

${\ displaystyle \ left [{{\ overline {x}} - z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} {\ frac {\ sigma} {\ sqrt {n} }}; \ {\ overline {x}} + z _ {\ left (1 - {\ tfrac {\ alpha} {2}} \ right)} {\ frac {\ sigma} {\ sqrt {n}}}} \ right].}$

The limits of the estimation interval, however, depend on and thus change from sample to sample. However, if the sample is extreme, the interval does not cover the parameter. This is the case in α × 100% of all samples, i.e. that is, that by a certain interval covers the true parameter with a probability of . ${\ displaystyle {\ overline {x}}}$${\ displaystyle {\ overline {x}}}$${\ displaystyle \ mu}$${\ displaystyle 1- \ alpha}$

The width of the confidence interval is of particular interest. This is determined by the standard deviation of the estimator and the chosen confidence level. Increasing the sample size can decrease the width. As a rule, a confidence interval that is as narrow as possible is desirable, because this indicates an accurate estimate given a constant confidence level.

As an absolute mistake ${\ displaystyle e}$denotes half the width of the confidence interval. So in the above case

${\ displaystyle e = z _ {\ left (1 - {\ frac {\ alpha} {2}} \ right)} {\ frac {\ sigma} {\ sqrt {n}}} \ ,.}$

The absolute error is a measure of the accuracy of the estimate (width of the confidence interval:) . ${\ displaystyle 2e}$

The absolute error is important when determining the required sample size for a given confidence interval and length of confidence interval . The question is: What sample size do you need to estimate a parameter (e.g. arithmetic mean) with a given accuracy and a given degree of certainty? ${\ displaystyle n}$

## Selected estimation intervals

### Overview for continuous distributions

An overview of all cases with normally distributed characteristics can be found in the article Normal Distribution Model .

 Expected value of a normally distributed characteristic with known variance :${\ displaystyle \ sigma ^ {2}}$ ${\ displaystyle \ textstyle z _ {(1 - {\ tfrac {\ alpha} {2}})}}$is the quantile of the standard normal distribution. ${\ displaystyle (1- \ alpha / 2)}$ ${\ displaystyle \ left [{{\ overline {x}} - z _ {(1 - {\ tfrac {\ alpha} {2}})} {\ frac {\ sigma} {\ sqrt {n}}} \; \ {\ overline {x}} + z _ {(1 - {\ tfrac {\ alpha} {2}})} {\ frac {\ sigma} {\ sqrt {n}}}} \ right]}$ Expected value of a normally distributed characteristic with unknown variance: The variance of the population is determined by the corrected sample variance ${\ displaystyle s ^ {2} = {\ tfrac {1} {n-1}} \ sum (x_ {i} - {\ overline {x}}) ^ {2}}$ estimated. ${\ displaystyle \ textstyle t _ {(1 - {\ tfrac {\ alpha} {2}}; n-1)}}$is the quantile of the t-distribution with degrees of freedom . ${\ displaystyle (1- \ alpha / 2)}$${\ displaystyle (n-1)}$ For , the quantile of the t-distribution can be replaced approximately by the corresponding quantile of the standard normal distribution. ${\ displaystyle n> 30}$ ${\ displaystyle \ left [{{\ overline {x}} - t _ {(1 - {\ tfrac {\ alpha} {2}}; n-1)} {\ frac {s} {\ sqrt {n}} } \; \ {\ overline {x}} + t _ {(1 - {\ tfrac {\ alpha} {2}}; n-1)} {\ frac {s} {\ sqrt {n}}}} \ right]}$ Expected value of an unknown distributed characteristic with unknown variance: If it is sufficiently large, the confidence interval can be determined on the basis of the central limit theorem . ${\ displaystyle n}$ ${\ displaystyle \ left [{{\ overline {x}} - z _ {(1 - {\ tfrac {\ alpha} {2}})} {\ frac {s} {\ sqrt {n}}} \; \ {\ overline {x}} + z _ {(1 - {\ tfrac {\ alpha} {2}})} {\ frac {s} {\ sqrt {n}}}} \ right]}$ Standard deviation of a normally distributed characteristic: ${\ displaystyle {\ mathcal {\ chi}} _ {(p; k)} ^ {2}}$is the p-quantile of the chi-square distribution with degrees of freedom. ${\ displaystyle k}$ ${\ displaystyle \ left [\ s {\ sqrt {\ frac {n-1} {\ chi _ {(1 - {\ tfrac {\ alpha} {2}}; n-1)} ^ {2}}} }; s {\ sqrt {\ frac {n-1} {\ chi _ {({\ tfrac {\ alpha} {2}}; n-1)} ^ {2}}}} \ \ right]}$

### Discrete distributions

Confidence intervals for the parameter p of the binomial distribution are described in the

The so-called Clopper-Pearson confidence interval can be determined with the help of the beta or F distribution . This confidence interval is also called exact because the required confidence level is actually maintained. In the case of approximation methods that are (mostly) based on the approximation of the binomial distribution by the normal distribution, the confidence level is often not maintained.

If the number of elements in the population is known, a confidence interval for an urn model without replacement can also be specified for the parameter (with the help of a correction factor) .

## Confidence intervals and hypothesis tests

The terms confidence range and statistical test are dual to one another; under general conditions, statistical tests for corresponding point hypotheses can be obtained from a confidence range for a parameter and vice versa:

If the null hypothesis : is tested for a parameter , then the null hypothesis is not rejected at a significance level if the corresponding confidence interval, calculated with the same data, contains the value . Therefore, confidence intervals sometimes replace hypothesis tests. ${\ displaystyle \ vartheta}$${\ displaystyle \ vartheta = \ vartheta _ {0}}$${\ displaystyle \ alpha}$${\ displaystyle (1- \ alpha / 2)}$${\ displaystyle \ vartheta _ {0}}$

For example, one tests in the regression analysis whether in the multiple linear regression model with the estimated regression hyperplane

${\ displaystyle {\ hat {y}} = b_ {0} + b_ {1} \, x_ {1} + b_ {2} \, x_ {2} + \ ldots + b_ {k} \, x_ {k }}$

the true regression coefficients are zero (see Global F test ). If the hypothesis is not rejected, the corresponding regressors are likely to be irrelevant in explaining the dependent variable . Corresponding information is provided by the confidence interval for a regression coefficient: If the confidence interval covers zero , the regression coefficient is not statistically different from at a significance level . ${\ displaystyle \ beta _ {j} \ (j = 1, \ ldots, k)}$${\ displaystyle x_ {j} \ (j = 1, \ ldots, k)}$${\ displaystyle y}$${\ displaystyle \ left (0 \ in KI_ {1- \ alpha} (\ beta _ {j}) \ right)}$${\ displaystyle \ alpha}$${\ displaystyle 0}$

The terms of authenticity and the consistently best test can be transferred to confidence ranges.

## Examples of a confidence interval

example 1

A company wants to introduce a new detergent. In order to sound out buyer acceptance, the detergent is placed in a test supermarket. This action is intended to estimate the average daily sales in a supermarket of this size. The daily sales are now defined as a random variable [piece] with the unknown parameters expected value and variance . Based on long-term observations, it is assumed that the distribution is approximately normal. The market research department has found a confidence level of 0.95 (95%) to be sufficient. Daily sales are then recorded for 16 days. It turns out ${\ displaystyle X}$${\ displaystyle \ mu}$${\ displaystyle \ sigma ^ {2}}$${\ displaystyle X}$

 Day paragraph ${\ displaystyle x}$ 1 2 3 4th 5 6th 7th 8th 9 10 11 12 13 14th 15th 16 110 112 106 90 96 118 108 114 107 90 85 84 113 105 90 104

For a normally distributed population with unknown variance, the confidence interval for the expected value is given as

${\ displaystyle \ left [{{\ overline {x}} - t _ {\ left (1 - {\ frac {\ alpha} {2}}; n-1 \ right)} {\ frac {s} {\ sqrt {n}}} \; \ {\ overline {x}} + t _ {\ left (1 - {\ frac {\ alpha} {2}}; n-1 \ right)} {\ frac {s} {\ sqrt {n}}}} \ right]}$

It is the mean of the sample

${\ displaystyle {\ overline {x}} = {\ frac {1} {16}} \ cdot (110 + 112 + \ dotsb +104) = {\ frac {1} {16}} \ cdot 1632 = 102}$

and the variance of the sample

{\ displaystyle {\ begin {aligned} s ^ {2} & = {\ frac {1} {n-1}} \ sum _ {i = 1} ^ {n} (x_ {i} - {\ overline { x}}) ^ {2} \\ & = {\ frac {1} {15}} \ left ((110-102) ^ {2} + (112-102) ^ {2} + \ dotsb + (104 -102) ^ {2} \ right) \\ & = {\ frac {1} {15}} \ cdot 1856 = 123 {,} 73 \ end {aligned}}}

It is the quantile of the t-distribution with 15 degrees of freedom ${\ displaystyle (1- \ alpha / 2)}$

${\ displaystyle t _ {\ left (1 - {\ frac {\ alpha} {2}}; n-1 \ right)} = t _ {\ left (0 {,} 975; 15 \ right)} = 2 {, } 131}$

The value for t is not easy to calculate and must therefore be read from a table.

The 95% confidence interval is then calculated as

${\ displaystyle \ left [{102-2 {,} 131 {\ frac {\ sqrt {123 {,} 73}} {\ sqrt {16}}}; 102 + 2 {,} 131 {\ frac {\ sqrt {123 {,} 73}} {\ sqrt {16}}}} \ right] = [102-5 {,} 93; 102 + 5 {,} 93] = [96 {,} 07; 107 {,} 93]}$

On average, 95% of the estimated intervals contain the true average , i.e. the average daily sales of detergent bottles in comparable supermarkets. For this specific interval, however, the statement that it contains the true mean with a 95% probability does not apply . All we know is that this interval comes from a set (of intervals) of which 95% contain the true mean. ${\ displaystyle \ mu}$

Example 2

A company delivered a lot (batch) of 6000 pieces (e.g. screws) to the customer. This carries out an incoming inspection by means of random sampling in accordance with the international standard ISO 2859-1. Here z. B. 200 screws (depending on the selected AQL) randomly drawn across the entire lot and checked for compliance with the agreed requirements (quality features). Of the 200 screws tested, 10 did not meet the requirements. By calculating the confidence interval (Excel function BETAINV) , the customer can estimate how large the expected proportion of defective screws in the whole lot is: at a confidence level of 95%, the Clopper-Pearson confidence interval is calculated [2.4%, 9th %] for the proportion of defective screws in the batch (parameters: n = 200, k = 10 ).

## literature

• Ulrich Krengel : Introduction to probability theory and statistics. 8th edition. Vieweg, 2005.
• Joachim Hartung : Statistics. 14th edition. Oldenbourg, 2005.