Confidence Interval
Before exploring confidence intervals, it's important to understand sampling and what a sample is. A sample is a subset of data drawn from a larger population, meant to represent it as a whole. Typically, the sample is a small fraction of the total population. The goal is that by analyzing the sample we can draw conclusions and make inferences about its population.
What is a Confidence Interval?
In simple terms, a Confidence Interval represents range of values that we are fairly sure contains the true value of an unknown population parameter. It has an associated confidence level which indicates how often the interval would include this value if the process were repeated. For example, if we have 90% confidence level, it implies means that 90 times out of 100 cases, we can expect the interval to capture the true population parameter.
1. Calculating Confidence Intervals
1.1. Mean
For means, we take the sample mean then add and subtract the appropriate z-score (when σ is known or with Large Sample Size (n>30), or t-score when sigma is unknown) for our confidence level with the population standard deviation over the square root of the number of samples.
When σ is Known

The equation is simply tells us that the Confidence Interval is centered at the sample mean x_hat
extends 1.96 to each side of x_hat.
When σ is Unknown and Sample Size n ≥ 30:
We first calculate the sample standard deviation:

Then, compute the confidence interval:

When σ is Unknown and Sample Size n < 30:
We rely on Student's t-distribution:

1.2. Proportions
For proportions, we take the sample proportion add and subtract the z score times the square root of the sample proportion times its complement, over the number of samples.

Last updated
Was this helpful?