\documentclass[11pt]{article} 
%\usepackage{amsbsy} % for \boldsymbol and \pmb 
\usepackage{graphicx} % To include pdf files!
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amsfonts}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} % For links
\usepackage{fullpage}
\topmargin=-.3in
\textheight=9.4in
%\pagestyle{empty} % No page numbers


\begin{document}
%\enlargethispage*{1000 pt} 

\begin{center}   
{\Large \textbf{STA 2101/442 Assignment Eleven}}\footnote{Copyright information is at the end of the last page.}
\vspace{1 mm}
\end{center}

\vspace{3mm}

\begin{enumerate} 

\item \label{ncp} Let $\mathbf{Y} \sim N_p(\boldsymbol{\mu},\boldsymbol{\Sigma} )$. Show that $W = \mathbf{Y}^\top \boldsymbol{\Sigma}^{-1}\mathbf{Y}$ has a non-central $\chi^2$ distribution. What are the degrees of freedom? What is the non-centrality parameter $\lambda$? Use the formula sheet. The lecture slides will help with this question. 

\item Recall the ``Wald-like" tests based on the Central Limit Theorem:
\begin{displaymath}
        W_n = n\left(\mathbf{L}\overline{\mathbf{X}}_n - 
        \mathbf{h}\right)^\top
        \left(\mathbf{L} \widehat{\boldsymbol{\Sigma}}_n \mathbf{L}^\top\right)^{-1}
                      \left(\mathbf{L}\overline{\mathbf{X}}_n - 
        \mathbf{h}\right)
\end{displaymath}
When the null hypothesis is false, the test statistic has an approximate non-central chi-squared distribution. Based on your answer to Question~\ref{ncp}, what is the non-centrality parameter?  



\item Remember the rotten potato example of factorial ANOVA. It was a $2 \times 3$ design with nine cases per treatment combination. Suppose the true value of $\sigma^2 = 16$, and the true expected values are as follows:
\begin{verbatim}
                            Bact1     Bact2    Bact3
                    Cool      4         4        12  
                    Warm      5         5        14
\end{verbatim}
    \begin{enumerate}
        \item For $n=54$, what is the power to detect the main effect of temperature?
        \item Still maintaining equal sample sizes, what minimum total sample size is required so that the test of the main effect for temperature will have a power of at least 0.8?
        \item For $n=54$, what is the power to detect the main effect of bacteria type?
        \item Still maintaining equal sample sizes, what minimum total sample size is required so that the test of the main effect for bacteria type will have a power of at least 0.8?
        \item For $n=54$, what is the power to detect the interaction of temperature and bacteria type?
        \item Still maintaining equal sample sizes, what minimum total sample size is required so that the test of the interaction will have a power of at least 0.8?
        \item For $n=54$, what is the power to detect an effect of bacteria type at cool temperatures?
    \end{enumerate}

% Buried in all those tests of special contrasts was a test of equality of three Bacteria means at cool temperature. Suppose the means for Bacteria types 1 and 2 were equal, but the mean for Bacteria type 3 was one-half standard deviation lower.
% Get phi = n/6 ... p=6, r=2
% > phi=9
% > 1 - pf(qf(0.95,2,48),2,48,phi)
% [1] 0.7425811
% > fpow2(6,2,effsize=9/54)
% [1] 62
% 62 -> 66


\item Again for the rotten potato experiment, what sample size is required to reject the null hypothesis of no interaction, if the interaction explains 10\% of the remaining sample variation in mean rot?

\end{enumerate}

\vspace{5mm} 

\noindent
Please use R and bring your printout to the quiz. You may use my R functions if you wish. There are links from the course home page.


\noindent
\begin{center}\begin{tabular}{l}
\hspace{6.5in} \\ \hline
\end{tabular}\end{center}
This assignment was prepared by  \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner},
Department of Statistics, University of Toronto. It is licensed under a 
\href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US}
     {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website:
\href{http://www.utstat.toronto.edu/~brunner/oldclass/appliedf14} {\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/appliedf14}}

\end{document}

