\magnification=\magstep1
\centerline{Mathematics 376 -- Mathematical Statistics}
\centerline{Solutions for Final Examination}
\centerline{May 16, 2012}
\bigskip
\noindent
I.  Let $X_1,X_2,X_3,X_4,X_5$ be a random sample from a normal 
distribution with mean $\mu = 6$ and variance $\sigma^2 = 81$.
\bigskip
\item{A)}  What is the distribution (give the type and all relevant parameter values) of 
$U = {(X_1 - 6)^2 + (X_2 - 6)^2 + (X_3 - 6)^2 + (X_4 - 6)^2\over 81}$?  Why?
\medskip
\item{} {\it Solution:}  For each $i$, ${X_i - 6\over 9}$ has a standard normal distribution.
Therefore 
$$U = \left({X_1 - 6\over 9}\right)^2 + 
\left({X_2 - 6\over 9}\right)^2 + \left({X_3 - 6\over 9}\right)^2 + \left({X_4 - 6\over 9}\right)^2$$
is the sum of the squares of four independent standard normals.  So $U$ has 
a $\chi^2$ distribution with $4$ degrees of freedom.
\medskip
\item{B)}  What is the distribution (give the type and all relevant parameter
values) of $V = {2(X_5 - 6)\over 9\sqrt{U}}$?  Why?
\medskip
\item{} {\it Solution:}  We have 
$$V = {{X_5 - 6\over 9} \over \sqrt{U/4}}$$
This has the form of a standard normal, divided by the square root of a $\chi^2$, divided
by its number of degrees of freedom.  So, by definition, 
$V$ has a $t$-distribution with $4$ degrees of freedom.
\item{C)} (10) What is the distribution (give the type and 
all relevant parameter values) of 
$W = (X_1 - 6)^2/(X_2 - 6)^2$?
Why? 
\medskip
\item{} {\it Solution:}  We have 
$$W = {\left({X_1 - 6\over 9}\right)^2\over \left({X_2 - 6\over 9}\right)^2}$$
This is a ratio of $\chi^2(1)$ random variables.  Hence $W$ has an $F$-distribution
with 1 degree of freedom in the numerator and 1 degree of freedom in the denominator.  
\bigskip
\noindent
II.  A random variable $Y$ has pdf of the form 
$$f(y) = \cases{ {2y \over \alpha} e^{-y^2/\alpha} & if $y \ge 0$ \cr
                          0 & otherwise\cr}$$
(This is a particular case of a {\it Weibull} distribution; these are often
used to model length of life of mechanical components and living organisms.)
Let $Y_1, \ldots, Y_n$ be a random sample from this distribution with unknown
$\alpha$.
\medskip
\item{A)}  Find the maximum-likelihood estimator for $\alpha$.
\medskip
\item{} {\it Solution:}  The likelihood function is
$$L(y_1,\ldots,y_n\mid\alpha) = {2^n \prod_i y_i\over \alpha^n} e^{-\left(\sum_i y_i^2\right)/\alpha}$$
so 
$$\ln(L) = \ln(2^n \prod_i y_i) - n\ln(\alpha) - {\sum_i y_i^2 \over \alpha}.$$
First, let us see if $\ln(L)$ has any critical points as a function of $\alpha$:
$$0 = {d\over d\alpha}\ln(L) = {-n\over \alpha} + {\sum_i y_i^2 \over \alpha^2}$$
when 
$$\alpha = {1\over n} \sum_{i=1}^n y_i^2$$
It is easy to check that the second derivative is negative here, so the maximum-likelihood
estimator for $\alpha$ is 
$$\widehat{\alpha} = {1\over n} \sum_{i=1}^n y_i^2.$$
(Note that this is the second sample moment.  In fact the {\it variance} of $Y$
is a constant multiple of $\alpha$.)
\medskip
\item{B)}  What is the pdf for the sample maximum, $Y_{(n)}$? 
\medskip
\item{}  By integration (substitution with $u = y^2$), we see the cdf for this distribution is 
$$F(y) = - e^{-y^2/\alpha} + c$$
for some constant of integration $c$.  At $y = 0$ we should get $F(0) = 0$, so $c = 1$.
Hence by the usual formula, the pdf for the sample maximum is  
$$f_{n}(y) =  n\left(1 - e^{-y^2/\alpha}\right)^{n-1} {2y \over \alpha} e^{-y^2/\alpha}.$$

\noindent
III.   Let $p$ be the proportion of letters mailed in Belgium
that are delivered the next day.
\bigskip
\item{A)} A random sample of $n = 400$ letters is selected for
tracking and $373$ of those are delivered the next day.  Find an approximate 98\% confidence
interval for $p$ based on this sample. 
\medskip
\item{} {\it Solution:}  We have $\widehat{p} = 373/400 = .9325$.  Since
$400 > 30$, to get a $98\%$ confidence interval we can use the 
large sample two-sided formulas with $\alpha = .01$.  The confidence interval is
$$\eqalign{\widehat{p} \pm z_{.01} \sqrt{\widehat{p}(1 - \widehat{p}) \over 400}
&\doteq .9327 \pm 2.33 \cdot .0125\cr
&\doteq  (.9033, .9617)\cr}$$
All values in this interval are thought of as ``reasonable estimates'' for the 
proportion $p$.  Since $p = .85$ is {\it not contained}, the answer to the last
part is {\it no}.  
\medskip
\item{B)} (15)  (``Thought question'')  Note that part A says
``approximate.''  What is the actual distribution of $Y = $
the number of letters delivered the next day (out of a random sample of 
size $n = 400$)?  Why does the method you used in part A give a reasonable 
interval estimate for $p$?  Explain.
\medskip
\item{} {\it Solution:}  $Y$ has a {\it binomial} distribution with $n = 400$, and
$p = $ the actual proportion of letters delivered the next day.  An ``exact'' 
confidence interval would use information about that binomial distribution
to develop the locations of the endpoints.  The method we used in part A
depends on the properties of the standard normal distribution.  That is
reasonable here since the Central Limit Theorem implies that ${Y\over 400}$
has an approximately normal distribution.  (Recall that the estimator
${Y\over 400}$ for $p$ can be thought of as a sample mean for $400$ independent
Bernoulli trials, all with success probability $p$, 
so the CLT applies in the form we discussed last semester.) 
\bigskip
\noindent
IV.  The fill weights of a random sample of $n_1 = 13$
boxes of Twigs and Nuts Extra Crunchy Granola produced at Plant 1
had a mean of $20.5$ ounces and standard deviation 
$s = .1$ ounce.  A similar sample of size $n_2 = 11$ 
produced at Plant 2 had mean fill weight $20.3$ ounces and  
standard deviation $s = .083$ ounce.
\bigskip
\item{A)} (20)  Is there sufficient evidence at the $\alpha = .01$
level to conclude that the variances of 
the fill weights at the two plants
are different?
\medskip
\item{} {\it Solution:}  To test for equality of variances, we want to 
use an $F$-test.  The null hypothesis is $H_0 : \sigma_1^2 = \sigma_2^2 = \sigma^2$ and
the alternative is $H_a : \sigma_1^2 \ne \sigma_2^2$.  Under $H_0$, the
test statistic
$$F = S_1^2/S_2^2\quad ({\rm which\ equals\ } {(12 S_1^2/\sigma^2)/12 \over (10 S_2^2/\sigma^2)/10}\ )$$
has an $F$-distribution with 12 degrees of freedom in the numerator and
10 degrees of freedom in the denominator.  For a test with $\alpha = .01$, we
want to set the rejection region to be
$$\{F \mid F > f_{.005}(12,10)\} \cup \{F \mid 0 < F < f_{.995}(12,10) = {1\over f_{.005}(10,12)}\},$$
which works out to the union
$$(5.66,+\infty) \cup (0,.1964)$$
Our test statistic value is
$$F = (.1)^2/(.083)^2 \doteq 1.45$$
This is not in the rejection region, so we {\it do not} reject $H_0$.  
\medskip
\item{B)} (20)  Is there sufficient evidence to conclude
that the mean fill weights are different?
Report the results by giving an estimate of the $p$-value of your test.
\medskip
\item{} {\it Solution:}  Because we did not find evidence to conclude
the variances were different, we will use the basic small-sample
$t$-test for equality of means (two-tailed version).  
The pooled estimator for the variance is
$$S^2 \doteq {(12)(.1)^2 + (10)(.083)^2\over 22} = .008586$$
This gives $S \doteq .0927$.  Our test statistic is 
$$t = {20.5 - 20.3 \over .0927\sqrt{1/13 + 1/11}} \doteq  5.27$$
From the $t$-table, for $22$ degrees of freedom, we have $t_{.005} = 2.819$.
We can say $p < 2\cdot (.005) = .01$.  So there is relatively strong
evidence to conclude that {\it the mean fill weights are different}.  
(Using {\tt R}, in fact the $p$ value is quite a bit smaller even than
that:  $p \doteq .000028$.)
\bigskip
\noindent
V. The following table gives measurements of water depth
remaining in an evaporating reservoir as a function of time:
$$\matrix{
x {\rm\ time\ (weeks)} & y {\rm\ depth\ (meters) }\cr
      1              &       19.8\cr
      4              &       16.5\cr
      14             &       12.8\cr
      32             &       8.1\cr
      52             &       7.5\cr}$$
\item{A)}  (20)  Find the least-squares estimators for the coefficients
$\beta_0, \beta_1$ in a model $Y = \beta_0 + \beta_1 x + \varepsilon$ for this data set.
\bigskip
\item{} {\it Solution:}  Organizing the calculation the way we discussed
in class,
$$\eqalign{\overline{x} &= 20.6\cr
           S_{xx} &= 1819.2\cr
           \overline{y} &= 12.94\cr
           S_{xy} &= -418.62\cr
           \widehat{\beta_1} &= {S_{xy}\over S_{xx}} \doteq -0.23\cr
           \widehat{\beta_0} &= \overline{y} - \widehat{\beta_1} \overline{x}\cr
                             &\doteq 17.68\cr}$$
So the estimated model would be
$$ Y = 17.68 - .23 x + \varepsilon $$
\item{B)}  (20)  Is there sufficient evidence to say
that $\beta_1 < -0.1$?  Test with $\alpha = .05$.
\medskip
\item{} {\it Solution:}  This is a lower-tail $t$-test with a null hypothesis
saying $\beta_1 = -0.1$ (or something larger).  The test statistic is 
$$t = {\widehat{\beta_1} - (-.1)\over S\sqrt{c_{11}}}$$
So we need to compute additionally
$$\eqalign{
S_{yy} &= 112.772\cr
S^2 &= {1\over 5 - 2}\left(S_{yy} - \widehat{\beta_1} S_{xy}\right) \doteq 5.48\cr
S &= \sqrt{5.48} \doteq 2.34118\cr
c_{11} &= {1\over S_{xx}} \doteq .0005497\cr}$$
So then
$$t = {(-.23) + .1\over (2.34118)\sqrt{.0005497}} \doteq -2.368$$
For $n - 2 = 3$ degrees of freedom, $-t_{.05} = -2.353$.  We are (just barely!) in
the rejection region, so we would say that there is enough evidence
to conclude $\beta_1 < -0.1$.  
\bigskip
\noindent
VI.  (20) Suppose we have measurements taken from a normal population with
unknown $\mu$ and known $\sigma^2$.  We test $H_0 : \mu = \mu_0$
versus $H_a : \mu > \mu_0$ using a $Z$-test 
and a rejection region designed to produce a Type I error
probability $\alpha$.   Show that in order to make the Type II
error probability equal a given $\beta$ when $\mu$ is equal to some $\mu_a > \mu_0$, 
the sample size should be selected as follows:
$$n \ge {(z_\alpha + z_\beta)^2 \sigma^2 \over (\mu_a - \mu_0)^2}.$$
\item{} {\it Solution:}  To get a given Type I error probability, $\alpha$, 
we make the rejection region for the upper tail test
$$RR = \{Z \mid Z > z_\alpha\} \leftrightarrow \left\{\overline{Y} > \mu_0 + z_\alpha \cdot {\sigma\over \sqrt{n}}\right\} $$
Now, assuming the actual population mean is $\mu_a$, to compute the Type II error
probability, we consider the case where we would fail to reject $H_0$, but
where $H_0$ is actually false.  That is we want the following: 
$$\eqalign{
\beta &= P\left(\overline{Y} \le \mu_0 + z_\alpha \cdot {\sigma\over \sqrt{n}}\right)\cr
&= P\left({\overline{Y} - \mu_a \over \sigma/\sqrt{n}} \le {(\mu_0 -\mu_a) \over \sigma/\sqrt{n}} + z_\alpha \right)\cr}$$
Since we have ``restandardized'' in the last equation, to get the probability to 
equal $\beta$, the right side of the 
inequality should be 
$${(\mu_0 -\mu_a) \over \sigma/\sqrt{n}} + z_\alpha = -z_\beta$$
This rearranges to 
$$\sqrt{n} = {(z_\alpha + z_\beta)\sigma \over (\mu_a - \mu_0)}$$
and we get the desired equality after squaring.  
\bigskip
\noindent
{\it Extra Credit}
\bigskip
A New York Times/CBS poll conducted between April 5 and April 12, 2010 
included the question ``Do you approve or disapprove of the way your 
Representative in Congress is handling his or her job?''  The poll was 
carried out in two stages.  First a large national 
simple random sample was asked the question.  The results were reported
in three categories:
$46\%$ of respondents said they approved, $36\%$ said they disapproved, and
$18\%$ said they had no opinion. 
Then the same question was asked of a separate sample of $n = 881$ people, 
all of whom had identified themselves as supporters of the ``Tea Party'' 
movement.  The responses broke down like this in the same 
three categories:
$$\matrix{ & {\rm Approve} &  {\rm Disapprove}  & {\rm No\ opinion} \cr
{\rm Tea\ Party\ Sample} &   352   &   432   &   97 \cr}$$
(Data is adapted from the New York Times web site.)  It seems from the numbers that 
``Tea Party'' supporters may differ from the general population when it comes to
their opinions concerning their Congressional Representatives.  
But is this a real difference, or could it just be a product of chance
variation in the sampling process?   

We did not discuss this in class, but a standard statistical
method in this case would be to use a $\chi^2$-test.  The test statistic
$$X^2 = \sum_{\rm categories} {\left({\rm observed} - {\rm expected}\right)^2 \over {\rm expected}}$$
has approximately a $\chi^2$ distribution with degrees of freedom one less
than the number of categories.  For a test of $H_0:$ the distributions are
really the same, versus $H_a:$, we would reject $H_0$ if $X^2$ fell in 
an upper tail rejection region.
\bigskip
\item{A)} (5)  If the ``Tea Party'' sample did follow the national sample
percentages, how many responses would we expect in each category?
\medskip
\item{} {\it Solution:}  If the ``Tea Partiers'' were really the same as the general
population in this regard, then the expected numbers of people in the 
Approve, Disapprove, and No opinion categories would be:
$$.46 \times 881 \doteq 405.3, \quad .36 \times 881 \doteq 317.2, \quad
.18 \times 881 \doteq 158.6.$$
\item{B)} (15)  Carry out the $\chi^2$ test and interpret the results.
\medskip
\item{} {\it Solution:}  
We compute the $X^2$ statistic using the entries from the table above for the observed:
$$\chi^2 = {(352-405.3)^2 \over 405.3} + {(432 - 317.2)^2 \over 317.2} + 
{(97 - 158.6)^2 \over 158.6} 
\doteq 72.5.$$
From the $\chi^2$ table with $2$ degrees of freedom, we see that $p < .005$.
This is extremely strong evidence that ``Tea Partiers'' have a 
different set of opinions on this question.  (They are much less likely to approve, and
also much less likely not to have an opinion!) 
\bye
