The Problem
Example # 17: Estimate the population variance, σ², using a confidence interval to indicate uncertainty. The data are:
45, 36, 35, 36, 32, 42, 41, 41, 43, 27, 38, 28, 40, 32, 30, 32, 39, 23, 24, 25, 31, 29, 47, 39, 32, 33, 40, 33
With this information, calculate the endpoints of the central 99% confidence interval.
Information given:
To summarize the above, the values of import are:
Summary statistics from the problem
\( s^2 \)
| = |
41.453704 |
\( n \)
| = |
28 |
\( \alpha \)
| = |
0.01 |
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 99% confidence interval: (22.5451, 94.7907). 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{Lower Limit} &= \left( n-1 \right) s^2 / \chi^2_L \\[1em]
&= \left( 28-1 \right) 41.453704 / 49.644915 \\[1em]
&= 22.545108 \\
\end{align}
$$
$$ \begin{align}
\text{Upper Limit} &= \left( n-1 \right) s^2 / \chi^2_U \\[1em]
&= \left( 28-1 \right) 41.453704 / 11.807587 \\[1em]
&= 94.790745 \\[3em]
\end{align}
$$
Thus, we are 99% confident that the population variance is between 22.5451 and 94.7907.
Hide the R Code
Copy and paste the following code into your R script window, then run it from there.
thisData = c(45, 36, 35, 36, 32, 42, 41, 41, 43, 27, 38, 28, 40, 32, 30, 32, 39, 23, 24, 25, 31, 29, 47, 39, 32, 33, 40, 33)
n = length(thisData)
s2 = var(thisData)
X2L = qchisq(0.005, df=27, lower.tail=FALSE)
X2U = qchisq(0.995, df=27, lower.tail=FALSE)
lcl = (n-1)*s2/X2L
ucl = (n-1)*s2/X2U
lcl; ucl
In the R output, the confidence limits are the numbers output following the final line. Note that R will give you confidence intervals that are more accurate and more precise than doing the calculations by hand. As such, these computer-calculated limits will differ slightly from those you calculate by hand.
Hide the Excel Code
Copy and paste the following code into your Excel window, making sure the value sample
ends up in A1
after pasting.
How to calculate the test statistic in Excel.
sample | | | |
45 |
|
alpha: |
0.01 |
36 |
|
var: |
=VAR(A:A) |
35 |
|
n: |
=COUNT(A:A) |
36 |
|
|
|
32 |
|
lcl: |
=(D4-1)*D3/CHISQ.INV(1-D2/2,D4-1) |
42 |
|
ucl: |
=(D4-1)*D3/CHISQ.INV(D2/2,D4-1) |
41 |
|
|
|
41 |
|
|
|
43 |
|
|
|
27 |
|
|
|
38 |
|
|
|
28 |
|
|
|
40 |
|
|
|
32 |
|
|
|
30 |
|
|
|
32 |
|
|
|
39 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
31 |
|
|
|
29 |
|
|
|
47 |
|
|
|
39 |
|
|
|
32 |
|
|
|
33 |
|
|
|
40 |
|
|
|
33 |
|
|
|
The endpoints of the 99% confidence interval are the numbers calculated in cells D6 and D7. Again, when you paste this code into Excel, make sure that you start the pasting in cell A1. To help with that, you may want to also copy this notice. It seems to help.