When you’re working on a sample, you want to know how this sample is representative of the entire population. The confidence interval and confidence level came in place.

The confidence interval tells you about a probable population mean. So it says that on the n sample, the value came in that interval around the mean.

The prediction intervals are used to calculate the next probable data point. So it tell about the distribution of data instead of the mean of the population.

The confidence level says how many of the samples came in that interval.

`Example: you can say that the Italian male population has a height of 173cm +/- 5cm (the confidence interval) with a confidence level of 95% (so you can say wrong in the 5% of the example).`

How to calculate the confidence intervall? The formula is the one in image1.

The value 1,96 is the value that represents an ad confidence level of 95%. For a confidence level of 99%, you can use the value of 2,575. But why?

These numbers are the Z-Score representing the 95% or 99% of the observation around the mean if we are dealing with a normal distribution. If you go to chapter 2.2.2 Normal, Distribution and normality, you can calculate the Z-Score.

In the particular case that you are working on the probability of something meeting specific criteria, you can calculate the standard error with the formula in the image2.