## Information

The confidence interval calculator computes the confidence interval of the **mean** and the confidence interval of the **standard deviation** using the Normal distribution or the Student's t distribution for the mean and the Chi-Squared distribution for the standard deviation.

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 (σ), use the normal distribution. The average's (x̄) distribution is Normal (Mean, SD/√n). Otherwise, use the sample size standard deviation with the t distribution with n-1 degrees of freedom. The (x̄-Mean)/(S/√n) distribution is T.

#### Confidence interval formula

When we know the population standard deviation.

When we don't know the population standard deviation, and use the sample standard deviation.

### Standard deviation confidence interval

The statistic (n-1)S

^{2}/σ

^{2} distributes chi-squared with n-1 degrees of freedom.

#### Confidence interval formula

(n - 1)S^{2} | ≤ σ^{2} ≤ | (n - 1)S^{2} |

χ_{1-α/2}(df) | χ_{α/2}(df) |

n - sample size.

S - sample standard deviation.

σ - population standard deviation.

## R Code

The following R code should produce the same results. unless you filled the population standard deviation as the R code use only the t distribution based on the sample standard deviation.

The sigma.test produce the confidence interval of the **variance** instead of the standard deviation