\documentclass[11pt]{article}
\def\Z{\mathbb{Z}}
\def\Q{\mathbb{Q}}
\def\R{\mathbb{R}}
\def\C{\mathbb{C}}
\usepackage{latexsym,amsmath,amssymb}
\usepackage[all]{xy}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textheight}{8.0in}
\begin{document}
\centerline{MONT 107N -- Understanding Randomness}
\centerline{Group Discussion 4 -- Chi-Square Tests for ``Goodness of Fit''}
\centerline{April 12, 2010}
\vskip 10pt
\noindent
{\it Background and Goals}
\vskip 10pt
To test whether a given box model ``fits'' a collection
of data or not, we have introduced the chi-square statistic
and hypothesis testing using the chi-square table from page 
A106.
\begin{itemize}
\item  Given a box model with tickets of several types and
some prescribed way of drawing the tickets and using the 
corresponding information, plus some observed data
from a chance process supposedly modeled by the box model,
\item the null hypothesis $H_0$ for a chi-square test is
that the box model is consistent with the observed data
(and any deviations from the expected values are just due to chance
variation).
\item The alternative hypothesis $H_a$ is a different possible way
to explain what happened with the data and it comes down to 
saying that the box model {\it does not fit} the data in some way.
\item The {\it test statistic} is computed.  For these tests, we use
$$\chi^2 = \text{sum of} \frac{({\rm observed} - {\rm expected\ from\ } H_0)^2}{{\rm expected}}.$$
This value is compared with the chi-square table, using 
``degrees of freedom'' equal to the number of possible 
outcomes (number of terms in the sum for the $\chi^2$ statistics), minus 1.  
\item The chance that the test statistic would come out that
way, or even ``more extremely'' is the {\it observed significance
level}, or $p$-value of the test.
\end{itemize}
Your solutions for the following problems will be due at the end of
class on Monday, April 12.  
\vskip 10pt
\noindent
{\it Discussion Questions}
\begin{enumerate}
\item[A.]  In class last Friday, we worked out a first example of 
one of these tests where the box model specified $600$ draws with
replacement from the box $[1,2,3,4,5,6]$, but the observed data
for the number of 1's, 2's, 3's, 4's, 5's, and 6's from throwing
 a die $600$ times was:
$$70, 130, 100, 80, 120, 100.$$
Recall that we saw that the observed $\chi^2$-statistic value of 26
or something more extreme would be very unlikely for a fair die.
Suppose now we did $60$ throws rather than $600$ and the data 
came out:
$$7,13,10,8,12,10?$$
\begin{enumerate}
\item[1.]  Before carrying out the $\chi^2$ test, do you 
think this is less likely, as likely, or more likely if the die is fair than
the case we did in class?  Explain your reasoning.
\item[2.]  Carry out the $\chi^2$ test, estimate the $p$-value
from the table, and interpret your result.  
\end{enumerate}
\item[B.]  A newspaper article says that on average first-year college students
spend 7.5 hours per week partying.  One student life administrator
at a university with 4000 first-year students does not believe this.
So she takes a random sample of 100 first year students at her school,
and asks them how many hours a week they spend partying.  Their average
time partying is $6.6$ hours per week, with an SD of 9 hours (!!).  
Is this difference real, or 
is it chance variation?
\begin{itemize}
\item[1.]  What does the fact that the SD is so big say here?  What might the 
sample's histogram for the number of hours partying look like?
\item[2.]  Formulate null and alternative hypotheses.  Describe a
box model giving the representation of the null hypothesis.
\item[3.]  Calculate $z$ and $p$ for the data given.
\item[4.]  Interpret the results of your test.
\end{itemize} 
\item[C.]  A manufacturer of washing machines offers a new model in three
different colors $A,B,C$.  Of the first 1000 machines of that model sold, 
400 were of color $A$.  Does this evidence support the conclusion that
customers have a higher preference for color $A$ than for the other colors?
\begin{itemize}
\item[1.]  Design and carry out a statistical hypothesis test to 
answer this question.  (Follow the outline in questions A and B.)  
\item[2.]  Might there be some problem with assuming that the first
1000 machines sold constitute a random sample of customer preferences?
\end{itemize}
\item[D.]  A clinical trial for a new anticoagulant drug for coronary
artery disease worked like this:  In a month with 30 days, eligible
patients who were admitted to participating hospitals on an odd-numbered
day were assigned to the treatment group and given the new drug.  
Those who were admitted on an even-numbered day were assigned to the 
control group and given a different established drug (one of the accepted
standard treatments for the condition).  At the end of the month, there were $580$
patients in the treatment group (who had been given the new drug), and
$442$ patients in the control group.  The design of the trial was
justified by arguing that the odd-even assignment is objective and
impartial, so it is just as good as randomizing.  But 
of course, the difference between the $580$ and the $442$ sticks out here.  
Was this just as good as randomizing?
\begin{enumerate}
\item[1.]  Design and carry out 
a statistical hypothesis test to decide whether it is reasonable to assume 
that difference was just due to chance variation.  (Follow the outline
from problems A and B.)
\item[2.]  If this was not chance variation, can you guess what it was?
(Note:  the participating doctors did know about the design of the trial!)
\end{enumerate}
\end{enumerate}
\end{document}
