\magnification=\magstep1
\centerline{Mathematics 376 -- Mathematical Statistics}
\centerline{Solutions for Makeup Midterm Exam 2}
\centerline{April 26, 2012}
\bigskip
\noindent
I.  Let $Y_1,\ldots,Y_n$ be a random sample from a population
with density function
$$f(y|\theta) = \cases{{3\theta^3\over y^4} & if $0 < \theta \le y < \infty$\cr
                            0 & otherwise.\cr}$$
\item{A)} (10) Determine the method of moments estimator for
$\theta$.
\medskip
\item{} {\it Solution:}  Computing $E(Y)$ from this density, we find:
$$E(Y) = \int_\theta^\infty y \cdot {3\theta^3\over y^4}\ dy = {3\theta \over 2}.$$
For the method of moments, we set this equal to $\overline{Y}$, the first
sample moment, and solve for $\theta$:  
$$\widehat{\theta}_{MOM} = {2\overline{Y}\over 3}.$$
\item{B)} (10) Determine the maximum likelihood estimator for 
$\theta$.
\item{} {\it Solution:}  The likelihood function in this case is
$$L(y_1,\ldots,y_n \mid \theta) = {3^n \theta^{3n} \over 
(\prod_{i=1}^n y_i)^4 }\leqno(1)$$
As a function of $\theta$, neither this nor 
$$\ln(L) = n \ln(3) + 3n \ln(\theta) - 4\sum_{i=1}^n \ln(y_i)$$
has a critical point.  Both are strictly {\it increasing} as functions of 
$\theta$.
Therefore, we want to choose $\theta$ as large 
as possible, consistent with the 
sample values, in order to maximize $L$.  This occurs when $\theta = Y_{(1)}$,
the sample minimum.  Therefore  
$$\widehat{\theta}_{ML} = Y_{(1)}.$$
\item{C)} (5) Is $U = \sum_i \ln(Y_i)$ a sufficient statistic for $\theta$?
Why or why not?  
\item{} {\it Solution:}  The answer is {\it yes} by the factorization criterion.
From (1) above we have
$$L(y_1,\ldots,y_n\mid\theta) = {3^n \theta^{3n} \over e^{4U}} = g(U,\theta)$$
We can take the other factor $h(y_1,\ldots,y_n) = 1$.  
\bigskip
\noindent
II.  In this problem, let $S$ represent the proportion of women
who agree that men are basically selfish and egotistical.  
\bigskip
\item{A)} (15)  Suppose that surveys done 20 years ago showed that $S$ was 
$0.40$ at that time, but a new survey finds that $Y = 1260$ out of a random 
sample of $n = 3000$ women said that men are basically selfish and egotistical.
Is there sufficient evidence  to say the proportion $S$ has increased?  
Give the null and alternative
hypotheses for a suitable test, carry out the analysis, estimate the attained significance level ($p$-value) and state your
conclusion succinctly and clearly.  
\medskip
\item{} {\it Solution:} The wording of the question is supposed
to suggest using $H_0: S = .4$ and $H_a:  S > .4$.  Since $n = 3000$ is
large, we use a $Z$-test:
$$Z = {{1260\over 3000} - .4\over \sqrt{(.4)(.6)\over 3000}} = 2.236.$$
For the upper tail test, we would reject $H_0$ for any $\alpha$
with $z_\alpha \le 2.236$.  From the standard normal table, this 
says the $p$-value is about $.0125$.  There is 
relatively strong evidence to reject $H_0$.  
\medskip
\item{B)} (15) Suppose that the current value of $S$ is actually
$S = .43$.  How large would $n$ have to be in a sample like the 
one from part A to ensure that $\beta$ (the probability of 
a Type II error) is $.1$ or less?  
\medskip
\item{} {\it Solution:}  In terms of ${Y\over n}$, the rejection 
region for the test with $\alpha=0.05$ (and a general sample size $n$) is 
$$\left\{{Y \over n} > .4 + 1.645\sqrt{(.4)(.6)\over n}\right\}$$
Recall that $\beta$ is the chance of {\it not rejecting $H_0$} when
$H_0$ is false.  If $S = .43$, we start from 
$$P\left({Y\over n} \le .4 + 1.645\sqrt{(.4)(.6)\over n}\right)$$
and ``restandardize'' using $S = .43$:
$$\eqalign{
\beta &= 
P\left( {Y\over n} \le .4 + 1.645 \sqrt{(.4)(.6)\over n} \right)\cr
&= P\left({ {Y\over n} - .43\over \sqrt{(.43)(.57)\over n} } 
\le {-.03 + 1.645 \sqrt{(.4)(.6)\over n} \over \sqrt{(.43)(.57)\over n} } \right)\cr
&= P\left(Z \le {-.03 + 1.645 \sqrt{(.4)(.6)\over n} \over \sqrt{(.43)(.57)\over n} } \right) \cr
}$$
To get this to be $.1$, we want 
$$ {-.03 + 1.645\sqrt{(.4)(.6)\over n} \over \sqrt{(.43)(.57)\over n}} \doteq -1.28$$
so 
$$\sqrt{n} = {1.645\sqrt{(.4)(.6)} + 1.28 \sqrt{(.43)(.57)} \over .03} \doteq 47.98$$
so $n \ge 2303$ will do.  (In other words, the test with $n = 3000$ will 
already have $\beta$ this small(!).)
\bigskip
\noindent
III.  Assume that the hardness of iron bars produced by one
plant is normally distributed with mean $\mu$
and variance $\sigma^2$.  A random sample of $n = 7$ bars 
from the output of the plant is measured to determine whether the average
hardness meets the desired figure $\mu_0 = 172$. 
\medskip
\item{A)} (20)  The following measurements:
$$167, 174, 179, 164, 163, 160, 168$$
were obtained.  Test $H_0 : \mu = 172$ versus the alternative 
$H_a : \mu < 172$
using an appropriate test with $\alpha = .01$. 
\medskip 
\item{} {\it Solution:}  Since $n < 30$, we must use a $t$-test here.
We have $\overline{Y} \doteq 167.86$ and $S^2 \doteq 43.81$.  We have
$$t = {167.82 - 172\over \sqrt{43.81\over 7}} \doteq -1.66$$
The rejection region for the test is determined from the $t$-table.  The 
form of the alternative hypothesis indicates we want 
$$RR = \{t \mid t < -t_{.01}\} = \{t \mid t < -3.143\}$$
(for 6 df).  There is not sufficient evidence to reject $H_0$ here. 
\medskip 
\item{B)} (10)  How is your answer from A related to the $99\%$ lower
confidence bound for $\mu$ that we learned to compute in the first
section of the course?
\medskip
\item{} {\it Solution:}  The $99\%$ lower confidence bound would be 
$$167.82 - 3.413 \sqrt{43.81\over 7} = 167.82 - 8.54 = 159.28$$
The value $\mu_0 = 172$ is one of the numbers in the interval $(159.28,\infty)$, so it is a ``believable'' value for $\mu$ based on the data. Alternatively, the rejection 
region for the test consists of all numbers less than
$$172 - 3.413 \sqrt{43.81\over 7} = 159.28$$
Since the sample $\overline{Y}$ is in this interval we do not reject $H_0$.     
\bigskip
\noindent
IV.  (15) Let $(x_i,y_i,z_i)$, $i = 1, \ldots, n$ be a collection of
data points.  Using the matrix formulation, derive the normal equations
for the least squares estimators for the coefficients
$\beta_0,\beta_1,\beta_2,\beta_3$ in the model $Z = \beta_0 + \beta_1 x + \beta_2 x^2 + \beta_3 y + \varepsilon$
fitting the data.  Express in the form $A\beta = b$ where $A$ is 
a matrix and $b$ is a vector (not matrix products).   
\medskip
\item{} {\it Solution:}  The normal equations are $X^tX \beta = X^t Z$ where
$$X = \pmatrix{1 & x_1 & x_1^2 & y_1 \cr
               \vdots & \vdots & \vdots &\vdots \cr
                1 & x_n & x_n^2 & y_n\cr}\quad  {\rm and } \quad Z = \pmatrix{z_1 \cr \vdots\cr z_n\cr}$$
Hence the normal equations can be written in matrix form as
$$\pmatrix{n & \sum_i x_i & \sum_i x_i^2 &\sum_i y_i\cr
           \sum_i x_i & \sum_i x_i^2 & \sum_i x_i^3 & \sum_i x_iy_i\cr
           \sum_i x_i^2 & \sum_i x_i^3 & \sum x_i^4 & \sum_i x_i^2 y_i\cr
           \sum_i y_i & \sum_i x_i y_i & \sum_i x_i^2 y_i & \sum_i y_i^2\cr} 
\pmatrix{\widehat{\beta_0}\cr \widehat{\beta_1}\cr\widehat{\beta_2} \cr \widehat{\beta_3}\cr} 
= \pmatrix{\sum_i z_i \cr \sum_i x_i z_i \cr \sum_i x_i^2 z_i \cr \sum_i y_i z_i\cr} 
$$             
\bigskip
\noindent
{\it Extra Credit ``Thought Questions'' -- Answer in 2 or 3 complete sentences:}
\bigskip
\item{A)} (5)  Exactly why is it the case that
a $Z$-test is not appropriate
when the sample size is small and population variance is not
known exactly?  Explain using the case of a test on a single mean.
\medskip
\item{} {\it Solution:}  The reason is because of the distribution
of the {\it test statistic} we can compute from the data.  Under
the assumption that the data comes from a normal population, we
would estimate $\mu_0$ by $\overline{Y}$ and $\sigma$ by $S$.  
So we would use 
$$t = {\overline{Y} - \mu_0 \over {S\over \sqrt{n}}}$$
to carry out this sort of test.  
If the $S$ was the population SD, $\sigma$, then (under $H_0: \mu = \mu_0$) 
this would have a standard normal
distribution and the $Z$-test would be appropriate.  However, with
the sample SD  ($S$) estimating $\sigma$, this statistic
actually has a $t$-distribution with $n-1$ df, so rejection 
regions set up using the standard normal would not give enough 
area in upper and lower tails to account for the variability of $t$.  
\medskip
\item{B)} (5)  For the basic small-sample test for equality of means,
we need to assume the two samples came from normal populations
with equal variances.  How would you determine whether applying
that test was appropriate?
\medskip
\item{} {\it Solution:}  Say we observe a test statistic value
$Z = z_{obs}$ in a $Z$-test. The $p$-value for the 2-tail test would
be twice as large as the $p$-value for either 1-tail test.  The
reason is that ``more extreme'' values of  in the 2-tail test
would be $Z > z_{obs}$ or $Z < -z_{obs}$.  
\bye
