Confidence Interval

What is the confidence interval?

The confidence interval CI is the range in which a parameter (e.g. the mean value) lies with a certain probability.

If several samples are taken from a population, it is very likely that each sample will have a different mean value. Now you actually want to know the mean value of the population and not that of the sample. The confidence interval indicates the range in which the true mean value of the population lies with a certain probability.

Confidence Interval

Attention! The above explanation is widely used because it is easy to understand, but it is not considered correct by all experts. Correct, but more complicated is the following definition:

The 95% confidence interval (CI) is an interval calculated from sample data that’s one from an infinite sequence, 95% of which include the population parameter. In the long run, 95% of such intervals include the true mean.

What do I need the confidence interval for?

In statistics, parameters of the population are often estimated based on a sample, for example the mean or the variance . But these are only estimates and the true value in the population will lie somewhere around these estimates. Now it is very useful to define a range or interval in which the true value will lie with a high probability, this range is called confidence interval.

Calculate confidence interval

To calculate the confidence interval, the distribution function of the respective parameter (e.g. the mean value) in the population is required. If this distribution is assumed to be normally distributed, the confidence interval for the mean value is given by:

Confidence interval formula

Where is the mean of the sample, n is the size of the sample, and s is the standard deviation of the sample. Plus and minus indicate the lower and upper limits of the confidence interval, respectively.

Confidence interval upper and lower limit

If the sample is small, the t-distribution is used instead of the normal distribution. Then the z-value is replaced by the t and the formula results in

Confidence interval with t-distribution Formula

Confidence interval 95%

For the calculation of the confidence interval, the probability must be defined with which the mean value of the population should lie in the interval. Very often the confidence level of 95% or 99% is used as probability. This probability is also called the confidence coefficient.

For the 95% confidence interval and the 99% confidence interval, the z-values are as follows:

Confidence level 95% 99%
z-Value 1.96 2.58

If a confidence interval of 95% is given, one can be 95% sure that the true mean value lies within this interval.

Confidence interval 95

Confidence interval for t-test

A t-test compares differences in means, e.g. you can use a t-test to test whether there is a difference in salary between men and women.

You actually want to make a statement whether there is a difference in salary in the population. Since you cannot survey the entire population, you use a sample. In this sample, there is a high probability of a difference in salary.

In order to be able to estimate approximately in which range the mean difference in the population lies, you calculate the confidence interval.

In the t-test calculator on DATAtab you can calculate the confidence interval of the mean difference.

Statistics made easy

  • Many illustrative examples
  • Ideal for exams and theses
  • Statistics made easy on 251 pages
  • Only 6.99 €
Free sample

"Super simple written"

"It could not be simpler"

"So many helpful examples"

Cite DATAtab: DATAtab Team (2023). DATAtab: Online Statistics Calculator. DATAtab e.U. Graz, Austria. URL

Contact & Support FAQ & About Us Privacy Policy Statistics Software