%% This is a example for homework
\magnification=1200
%\baselineskip=10pt
%\vsize=7.0in \hsize=5.5in
\input epsf
%\input def.tex
%\nopagenumbers
\centerline{\bf Homework \# 1, \it by Qiqing Yu}
The following 3 figure are created by the program splus.ch0 included.
{\epsfysize 3.0truein\epsffile{ch1.ps}}
\centerline{\bf Figure 1. Outputs from R}
{\epsfysize 2.0truein\epsffile{ch1.ps}}
\centerline{\bf smaller one}
The figure on the left is a plot of $(X_i,Y_i)$.
It suggests that $(X,Y)$ has quite a strong linear relation.
The figure in the middle is a plot of residuals verse $X$.
It suggests that the variance of the error terms are constant.
The figure on the right is the qqplot of the error distribution
and the normal distribution. The strong linear form suggests
that the error distribution probably is normal.
%\vfill\eject
\item{4.} mantelhaen.test. (Mantel-Haenszel
Chi-Square Test for Count Data). Performs
a Mantel-Haenszel chi-square test on a
three-dimensional contingency table. Suppose
that we have a sequence of $2 \times 2$ tables, say,
$$\pmatrix{ & D & A & \cr
treatment~1 & a_1 & * & n_{11}\cr
treatment~2 & * & * & n_{12}\cr
& m_{11} & m_{12} & n_1 \cr} ,
\cdots, \pmatrix{ & D & A & \cr
treatment~1 & a_k & * & n_{k1}\cr
treatment~2 & * & * & n_{k2}\cr
& m_{k1} & m_{k2} & n_k \cr} \eqno(1) $$
$H_o$: $p_{11}=p_{12}$, ..., $p_{k1}=p_{k2}$,
where $p_{i1}=P(D|$treatment 1 , ith term)
and $p_{i2}=P(D|$treatment 2 , ith term).
$$\eqalignno{
MH=&{\sum_{i=1}^k(a_i-E_0(a_i)) \over
\sqrt{\sum_{i=1}^k Var_0(a_i)}}\cr
MH^2 \sim & \chi^2(1), \alpha, \beta, \delta, \gamma,
\Gamma,
\psi,
\phi, \Phi, \xi,
\prod_{i=1}^n,
& (3)\cr
=& ....}$$
\item{}
\item{8.} fisher.test. Fisher's Exact Test
for Count Data Performs a Fisher's exact
test on a two-dimensional contingency table.
Suppose we select $c_1$ and $c_2$
from the population of all individuals
having attribute $B$ and $B^c$
(not $B$), respectively, and observe
the numbers $N_{11}$ and $N_{12}$ of type
$A$ individuals in the 1st and
2nd samples, respectively. The contingency
table giving the classification
according to types $AB$, $AB^c$, $A^cB$ and $A^cB^c$.
$N_{11}$ and $N_{12}$ are independent bin$(c_i,p_i)$.
$$\sum_{s \le q_1}{{c_1 \choose s}{c_2\choose r_1-s}
\over {n \choose r_1}} \hbox{ and }
\sum_{s \ge q_2}{{c_1 \choose s}{c_2\choose r_1-s}
\over {n \choose r_1}} \eqno(2) $$
each as close to $\alpha/2$ as possible, but not larger.
\bye