\documentclass[notitlepage,12pt]{article}
%twocolumn
\usepackage{epsfig}
\usepackage{fullpage,psfrag}
\usepackage{graphicx}
\usepackage{color}
\usepackage{subfigure}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{geometry}
%\usepackage{endfloat}
\usepackage{hyperref}


%\usepackage{loflot}
%\setstretch{0.8}

\textheight 8
in \oddsidemargin 0.03in \textwidth 6.0in
 \topmargin -.25in
\parskip .1in


\usepackage{natbib}

%\newcommand{\xv}{\mbox{\boldmath$x$}}
%\newcommand{\uv}{\mbox{\boldmath$u$}}
%\newcommand{\xiv}{\mbox{\boldmath$\xi$}}

\begin{document}
%\pagestyle{empty}

\begin{center}
FALL 2009\\
Stat 849: Homework Assignment 3\\
Due: October 30, 2009 \\
Total points = 300\\
\end{center}

\begin{enumerate}
\item A recent research topic in the treatment of HIV is to
determine whether the genotype of a patient's HIV virus can be
used to decide on what type of treatment a patient should receive
if the patient is failing his/her current therapy. For this
purpose, a scoring system called "Genotypic Sensitivity Score
(GSS)" has been developed.  The data  are available in
\texttt{hmw3q1\_data.txt} on the course website. The first column
represents the GSS and the second column is the patient viral load
(VL), that measures the amount of virus in the blood, at a future
time point.
\begin{enumerate}
\item Plot the data. Do you think it is worth while to test for
the presence of outliers? If yes, proceed with the test.

\item If you identified any outliers in the above step, remove
them from the data. Fit a simple linear regression model with VL
as the outcome and GSS as the predictor.

\item Does the data (possibly with outliers removed) satisfy the
usual regression assumptions? Provide supporting diagnostic plots.

\item Can you think of a transformation to apply for the linear
model assumptions to be satisfied? If yes, reanalyze the data
after transformation.
\end{enumerate}


\item In a small scale experimental study of the relation between
degree of brand liking and moisture content and sweetness of the
product, data were collected on 16 subjects. These data are
available in  \texttt{brand\_preference.txt}.

\begin{enumerate}
\item Provide various useful plots of these data (scatter plots
etc...).  What information can you gather from these plots?

\item Fit a linear regression model to these data. What are the
estimated coefficients and standard errors of these estimates? How
is the coefficient in front of moisture content interpreted?

\item Investigate the residual plots. How well are the
Gauss-Markov assumptions  satisfied? Comment on anything unusual
you see.

\item Prepare and added variable plot for each of the predictor
variables (you might find \texttt{av.plot} of the \texttt{cars}
package useful).

\item
Do your plots in part (d) suggest that the regression
relationship in the fitted regression function $ Y \sim X_1 + X_2$
(part b) are inappropriate for any of the predictor
variables? Explain.

\item Obtain the studentized deleted residuals and identify any
outlying $Y$ observations. Use the outlier test with $\alpha =
0.10$. State the decision rule and conclusion.

\item Are any of the observations outlying with regard to their
$X$ values?

\item Calculate Cook's distance for each case and prepare an index
plot. Are any cases influential according to this measure?

\end{enumerate}

\item \textit{[Two-way ANOVA]} A research laboratory was
developing a new compound  for the relief of severe cases of hay
fever. In an experiment with 36 volunteers, the amounts of the two
active ingredients (factors A and B) in the compound were varied
at three levels each and volunteers were assigned to each of the
nine treatments randomly. The data are available in
\texttt{hayfever.txt} on the course website.
\begin{enumerate}
\item Fit the two way ANOVA model, including interactions. What is
the estimated mean when factor A is 2 and factor B is 3?

\item Using appropriate diagnostic plots, check whether there is
any violation of normality.

\item Create a plot with factor A  on the x-axis, and, using 3
plotting symbols, the mean for each level of factor B above each
level of factor A. Do you think there are any interactions?

\item Test for an interaction at level $\alpha = 0.05$.

\item Test for main effects of factors A and B.

\end{enumerate}

\item Verify the following properties of the residual vector
$\hat{\epsilon}$.

\begin{enumerate}
\item  $E(\hat{\epsilon}) = 0$.

\item $\mbox{cov}(\hat{\epsilon}) = \sigma^2(I-H)$.

\item $\mbox{cov}(\hat{\epsilon}, Y) = \sigma^2(I-H)$.

\item $\mbox{cov}(\hat{\epsilon}, \hat{Y}) = 0$.

\item $\frac{1}{n}\sum_{i=1}^n\hat{\epsilon}_i = 0.$

\item $\hat{\epsilon}'Y = Y'(I-H)Y$.

\item $\hat{\epsilon}'\hat{Y} = 0$.

\item $\hat{\epsilon}'X = 0'$.
\end{enumerate}

\item Consider the following regression model
\[ Y_i = \beta_0 + \beta_1X_{i1} + \beta_2X_{i2} + \epsilon_i,\]
and the transformation
\[ Y_i^* = \beta_1^*X_{i1}^* + \beta_2^*X_{i2}^* + \epsilon_i^*,\]
where

\[Y_i^* = \frac{1}{\sqrt{n-1}} \left ( \frac{Y_i -
\bar{Y}}{s_Y}\right) , \quad X_{ik}^* = \frac{1}{\sqrt{n-1}} \left (
\frac{X_{ik} - \bar{X}_k}{s_{X_k}}\right ), \quad k = 1, 2, \] where
$s_Y$ and $s_{X_k}$ represent the respective standard deviations.

\begin{enumerate}

\item Show that

\[\sigma^2_{\beta_1^*}  = \sigma^2_{\beta_2^*} =
\frac{\sigma*^2}{1-r_{12}^2},\] where $\sigma*^2$ is the error term
variance for the transformed model and $r_{12}$ is correlation
between the predictors $X_1$ and $X_2$.

\item What can you say about the effect of intercorrelations among
the predictor variables on the estimated regression coefficients?

\end{enumerate}

\item The 6 observations made are the non-blank entries in the
following incomplete two-way layout:
\begin{center}
\begin{tabular}{llll}
 & B1 & B2 & B3 \\
 A1 & $y_{11}$ & $y_{12}$ & \\
 A2 & $y_{21}$ & & $y_{23}$\\
 A3 &          & $y_{32}$ & $y_{33}$ \\
\end{tabular}
\end{center}

Consider the following Gaussian linear model which assumes that the
observed $\{y_{ij}\}$ are independent random variables such that
$y_{ij} \sim N(\eta_{ij}, \sigma^2)$ with
\[\eta_{ij} = a_i + b_j,\]
for every observed pair $(i, j)$. The values of the real-valued
parameters $\{a_i:1 \le i \le 3\}$ and $\{b_j: 1 \le j \le 3\}$ and
the value of $\sigma^2>0$ are unknown.

\begin{enumerate}
\item Let $\beta = (a_1, a_2, a_3, b_1, b_2, b_3)'$. Let $y$ be the
vector of the observed $y_{ij}$, taken in order: $y = (y_{11},
y_{12}, y_{21}, y_{23}, y_{32}, y_{33})'$ and let $\eta = E(y)$
under the above linear model. Find the matrix $X$ such that $\eta =
X\beta$. Find rank($X$).



\item Consider the following Theorem:

\textbf{Theorem.} In the model $y = X\beta+\epsilon$, where $E[y] =
X\beta$ and $X$ is $n \times p$ of rank $k <p \le n$, the linear
function $\lambda'\beta$ is estimable if and only if any of the
following conditions hold:

\begin{enumerate}
\item $\lambda'$ is a linear combination of the rows of $X$, that
is, there exists a vector $a$ such that
\[a'X = \lambda'.\]

\item $\lambda'$ is a linear combination of the rows of $X'X$ or
$\lambda$ is a linear combination of the columns of $X'X$, that is,
there exists a vector $r$ such that
\[r'X'X = \lambda' \quad \mbox{or} \quad  X'Xr = \lambda.\]

\item $\lambda$ or $\lambda'$ is such that
\[X'X(X'X)^{-}\lambda =\lambda \quad \mbox{or} \quad \lambda'(X'X)^{-}X'X = \lambda',\]
where $(X'X)^-$ is any generalized inverse of $X'X$.
\end{enumerate}


%Show that the parametric function $\psi= \lambda'\beta$, where
%$\lambda$ is a $6 \times 1$ vector, is linearly estimable if and
%only if
%\begin{eqnarray*}
%\left ( \begin{array}{llllll}
% 1 &1 &1 &-1 &-1 &-1  \\
% 1 &1 &1 &-1 &-1 &-1  \\
% 1 &1 &1 &-1 &-1 &-1  \\
% -1& -1& -1& 1& 1& 1 \\
% -1& -1& -1 &1& 1 &1\\
% -1& -1& -1 &1& 1& 1\\
%\end{array} \right )\lambda = 0.
%\end{eqnarray*}

Show that components of $\beta$ are not estimable.

\item Show that $\psi_1 = a_1-a_2$ and $\psi_2 = a_1 + a_2 - 2a_3$
are both linearly estimable.

\end{enumerate}

\end{enumerate}

\end{document}
