\magnification=\magstep1
\centerline{Mathematics 376 -- Probability and Statistics II}
\centerline{Group Lab Project 2 -- More on Confidence Intervals}
\centerline{February 23, 2004}
\bigskip
\noindent
{\it Background}
\bigskip
\noindent
We have now discussed constructing:
\bigskip
\item{$\bullet$} Large-sample confidence
intervals for means, differences of subpopulation means,
fractions (or proportions) and differences of subpopulation
fractions (using pivotal quantities that are standard normal)
\item{$\bullet$}  Small-sample confidence intervals 
for means and differences of means under the assumption
that the population has a normal distribution 
(using pivotal quantities that have $t$-distributions)
\item{$\bullet$}  Confidence intervals for variances
or standard deviations (using pivotal quantities that
have $\chi^2$ distributions).
\bigskip
\noindent
In today's lab we will begin by applying some of this to an applied 
problem.  Then, we will consider the problem of finding {\it shortest
confidence intervals} for variances, given the confidence level
$\alpha$.  Finally, we will consider the problem of constructing
a confidence interval for a {\it ratio} of subpopulation
variances.
\bigskip
\noindent
{\it Lab Problems}
\bigskip
\noindent
A)  A lab technician tests blood samples from 25 men and computes
the total serum cholesterol level (LDL + HDL) for each.  The data obtained 
were as follows:
$$\matrix{164 & 272 & 261 & 248 & 235 & 192 & 203 & 278 & 268\cr
           230 & 242 & 305 & 286 & 310 & 345 & 289 & 326 & \cr
           335 & 297 & 328 & 400 & 228 & 194 & 338 & 252 & \cr}$$
(Ouch!!  Not a healthy-eating, regular-exercise group on the whole --
current guidelines say level should be no higher than 200 in
adult males to minimize risk of heart disease and strokes.)
\bigskip
\item{1)}  Compute the sample mean and sample variance for these
data using the appropriate procedures in the Maple package (recall
there's on-line documentation available on the course homepage
if you need it).
\item{2)}  To compute confidence intervals, we need
to know values like the $z_{\alpha/2}$ or $t_{\alpha/2}(\nu)$
in our general formulas.
Our book's tables are good, but they do not contain every possible
case we might need.  Any needed values from the standard normal
and $t$ distribution can also be obtained 
via the {\tt NormalCDF} and {\tt TCDF} functions in the Maple
package.  For instance, by ``trial and error'' determine an
approximation of $z_{.075}$ that seems to be good to at least 4 decimal
places.   Compare with the best estimate
you can get using the book's standard normal table.
Similarly, determine an approximation to $t_{.075}(10)$.  
\item{3)}  Compute $85\%$ and $95\%$ confidence intervals for the population
mean cholesterol level using both the large-sample and small-sample formulas 
in each case.  Discuss your results. (Include at least answers to the 
following questions:  For each confidence level, which
interval is larger and why?  How do the intervals for
different confidence levels compare?)
\item{4)}  Next, determine a $85\%$ confidence interval for 
the variance $\sigma^2$ for the cholesterol data.
\bigskip
\noindent
B)  In deriving our formulas for the $(1-\alpha)\times 100\%$
confidence interval for the variance, 
we used an interval where the ``tails'' of the $\chi^2$-distributions
had equal probabilities (areas) $\alpha/2$.  That is in the general form
$$\sigma^2 \in \left[{(n-1)S^2\over b}, {(n-1)S^2\over a}\right]$$
to get a $(1-\alpha)\times 100\%$ confidence interval, we used:
$b = \chi^2_{\alpha/2}(n-1)$ and $a = \chi^2_{1-\alpha/2}(n-1)$,
where, as in the notation of the text book's $\chi^2$ tables,
$$P(Y \ge \chi^2_\beta) = \beta$$
if $Y$ has a $\chi^2$ distribution with some fixed number
of degrees of freedom.  This is something
of a {\it compromise} -- it gives a definite procedure to get
the confidence intervals, but it does not always give the 
{\it shortest possible confidence intervals}.   That is, we
can often get tighter bounds by selecting different $a,b$
in order to {\it minimize} the length of the interval
$$\left[{(n-1)S^2\over b}, {(n-1)S^2\over a}\right]$$
subject to the constraint that 
$$\int_a^b f(y)\ dy = 1 - \alpha,$$
where $f(y)$ is the $\chi^2(n-1)$ pdf.  
It turns out that finding the appropriate $a,b$ is equivalent to 
solving the two equations:
$$\eqalign{\int_a^b f(y)\ dy &= 1 - \alpha\cr
      a^{n/2}e^{-a/2} - b^{n/2}e^{-b/2} &=0 \cr}\leqno(2)$$
The following Maple procedure does this computation:
\bigskip
\leftline{\tt ShortestSigma2CI:=proc(alpha,n)}
\leftline{\tt local a,b,eq1,eq2,g,x,s;}
\leftline{\tt g:=x\^{}((n-1)/2-1)*exp(-x/2)/(2\^{}((n-1)/2)*GAMMA((n-1)/2));}
\leftline{\tt eq1:=int(g,x=a..b)=1-alpha;}
\leftline{\tt eq2:=evalf(a\^{}(n/2)*exp(-a/2)=b\^{}(n/2)*exp(-b/2));}
\leftline{\tt s:=fsolve({eq1,eq2},{a,b},{a=0..n-1,b=n-1..infinity});}
\leftline{\tt return s;}
\leftline{\tt end:}
\bigskip
\item{1)}  Enter this procedure into your worksheet and 
use it to determine the $a,b$ for the shortest confidence
$95\%$ intervals for the variance with $n = 3,4,5,6,7,8,9,10$.
Compare with the ``compromise'' intervals for this $\alpha$ and $n$.
How much are we gaining?  (Note:  $n$ is the number of samples here -- 
the corresponding $\chi^2$ distribution has $n - 1$ degrees of freedom.)
\item{2)}  {\bf Extra Credit}  Show that the solution of 
(2) above does give the minimum length interval.  {\it Hint:}
The constraint $\int_a^b f(y)\ dy = 1 - \alpha$ implies that 
you can think of $b$ as a function of $a$.  
\bigskip
\noindent
C)  (This one will require quite a bit of thought before you 
start plugging numbers into Maple.)  A group of pediatric nurses
were interested in the effect of prenatal care on the birthweight
of babies.  Mothers were divided into two groups, and their
babies' weights were compared.  The mothers in group 1
had 5 or fewer prenatal care sessions, and their
babies had birthweights:
$$49,108,110,82,93,114,134,114,96,52,101,114,120,116$$
(all in ounces).
The mothers in group 2
had 6 or more prenatal care sessions, and their
babies had birthweights:
$$133,108,93,119,119,98,106,87,153,116,129,97,110,131$$
(also in ounces).  One question they were trying to address
with this study was:  
\medskip
\noindent
{\it Was there more variation in the birthweights of the babies whose 
mothers had fewer prenatal care visits  than in 
the birthweights of the babies whose mothers had more visits?}
\bigskip
\item{1)}  Explain why $\theta = \sigma_1^2/\sigma_2^2$ is an
appropriate target parameter to consider, and 
why the statistic $\widehat{\theta} = S_1^2/S_2^2$ is a reasonable
estimator. 
\item{2)} What is the 
value of this statistic here, and what does it suggest?
\item{3)}  But now, the next question is:  How reliable is
that conclusion?  How likely is it that we could 
get a different conclusion for different random samples from the 
same distributions?  To answer this we can try to construct
a confidence interval for the ratio $\theta = \sigma_1^2/\sigma_2^2$.
To do this, explain why $(S_1^2/\sigma_1^2)/(S_2^2/\sigma_2^2)$
is an appropriate ``pivotal quantity'' to use to derive
confidence intervals for $\sigma_1^2/\sigma_2^2$.  Recall this means that:
\itemitem{$\bullet$}  $\sigma_1^2/\sigma_2^2$ must be the 
only unknown part and 
\itemitem{$\bullet$} the distribution of the pivotal quantity 
must be {\it known}.  
\item{3)}  Explain how to get a $(1-\alpha)\times 100\%$ confidence
interval for $\sigma_1^2/\sigma_2^2$, and use your method
to find a $95\%$ confidence interval for $\sigma_1^2/\sigma_2^2$
using the data above.  What does this suggest about your 
conclusion from part 2?

\bye