The Problem
Example #45: Let us estimate the mean height of a population, using a confidence interval to indicate our level of uncertainty. To estimate μ, we collect data. These data are the heights of a sample from this population. The sample values are:
60, 88, 93, 81, 86, 74, 97, 82, 71, 114, 76, 101, 134, 87, 89, 78, 68, 71, 101, 78, 76, 132, 100, 95, 74, 62, 61, 63, 118, 76
In addition to these data, we also know that the data are generated from a Normal process (they come from a Normally distributed population). With this information, let us estimate the population mean using a 98% confidence interval.
Information given:
To summarize the above, the values of import are:
Summary statistics from the problem
\( \bar{x} \)
| = |
86.2 |
\( n \)
| = |
30 |
\( \alpha \)
| = |
0.02 |
Note that there is no value given for μ0. This is because confidence intervals are based solely on the data, and not on any hypothesized values.
It may be helpful if you calculate these values yourself. Once you have, you can check your answers by hovering your mouse over the grey spaces to see if you calculated them correctly.
Your Answer
You got the correct endpoints to the 98% confidence: (77.4159, 94.9841). Congratulations!
Unfortunately, your answer was not correct. Either try again or click on “Show Solution” below to see how to obtain the correct answer.
Assistance
Hide Solution
$$ \begin{align}
\text{98% Confidence Bounds} &= \bar{x} \pm t(\alpha/2,\nu) \frac{s}{\sqrt{n}} \\[1em]
&= 86.2 \pm 2.462\ \frac{19.541997}{\sqrt{30}} \\[1em]
&= 86.2 \pm 8.7841 \\[1em]
\end{align} $$
Thus, we are 98% confident that the mean height for the population is between 77.4159 and 94.9841.
Note that the value following the plus/minus sign ± is known as the margin of error, \( E = 8.7841 \), and is always half of the width of the confidence interval. The margin of error is affected by the sample size, the level of confidence, and the variability of the population. If n increases, the margin of error shrinks. If the level of confidence increases, the margin of error expands. If the variability in the population increases, the margin of error expands.
Hide the R Code
The following code will perform the t-test using R’ built-in function. Copy and paste the following code into your R script window, then run it from there.
sample = c(60, 88, 93, 81, 86, 74, 97, 82, 71, 114, 76, 101, 134, 87, 89, 78, 68, 71, 101, 78, 76, 132, 100, 95, 74, 62, 61, 63, 118, 76)
t.test(sample, conf.level=0.98)
The limits of the 98% confidence interval follow the line “98 percent confidence interval:
” near the middle of the output.
Hide the Excel Code
The z-procedures are sensitive to knowing the population variance. Logic dictates that if we do not know the population mean, then we will not know the population variance. As such, the z-procedures are rarely used now. As such, there is no z-test in the base Excel program.
Copy and paste the following code into your Excel spreadsheet window, making sure the value x
ends up in A1
after pasting.
How to calculate the expected value in Excel.
sample | | |
60 |
s: |
=STDEV.S(A:A) |
88 |
x-bar: |
=AVERAGE(A:A) |
93 |
mult: |
=T.INV(0.01,COUNT(A:A)-1) |
81 |
lcl: |
=C3-C4*C2/SQRT(count(A:A)) |
86 |
ucl: |
=C3+C4*C2/SQRT(count(A:A)) |
74 |
|
|
97 |
|
|
82 |
|
|
71 |
|
|
114 |
|
|
76 |
|
|
101 |
|
|
134 |
|
|
87 |
|
|
89 |
|
|
78 |
|
|
68 |
|
|
71 |
|
|
101 |
|
|
78 |
|
|
76 |
|
|
132 |
|
|
100 |
|
|
95 |
|
|
74 |
|
|
62 |
|
|
61 |
|
|
63 |
|
|
118 |
|
|
76 |
|
|
The limits for the 98% confidence interval are the numbers calculated in cells C5 and C6.
Again, when you paste this code into Excel, make sure that you start the pasting in call A1. To help with that, you may want to also copy this notice. It seems to help.