$n$ | = | = | = |
A confidence interval is made up of two parts, the point estimate and the margin of error. The point estimate is simply the sample statistic corresponding to the population parameter of interest. So, if we're constructing a confidence interval for the population mean (μ), we use the sample mean ($\bar{x}$), because the sample mean provides a point estimate (or single-value estimate) of the population mean. Since the sample mean is relatively simple to calculate ($\bar{x} = \sum{x}/n$), the focus will be on finding the margin of error. The formula we use to compute the margin of error for a confidence interval of the population mean depends on whether the population standard deviation (σ) is known or unknown. The two formulas are shown below. If the population standard deviation is unknown, the sample standard deviation (s) is used instead. To change from $\sigma$ known to $\sigma$ unknown in the Confidence Interval Calculator, click on $\boxed{σ}$ and select $\boxed{s}$.
$\sigma$ Known | $\sigma$ Unknown | |
Margin of Error | $ z_{\alpha/2} \dfrac{\sigma}{\sqrt{{\color{Black} n}}} $ | $ t_{\alpha/2} \dfrac{s}{\sqrt{n}} $ |
In order to find the value of $ z_{\alpha/2} $ (or $ t_{\alpha/2} $) for the margin of error, we must first find the value of $\alpha/2$. We start by setting 1 - $\alpha$ equal to the confidence coefficient, which is simply the decimal form of the confidence level. So, for example, if the confidence level is 95%, the confidence coefficient is .95. As another example, if the confidence level is 90%, the confidence coefficient is .90. The next step is to solve for $\alpha/2$. So, continuing with our first example, we would have 1 - $\alpha$ = .95. From there, we get that $\alpha$ = .05 and thus $\alpha/2$ is equal to .025. For our second example, we have 1 - $\alpha$ = .90, which means $\alpha$ = .10 and thus $\alpha/2$ = .05. The most commonly used confidence level is 95% while 90% and 99% are also popular. An interval estimate constructed at a confidence level of 95% is called a 95% confidence interval. To change the confidence level, click on $\boxed{95\%}$. You can input your own confidence level by selecting $\boxed{...}$.
Confidence Level | Confidence Coefficient |
99% | .99 |
95% | .95 |
90% | .90 |
Now that we know the value of $\alpha/2$, we can find $ z_{\alpha/2} $ (or $ t_{\alpha/2} $) for the margin of error part of the confidence interval. We will start by explaining how to find $z_{\alpha/2}$. The primary difference between finding the value of $z_{\alpha/2}$ and $t_{\alpha/2}$ is that for the former we use the standard normal, or z, distribution and for the latter we use the t-distribution. We can get $z_{\alpha/2}$ by finding the z-value that provides an area of $\alpha/2$ in the upper tail of the standard normal (z) distribution. Similarly, $ t_{\alpha/2} $ is the t-value that provides an area of $\alpha/2$ in the upper tail of the t-distribution. If $\sigma$ is known and we're using the z distribution, it is useful to calculate the area to the left since that is what the z-table gives us. The t-table gives us the upper tail area but the particular t-distribution depends on the degrees of freedom, which is simply one less than the sample size (degrees of freedom = n - 1). Note that if you want to enter your data you can click on the switch symbol.
Finally, we can put the point estimate and margin of error together to make the confidence interval for the population mean. The confidence interval is created by adding and subtracting the margin of error from the point estimate. If the population standard deviation ($\sigma$) is known, the margin of error is given by $z_{\alpha/2} \frac{\sigma}{\sqrt{n}}$. So the confidence interval will be given by $\bar{x} \pm z_{\alpha/2} \frac{\sigma}{\sqrt{n}}$. If the population standard deviation ($\sigma$) is unknown, the margin of error is $t_{\alpha/2} \frac{s}{\sqrt{n}}$. So the confidence interval will be given by $\bar{x} \pm t_{\alpha/2} \frac{s}{\sqrt{n}}$. The confidence interval gives a range of values the population parameter is likely to be in. The likeliness that the interval contains the parameter is determined by the confidence level. So a 95% confidence interval of the population mean is an range of values that the population mean has a 95% chance of being contained in.
$\sigma$ Known | $\sigma$ Unknown | |
Confidence Interval | $ \bar{x} \pm z_{\alpha/2} \dfrac{\sigma}{\sqrt{{\color{Black} n}}} $ | $ \bar{x} \pm t_{\alpha/2} \dfrac{s}{\sqrt{n}} $ |
Sometimes we are interested in creating confidence intervals for something other than the population mean. For example, we may want to create a confidence interval for the population proportion (p). If we're constructing a confidence interval of the population proportion, we use the sample statistic corresponding to it, which is the sample proportion. The confidence interval is created by adding and subtracting the margin of error from the point estimate. Since, like the sample mean, sample proportion is relatively easy to calculate, the focus will again be on finding the margin of error. To switch from confidence intervals about the population mean to the population proportion, click on $\boxed{\bar{x}}$ and select $\boxed{\bar{p}}$.
Population Proportion | |
Margin of Error | $ z_{\alpha/2} \sqrt{\dfrac{\bar{p}(1-\bar{p})}{n}} $ |
Sometimes, when dealing with confidence intervals, we are interested in achieving a certain margin of error. In order to achieve the margin of error that we want, we can adjusted the sample size. The formula for this can be easily derived from the margin of error formula and is shown below. In the formula, $E$ is the desired margin of error. If the population standard deviation is unknown, a planning value is used for $\sigma$. The sample size needed to achieve the desired margin of error can also be found for confidence intervals about the population proportion. Again, the formula for this can be easily derived from the margin of error formula and is shown below. In the formula, $E$ is the desired margin of error and $p^*$ is the planning value.
Mean | Proportion | |
Sample Size | $ n = \dfrac{(z_{\alpha/2})^2 \sigma ^2}{E^2} $ | $ n = \dfrac{(z_{\alpha/2})^2 p^* (1-p^*)}{E^2} $ |
Recall that $s^2$, the sample variance, is the point estimate of $\sigma^2$, the population variance. When doing inference about the population variance, we are interested in the sampling distribution of $(n-1)s^2/\sigma^2$. The quantity $(n-1)s^2/\sigma^2$ has a chi-square distribution with $n-1$ degrees of freedom. Knowing the sampling distribution of this quantity, we can perform inference about the population standard deviatio, $s^2$. That is, we can create confidence intervals and conduct hypothesis tests about the population standard deviation. Like the t-distribution, the chi-square distribution depends on the degrees of freedom. Each different degrees of freedom corresponds to a different chi-square distribution. However, unlike the t-distribution, the chi-square isn't symmetric. While the t-distribution, as well as the normal distribution, are symmetric about their mean, the right tail of the chi-square distribution is longer than the left tail. This relative shape between the left and right side of the distribution are determined by the degrees of freedom.
Chi-Square Distribution |
$ \dfrac{(n-1)s^2}{\sigma^2} $ |
Confidence intervals are closely related to the topic of hypothesis testing in statistics. In fact, a confidence interval for the population mean can be constructed by conducting a hypothesis test on all possible values of the population mean. All the values that are not rejected make up the confidence interval. So for example, a 95% confidence interval for the population mean can be constructed by testing all the possible values of the population mean at the 5% level of significance. All the values not rejected at the 5% level make up the 95% confidence interval. Hypothesis testing can be done using the Hypothesis Testing Calculator. Confidence intervals make a lot of use out of two continuous probability distributions. Specifically, those two continuous probability distributions are the standard normal distribution and the student's t-distribution. Calculations involving these probability distributions, and other continuous probability distributions, can be made using the Continuous Distributions Calculator.