When using the sample data we know the sample's statistics but we don't know the true value of the population's measures. Instead, we may treat the population's measures as random variables and calculate the confidence interval.
First, we need to define the confidence level which is the required certainty level that the true value will be in the confidence interval Researchers commonly use a confidence level of 0.95.
Mean confidence interval
When we know the population's standard deviation (σ), we will use the normal distribution. The average's (X) distribution is Normal (Mean, SD/√n) Otherwise, we will use the sample size standard deviation with the t distribution with n-1 degrees of freedom. The (X-Mean)/(S/√n) distribution is T.
Standard deviation confidence interval
(n-1)S2/σ2 distributed Chi-square with n-1 degrees of freedom.
n - sample size.
S - sample standard deviation.
SD - population standard deviation.