
\documentclass[twocolumn]{article}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}
\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\usepackage{listings}

\begin{document}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: {\bf Work only on this sheet} (on both sides, if needed); do
not turn in any supplementary sheets of paper. There is actually plenty
of room for your answers, as long as you organize yourself BEFORE
starting writing.

{\bf 1.} (25) Suppose we are studying children's growth patterns, and
have data on $H_1$, $H_2$ and $H_3$, heights at ages 6, 10 and 18.
We're interested in the growths between 6 and 10, and between 10 and 18,
denoted by $G_1$ and $G_2$, respectively.  Suppose we know the
covariance matrix $C_H$ of $(H_1,H_2,H_3)'$.  (Assume this to be the
population covariance matrix.)  Give a {\it matrix} expression for the
covariance matrix of $(G_1,G_2)'$.

{\bf 2.} (25) Consider a toy example in which we take a random sample of
size 2 (done with replacement) from a population of size 2.  The two
values in the population (say heights in some measure system) are 40 and
60.  Find $p_{s^2}(100)$.  Express your answer as a single common
fraction, reduced to lowest terms, but {\bf SHOW YOUR WORK}.

{\bf 3.} (25) Write an R function {\bf bhatcorr(lmobj,i,j)} to act on an
object {\bf lmobj} that is returned by {\bf lm()}, with {\bf i} and {\bf
j} being subscripts of elements of $\widehat{\beta}$.  The function
returns the value of 

$$
\widehat{\rho}(\widehat{\beta}_i, \widehat{\beta}_j)
$$

that is, the estimated correlation between $\widehat{\beta}_i$ and
$\widehat{\beta}_j$.

{\bf 4.} (25) Consider the example of seek time on p.123.  Let $S =
|X-Y|$.  Find $f_S(v), 0 < v < 1$.  Note:  Recall that $\int \int_A 1 ~
ds dt = \textrm{ area(A)}$.

\onecolumn

{\bf Solutions:}

{\bf 1.}  

$$
\left (
\begin{array}{rrr}
-1 & 1 & 0 \\
0 & -1 & 1 \\
\end{array}
\right )
C_H
\left (
\begin{array}{rr}
-1 & 0 \\
1 & -1 \\
0 & 1 \\
\end{array}
\right )
$$

{\bf 2.}  Easiest to use (7.18) here.  The only way we can get 100 is to
sample 40 then 60 or vice versa.  The probability is then $2 \cdot
(\frac{1}{2})^2 = \frac{1}{2}$.

{\bf 3.} 

\begin{lstlisting}
bhatcorr <- function(lmobj,i,j) {
   covmat <- vcov(lmobj)
   vari <- covmat[i+1,i+1]
   varj <- covmat[j+1,j+1]
   covij <- covmat[i+1,j+1]
   return(covij/sqrt(vari*varj)
}
\end{lstlisting}

{\bf 4.}

\begin{eqnarray}
P((X-Y| < v) &=& P(-v < X-Y < v) \\ 
&=& 1 - (1-v)^2
\end{eqnarray}

So, $f_S(v) = 2(1-v)$.

\end{document}


