The calculation of a confidence interval depends on the type of data and the sample size. For a large sample size, the CI is often calculated using the formula:
The critical value is determined by the desired confidence level, and the standard error is a measure of the variability of the sample estimate. In smaller samples, other methods such as the t-distribution are used.