\documentclass[12pt]{article}
\textwidth = 6.5 in
\textheight = 9 in
\oddsidemargin = 0.0 in
\evensidemargin = 0.0 in
\topmargin = 0.0 in
\headheight = 0.0 in
\headsep = 0.0 in
\parskip = 0.2in
\parindent = 0.0in
\usepackage{graphics, graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{wrapfig}

\def\sgn{{\rm sign}}
\def\drightarrow{{\stackrel{d}{\rightarrow}}}
\begin{document}
{\bf STA 2201S 2014 Assignment 1.} 
\vspace{-0.5in}
\begin{flushright}{\em due Friday, January 31 at the beginning of class}\end{flushright}


\noindent{When answering questions requiring numerical work, the results are to be reported in a narrative summary, in your own words.  Tables and Figures may be included, but must be formatted along with the text.
DO NOT include in this summary printouts of computer code with the relevant selections highlighted.  All computer code used to obtain the results summarized in the response should be provided as an appendix.  In this appendix you may highlight the relevant results. The \LaTeX code used to produce this HW is available on the course web site.  It is not necessary to submit your homework in \LaTeX, but it makes the TA much happier.}

\begin{enumerate}
\item{SM Ex.~10.4.4} Show that the gamma density
\begin{equation}
f(y;\mu, \nu) = \frac{1}{\Gamma(\nu)}y^{\nu - 1} \left(\frac{\nu}{\mu}\right)^\nu \exp(-\nu y/\mu)
\end{equation} can be put in the form of a generalized linear model

$$
f(y; \theta, \phi) = \exp \left\{ \frac{y\theta - b(\theta)}{\phi} + c(y;\phi)\right\};
$$
identify the canonical parameter $\theta$ and the scale parameter $\phi$ in terms of $\mu$ and $\nu$.
Hence, or otherwise, find the mean and variance of $y$. Give an expression for the maximum likelihood estimate of $\nu$, based on a sample of size $n$ from (1), using the notation $\psi(\nu)$ for the {\em digamma} function, $d\log\Gamma(\nu)/d\nu$.

\item{Faraway Ex.~6.8}\footnote{{\em Extending the Linear Model with} \texttt{R}. J.J. Faraway, 2006. Chapman \& Hall.}
One hundred twenty-five fruit flies were divided randomly into five groups of 25 each.  The response was the lifetime of the fruit fly in days.  One group was kept solitary, while another was kept individually with a virgin female each day.  Another group was given eight virgin females per day.  As an additional control the fourth and fifth groups were kept with one or eight pregnant females per day (pregnant fruit flies will not mate).  The thorax length of each male was measured as this was known to affect lifetime.  The data is 
{\tt fruit fly} in the library {\tt faraway}, and can also be downloaded from the class web page with\\
{\scriptsize{\tt read.table(url("http://www.utstat.toronto.edu/reid/sta2201s/2014/fruitfly.Rdata", header = T)}.}

Use a gamma generalized linear model to model the lifetimes as a function of the thorax length and activity.  Interpret the coefficients in your model, in terms of their effect on expected lifetime, and assess the fit of your model with appropriate diagnostics.  Give 95\% confidence intervals for any contrasts you this may be relevant.  A complete reference to the data is given in the help file for the dataset.

Write a one-paragraph, non-technical, summary of the results, that might appear in a `Research News' media article about the laboratory in question.

\item Find an article about the results of a study, in a scientific journal on a topic of interest to you.  The article should discuss a single study, and should provide information enough information on the study methods to answer the questions below. If you are stuck, the {\em nocebo} papers posted under January 17 may have some useful references.
\begin{enumerate}
\item Give the complete bibliographic reference, as well as a web link, to the published paper.
\item Was the study observational or a designed experiment?
\item What was the study population?  What is the population of interest for the research?
\item If the study was observational, was it a prospective, or a retrospective study? If it was an experiment, was it randomized?
\item What were the units of analysis?
\item What was the primary endpoint and the main analysis of this endpoint?
\item What were the main conclusions of the study, in your own words?
\end{enumerate} 
\end{enumerate}
\end{document}
