\documentclass[11pt,titlepage]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{verbatim}
\allowdisplaybreaks

\jot=.2in \pagestyle{empty} \setlength{\topmargin}{-0.5in}
% \setlength{\footheight}{0 in}
\setlength{\textheight}{9.5in} \setlength{\oddsidemargin}{-0.2in}
\setlength{\evensidemargin}{0in} \setlength{\textwidth}{6.7in}
\font\heada=cmbx10 scaled\magstep3 \font\headb=cmsl10
scaled\magstep1 \font\headc=cmr8 \pretolerance=10000
\setlength{\parindent}{2 em}

\begin{document}
\begin{center}
{\heada Project 9 Solutions}\\
{\headb Statistics 401: Spring 2007}\\
\end{center}
\bigskip

\begin{enumerate}
\item (1 pt, Problem 15.4 on page 676) It is not appropriate to perform an
ANOVA since we can not assume that the constant variance assumption
is met: $\frac{\rm largest~s}{\rm
smallest~s}=\frac{7.38}{2.66}\approx 2.77>2$.

%\item Problem 15.4 on page 676:
%\begin{enumerate}
%  \item The hypotheses are:
%  ${\rm H}_0\colon \mu_{_{\rm beer}} = \mu_{_{\rm wine}} = \mu_{_{\rm
%  spirits}}$\\
%  ${\rm H}_a\colon \mu_{_{\rm beer}} \ne \mu_{_{\rm wine}}$ OR $\mu_{_{\rm beer}} \ne \mu_{_{\rm
%  spirits}}$ OR $\mu_{_{\rm wine}} = \mu_{_{\rm spirits}}$
%
%  \item Assuming that the data is normal, it remains to determine
%  whether or not the constant variance assumption is met
%
%  \item To calculate the F test statistic, the formulas from the one-way
%  ANOVA table in Table 1 was used:
%
%  \centerline{\bf Table 1: Formulas for the One-way ANOVA Table}  \vspace{0.1in}
%\begin{tabular}{llllll}\hline
%Source & DF & Sum of Squares (SS) & Mean Squares (MS) & F & p-value
%\\ \hline
%Treatments & DFTr=k-1 & SSTr=$\sum_{i=1}^k n_i (\bar x_i - \bar{\bar x})^2$ & MSTr = $\frac{\rm SSTr}{\rm DFTr}$ & $F^*=\frac{\rm MSTr}{\rm MSE}$ & $P(F > F^*$) \\
%Error & DFE=N-k & SSE=$\sum_{i=1}^k(n_i-1)s_i^2$ & MSE=$\frac{\rm
%SSE}{\rm DFE}$ & & \\ \hline Total & DFTo=N-1 & SSTo=$\sum_{\rm
%all~x} (x_{ij} - \bar{\bar x})^2$ & & & \\ \hline
%\end{tabular}
%
%\bigskip
%
%The results of the calculations using these formulas are given in
%Table 2.
%
%\bigskip

 % \centerline{\bf Table 2: One-way ANOVA Table for Problem \#1}  \vspace{0.1in}
%\begin{tabular}{llllll}\hline Source & DF & Sum of Squares (SS) &
%Mean Squares (MS) & F & p-value
%\\ \hline
%Treatments & 2 & 13763.44 & 6881.722 & 236.3153 & 0.000 \\
%Error & 3119 & 90828.17 & 29.12093 & & \\
%\hline Total & 3121 & 104591.6 & & &
%\\ \hline
%\end{tabular}



%\end{enumerate}


\item Problem 15.6 on page 677:

\begin{enumerate}
\item (1 pt) The numerator degrees of freedom is $DFTr=k-1=2$.   The
denominator degrees of freedom is $DFE=N-k = 65$ since $N=68$.

\item (4 pts) The ANOVA:

\begin{enumerate}

 \item \underline{Hypotheses}:\\
 ${\rm H}_0\colon \mu_{_{\rm sharer}} = \mu_{_{\rm full~time}} = \mu_{_{\rm
  part~time}}$\\
  ${\rm H}_a\colon \mu_{_{\rm sharer}} \ne \mu_{_{\rm full~time}}$ OR $\mu_{_{\rm sharer}} \ne \mu_{_{\rm
  part~time}}$ OR $\mu_{_{\rm full~time}} = \mu_{_{\rm part~time}}$

\vspace{.1in}

\item \underline{Test statistic value}: \\This value is given as
$F=6.62$.

\item \underline{Distribution of the test statistic}: \\$F \sim
F(2,65)$.

\item \underline{$p$-value}: \\R gives the value to be 0.0024

\item  \underline{Decision} at $\alpha=.05$: \\Since the
$p$-value=$.0024<.05=\alpha$, then REJECT ${\rm H}_0$ in favor of
${\rm H}_a$.

 \item \underline{Conclusion}: \\
The evidence suggests that there is a difference in mean job
satisfaction for job sharers, full-time employees, and part-time
employees.

\end{enumerate}

\item (1 pt) The test statistic is $F=\frac{MSTr}{MSE}=6.62$.
Thus, to find $MSE$, first find $MSTr=\frac{\rm SSTr}{\rm
DFTr}\approx 13.43$.   To find $MSTr$, $SSTr=\sum_{i=1}^k n_i (\bar
x_i - \bar{\bar x})^2\approx 26.85$ since the grand mean is
$\bar{\bar x}=\frac{\sum n_i\bar x_i}{\sum n_i}=5.75$. Thus,
$MSE\approx 2.0283$.

\item (2 pts) In addition to the calculations above, we only need to compute $SSE=MSE(DFE)$ and $SST=SSTr +
SSE$ to fill in the rest of the ANOVA table in Table 1.

\bigskip
 \centerline{\bf Table 1: One-way ANOVA Table for Job Satisfaction by Employee Type}  \vspace{0.1in}
\begin{tabular}{llllll}\hline Source & DF & Sum of Squares (SS) &
Mean Squares (MS) & F & p-value
\\ \hline
Treatments & 2 & 26.85 & 13.42722 & 6.62 & 0.0024 \\
Error & 65 & 133.87 & 2.0283 & & \\
\hline Total & 68 & 160.72 & & &
\\ \hline
\end{tabular}

\bigskip

\item (2 pts) Table 2 contains estimates of $\mu_1$ and $\sigma$.

\begin{center}
{\bf Table 2: Estimate of some ANOVA Parameters}

\bigskip

\begin{tabular}{||l|c|l||}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  parameter & estimate & Explanation in English words of the parameter\\\hline
  Estimate for $\mu_1$ & 6.6 & The mean level of satisfaction of the Job Sharers\\\hline
  Estimate of $\sigma$ & $\sqrt{2.0283}=1.4258$ & The constant standard deviation for each population\\
  & &  of workers\\
  \hline
\end{tabular}
\end{center}

\end{enumerate}

\newpage
\item Problem 15.22 on page 685:

\begin{enumerate}

\item (1 pt) A follow-up analysis to \#2: problem 15.6 on page 677 is
appropriate since we rejected $H_0$ in the ANOVA test.

\item (2 pts) Three 95\% Tukey's CI's were
calculated using the formula: $\bar x_i - \bar x_j \pm
\frac{q_{1-\alpha,k,DFE}}{\sqrt{2}} \sqrt{MSE(\frac{1}{n_i} +
\frac{1}{n_j})}$.  Table 8 in the text book, with $k=3$ and $DFE=66$
rounded down to 60, shows that the Tukey critical value is
$q_{1-\alpha,k,DFE}\approx 3.4$.   Table 3 shows these three CI's.


\begin{center}
{\bf Table 3: 95\% Tukey CI's for the ANOVA of Job Sharing}

\bigskip

\begin{tabular}{||c|c|c|c||}\hline
Comparison & Estimate & Lower & Upper \\ \hline
$\mu_{_{\rm sharer}} - \mu_{_{\rm full~time}}$ & 1.23 & 0.2442 & 2.2158 \\
$\mu_{_{\rm sharer}} - \mu_{_{\rm part~time}}$ & 1.4 & 0.3661 & 2.4339 \\
$\mu_{_{\rm full~time}} - \mu_{_{\rm part~time}}$ & 0.17 & -0.8639  & 1.2039 \\
\hline
\end{tabular}
\end{center}

\item (1 pt) Among hospital employees, the mean level of job satisfaction for
job sharers is significantly larger than the mean level of job
satisfaction for either full-timers or part-timers.

\end{enumerate}

\item February 19, 2007 National Public Radio broadcast on
gratitude:


\begin{enumerate}
\item (1 pt) To have been a CRD, the individuals must have been randomly
assigned to the treatment groups.

\item (1 pt) The variable $x_{2,13}=6.4$ hours, which means that the thirteenth subject in the group which kept the ``stress journals"
slept an average of 6.4 hours each night.



\item (1 pt) Side-by-side box-plots of the amount of sleep for each treatment group are given in Figure 1.

\begin{center}
{\bf Figure 1: Mean amount of sleep (in hours) per treatment group}

\vspace{-.5in}

\includegraphics[angle=0,width=4in]{project9boxplots.ps}
\end{center}

\item (1 pt) \underline{Hypotheses}:\\
Let $\mu_g$ be the mean amount of sleep for subjects who keep a
``gratitude journal;" $\mu_s$ be the mean amount of sleep for
subjects who keep a ``stress journal;" $\mu_c$ be the mean amount of
sleep for subjects in the control group who keep a ``regular
journal;"

 ${\rm H}_0\colon \mu_g = \mu_s = \mu_c$\\
  ${\rm H}_a\colon \mu_i\ne \mu_j$ for some $i$ and $j$

\item (2 pts) Fitting the ANOVA model yields the one-way ANOVA table in Table 4.

\bigskip

 \centerline{\bf Table 4: One-way ANOVA Table for Sales by Design}  \vspace{0.1in}
\begin{tabular}{llllll}\hline Source & DF & Sum of Squares (SS) &
Mean Squares (MS) & F & p-value
\\ \hline
Treatments & 2 & 96.756 & 48.378 & 13.265 & $1.401\times 10^{-5}$ \\
Error & 67 & 244.347 & 3.647 & & \\
\hline Total & 69 & 341.103 & & &
\\ \hline
\end{tabular}

\bigskip


\item (2 pts) Check the assumptions.
\begin{enumerate}
\item The evidence fails to suggest that the data for each group are
not normal.  The normal points in the normal probability plot have a
linear pattern, and the smoothed histogram of the studentized
residuals appears normal (see Figure 2).   The correlation of the
studentized residuals is .997, which is much larger than the
critical correlation value of $r_{\rm critical}=.976$.

\begin{center}
{\bf Figure 2: Checking the normality assumption}

\vspace{-.1in}

\includegraphics[angle=0,width=4.75in,height=3in]{project9normal.ps}
\end{center}


\item Since $\frac{{\rm largest~s}}{{\rm smallest~s}} \approx \frac{2.5}{1.46}
\approx 1.71 < 2 $, the constant variance assumption appears to
hold.
\end{enumerate}


\item (1 pt) The distribution of the test statistic assuming that ${\rm H}_0$ is
true is $F \sim F(2,67).$

\item Since the $p$-value is tiny, then we REJECT ${\rm H}_0$.

\item (1 pt) If this was a completely randomized experiment (CRD), then we can make cause-and-effect conclusions.
And if the individuals were not from a SRS, then we can not make
inferences to the entire human population.  Thus, the evidence
suggests that, \underline{among the subjects in the study}, keeping
a certain type of journal \underline{caused} some of the subjects to
have a longer night's sleep on average than some of the others.



\end{enumerate}


\newpage
\item

\begin{enumerate}
\item (1 pt) It is appropriate to conduct a follow-up test since the ANOVA
null hypothesis was rejected.

\item (2 pts) Table 5 displays the 95\% Tukey
confidence intervals for the pairwise differences between means.


\begin{center}
{\bf Table 5: 95\% Tukey CI's}

\bigskip

\begin{tabular}{||c|c|c|c||}\hline
Comparison & Estimate & Lower & Upper \\ \hline
$\mu_g - \mu_c$ & 2.0611  & 0.7062 & 3.4161 \\
$\mu_s - \mu_c$ & -0.8085 & -2.1166 & 0.4996 \\
$\mu_s - \mu_g$ & -2.8696 & -4.2374 & -1.5019 \\\hline
\end{tabular}
\end{center}




\item (1 pt) From the Tukey's CI's, keeping a daily gratitude journal
(and so focusing on being grateful) \underline{caused} these
subjects to have a longer night's sleep on average than either the
subjects focusing on stress, or the subjects focusing on nothing in
particular.  There is no significant difference in mean amount of
sleep between those focusing on stress and those focusing on nothing
in particular.

\item (2 pts) Table 6 gives the table of parameters and estimates:



\begin{center}
{\bf Table 6: Estimate of some ANOVA Parameters}

\bigskip

\begin{tabular}{||l|c|l||}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  parameter & estimate & Explanation in English words of the parameter\\\hline
  Estimate for $\mu_3$ & 6.496 & The mean amount of sleep of people who do not \\
  & & focus on either gratitude or stress\\\hline
  Estimate of $\sigma$ & $\sqrt(3.647) \approx 1.91$ & The constant standard deviation for each group.\\
  \hline
\end{tabular}
\end{center}


\end{enumerate}
\vspace{0.1in}

%\item {\bf Head Injury in a Car Crash} The data are from car crash experiments conducted by
%the National Transportation Safety Administration. New cars were purchased and crashed into
%a fixed barrier at 35 mph and the measurements were recorded for the dummy in the driver's
%seat. The head injury data (in Head Injury Criterion, HIC) are given in the data file
%``headinjury.txt" on the Stat 401 website. Use a 0.05 significance level to test the null
%hypothesis that the different weight categories have the same mean. Do the data suggest that
%larger cars are safer? \underline{Answer all questions asked in \#$2$}.
\end{enumerate}

\newpage
\subsection*{Appendix}
\verbatiminput{project9Rcode.txt}

\end{document}

> pf(q,df1,df2,ncp=0,lower.tail = TRUE)

