A confidence interval is a way of using a sample to estimate an unknown population value. For estimating the mean, there are two types of confidence intervals that can be used: z-intervals and t-intervals. In the following lesson, we will look at how to use the formula for each of these types of intervals. **To see the examples below in a video, scroll down!**

Table of Contents

- Calculating and interpreting a z-interval using the formula
- Calculating and interpreting a t-interval using the formula
- Video example
- Other considerations
- Additional reading

[adsenseWide]

## Z-Intervals

This procedure is often used in textbooks as an introduction to the idea of confidence intervals, but is not really used in actual estimation in the real world. Even so, it is common enough that we will talk about it here!

What makes it strange? Well, in order to use a z-interval, we assume that \(\sigma\) (the population standard deviation) is known. As you can imagine, if we don’t know the population mean (that’s what we are trying to estimate), then how would we know the population standard deviation?

### When to use a z-interval

Setting the discussion above aside, the general rule for when to use a z-interval calculation is:

Use a z-interval when:

the sample size is greater than or equal to 30 and population standard deviation known OR Original population normal with the population standard deviation known.

### Formula for the z-interval

If these conditions hold, we will use this formula for calculating the confidence interval:

\(\overline{x} \pm z_{c}\left(\dfrac{\sigma}{\sqrt{n}}\right)\)

where \(z_{c}\) is a critical value from the normal distribution (see below) and \(n\) is the sample size.

Common values of \(z_{c}\) are:

Confidence Level | Critical Value |
---|---|

90% | 1.645 |

95% | 1.96 |

99% | 2.575 |

### Example using a z-interval

Suppose that in a sample of 50 college students in Illinois, the mean credit card debt was $346. Suppose that we also have reason to believe (from previous studies) that the population standard deviation of credit card debts for this group is $108. Use this information to calculate a 95% confidence interval for the mean credit card debt of all college students in Illinois.

### Solution

Since we wish to estimate the mean, we immediately know we will be using either a t-interval or a z-interval. Looking a bit closer, we see that we have a large sample size (\(n = 50\)) and we know the population standard deviation. Therefore, we will use a z-interval with \(z_{c} = 1.96\). From reading the problem, we also have:

- Mean is $346: \(\overline{x} = 346\)
- Population standard deviation is 108: \(s = 108\)

Applying the formula:

\(\begin{align}\overline{x} &\pm z_{c}\left(\dfrac{\sigma}{\sqrt{n}}\right)\\ 346 &\pm 1.96\left(\dfrac{108}{50}\right)\end{align}\)

The \(\pm\) indicates that we need to perform two different operations: a subtraction and an addition.

Left hand endpoint:

\(346 – 1.96\left(\dfrac{108}{50}\right) = 316.1\)

Right hand endpoint:

\(346 + 1.96\left(\dfrac{108}{50}\right) = 375.9\)

This gives our 95% confidence interval for \(\mu\), the population mean, as \(\boxed{(316.1, 375.9)}\).

#### Interpretation

We are 95% confident that the mean amount of credit card debt for all college students in Illinois is between $316.10 and $375.90.

Of course this is a very particular statement, so please make sure you study how to interpret confidence intervals in general and so you can understand exactly what this means.

#### Other ways to write this interval

Another way to present this interval would be to calculate the margin of error:

\(1.96\left(\dfrac{108}{50}\right)=29.9\)

and write the interval as:

\(\boxed{$346} \pm \$29.9\)}

Both versions are correct, and the version you use depends on your audience and perhaps your teacher or professors preference. You can read more about different ways to write intervals here: Three ways to write a confidence interval.

## T-intervals

The much more realistic scenario is using a t-interval to estimate an unknown population mean. This interval relies on our sample standard deviation in calculating the margin of error. All this means for us is that the formula will be very similar, but the critical value will no longer come from the normal distribution. Instead, it will come from the student’s t distribution.

### When to use a t-interval

The rules for when to use a t-interval are as follows.

Use a t-interval when:

Population standard deviation UNKNOWN and original population normal OR sample size greater than or equal to 30 and Population standard deviation UNKNOWN.

### Formula for the t-interval

The formula for a t-interval is:

\(\overline{x} \pm t_{c}\left(\dfrac{s}{\sqrt{n}}\right)\)

where \(t_{c}\) is a critical value from the t-distribution, \(s\) is the sample standard deviation and \(n\) is the sample size.

#### Finding \(t_c\)

The value of \(t_{c}\) depends on the sample size through the use of “degrees of freedom” where \(df = n – 1\). We will use this to look up the value of \(t_{c}\) in a table (a nice free version of that table can be found here, or typically in the back of your textbook if you are currently taking a class).

### Example using a t-interval

Suppose that a sample of 38 employees at a large company were surveyed and asked how many hours a week they thought the company wasted on unnecessary meetings. The mean number of hours these employees stated was 12.4 with a standard deviation of 5.1. Calculate a 99% confidence interval to estimate the mean amount of time all employees at this company believe is wasted on unnecessary meetings each week.

### Solution

As before, since we are estimating a mean with a confidence interval, we know it will either be a t-interval or a z-interval. In this case, we have a large sample (\(n = 38\)), but we only have the sample standard deviation. If you aren’t sure of that – read closely. The standard deviation of 5.1 was in the context of the sample, so \(s = 5.1\). Thus, we will go ahead and use a t-interval since \(\sigma\) is unknown.

Before we can do that however, we need to look up the critical value. To know which row in the t-table to look at, we find the degrees of freedom which is \(n – 1 = 38 – 1 = 37\). Using the table linked here:

Now that we have that, we plug the values into the formula and do the calculations to get our two endpoints. Remember that we have:

- Sample mean: \(\overline{x} = 12.4\)
- Sample size: \(n = 38\)
- Sample standard deviation: \(s = 5.1\)
- Critical value: \(t_c = 2.715\)

Therefore the interval is:

\(\begin{align} \overline{x} &\pm t_{c}\left(\dfrac{s}{\sqrt{n}}\right)\\ 12.4 &\pm 2.715\left(\dfrac{5.1}{\sqrt{38}}\right)\end{align}\)

This gives us the following two endpoints for our interval.

Left hand endpoint:

\(12.4 – 2.715\left(\dfrac{5.1}{\sqrt{38}}\right) = 10.2\)

Right hand endpoint:

\(12.4 + 2.715\left(\dfrac{5.1}{\sqrt{38}}\right) = 14.6\)

99% Confidence Interval for \(\mu\): \(\boxed{(10.2, 14.6)}\)

#### Interpretation

“We are 99% confident that the mean amount of time that all employees at this company think is wasted on meetings each week is between 10.2 and 14.6 hours.”

The same warning applies here – make sure you take the time to truly study what this means.

## Video of the examples

The following video goes through the examples completed above. Use this to help yourself better understand how to apply these formulas.

## Other Considerations

Confidence intervals are most often calculated with tools like SAS, SPSS, R, (these are statistical calculations packages) Excel, or even a graphing calculator. It is helpful to calculate them by hand once or twice to get a feel for the concept but you should also take the time to learn how to calculate them using one of these common tools. Which tool you use depends on the course you are taking or the field you are working in.

[adsenseLargeRectangle]

## Additional Reading

If you are currently taking a statistics course, we have a ton of free statistics lessons and videos. Be sure to check out the statistics section on MathBootCamps for more articles like this one!