\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{eufrak}
%\numberwithin{equation}{section}
\newtheorem{theorem}{Theorem}%[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\begin{document}
\title{Goodness of Fit/Analysis of Variance}
\author{Worksheet}
\date{}
\maketitle
\begin{enumerate}
\item Three streets in Los Angeles have different tree types - pine, jacaranda, and ash. Counts of three common bird species- house finch, northern mockingbird, and house sparrow - are taken on each of the three streets. Below are are table of counts. Are the bird species preferences independent of the street?
\begin{center}
\begin{tabular}{|c|c|ccc|} \cline{3-5}
\multicolumn{2}{c}{}&\multicolumn{3}{|c|}{tree species}\\ \cline{3-5}
\multicolumn{2}{c|}{}&pine&jacaranda& ash \\ \hline
bird&house finch&9&9&26\\
species&northern mockingbird&11&16&6\\
&house sparrow&14&8&7 \\ \hline
\end{tabular}
\end{center}
\begin{enumerate}
\item Make a segmented bar chart of the conditional distribution of bird species, comparing the three streets.
\item Give a suitable hypothesis to address the question addressed above.
\item Create the ``expected" table.
\item Create the table of residuals.
\item Explain how you would compute the $\chi^2$ test statistic from the residual table.
\item Use {\sf R} to perform the $\chi^2$ test and state your result.
\item Use the table of residuals to state which trees to plant to attack more of each species of birds - house finch, northern mockingbird, and house sparrow. Explain your answer.
\end{enumerate}
\item In a 2011 study from Texas A \& M University, forty-two drivers were placed behind the wheel of a car and drove around a closed track about 11 miles in length. The researchers monitored how long it took drivers to react to a flashing light while driving normally and while attempting to text or to read a message on a mobile phone. Here is a summary of the data.
\begin{center}
\begin{tabular}{|c|ccc|}\hline
&&&standard \\
conditions&\# observations&mean&deviation \\ \hline
control&42&1.754&0.806 \\
texting&42&4.302&1.614 \\
reading&42&3.278&1.274 \\ \hline
\end{tabular}
\end{center}
\begin{enumerate}
\item Give the appropriate hypothesis for this situation.
\item Determine the value of the $F$ statistic for a one way analysis of variance.
\item What are the degrees of freedom appropriate with this test.
\item Give the $p$-value for the test. What are you conclusions?
\item Give a 95\% confidence interval for the difference in mean reaction times between texting and control and between reading and control.
\item Give a hypothesis for the contrast that compares the control to the average of the mean times for texting and writing.
\item Give the value of the $t$-statistic for this test. What are the degrees of freedom?
\item Do you reject this hypothesis? Explain your answer.
\end{enumerate}
\end{enumerate}
\end{document}