% This is a simple LaTex sample document that gives a submission format
%   for IEEE PAMI-TC conference submissions.  Use at your own risk.

% Make two column format for LaTex 2e.
\documentclass[11pt,twocolumn]{article} %,twocolumn
%\usepackage[dvips]{graphicx,graphics}
%\usepackage{times,amsmath,amsfonts}

% Use following instead for LaTex 2.09 (may need some other mods as well).
% \documentstyle[times,twocolumn]{article}

% Set dimensions of columns, gap between columns, and paragraph indent
\setlength{\textheight}{9.6in} \setlength{\textwidth}{6.9in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0in} \setlength{\headsep}{-1in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.2in}  % Centers text.
\setlength{\evensidemargin}{-.2in}

% Add the period after section numbers.  Adjust spacing.
\newcommand{\Section}[1]{\vspace{-8pt}\section{\hskip -1em.~~#1}\vspace{-3pt}}
\newcommand{\SubSection}[1]{\vspace{-3pt}\subsection{\hskip -1em.~~#1}
        \vspace{-3pt}}
\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand {\diff}[1] {\frac{\partial}{\partial #1}}
\newcommand{\jacob}[3]{\frac{\partial^2 #3}{\partial #1 \partial #2}}
\newcommand{\der}[2]{\frac{\partial #2}{\partial #1}}
\begin{document}

% Don't want date printed
%\date{January 23, 2003}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 312: Lecture 16\\
Two sample test}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
\date{November 4, 2004}
% For two authors (default example)
\maketitle \thispagestyle{empty}
\begin{enumerate}

\item Let $X_1,\cdots,X_n$ and $Y_1,\cdots,Y_m$ be two independent
samples with mean $\mu_X$, $\mu_Y$ and variance $\sigma_X^2$,
$\sigma_Y^2$ respectively. $$\mathbb{E}(\bar X - \bar Y) = \mu_X
-\mu_Y. $$
$${\bf Var} (\bar X -\bar Y) = \sigma_X^2/n +
\sigma_Y^2/m.$$

\item Let $X_1,\cdots,X_n$ and $Y_1,\cdots,Y_m$ be two independent
samples with $X_i \sim N(\mu_X,\sigma_X^2)$ and $Y_j \sim N(\mu_Y,
\sigma_Y^2)$. Then we can show that $$Z=\frac{\bar Y - \bar X -
(\mu_X - \mu_Y)}{\sqrt{\sigma_X^2/n + \sigma_Y^2/m}} \sim N(0,1).$$
{\em Proof.} See lecture note.

\item Based on the above statistical assumptions on $X_i$ and $Y_j$,
we are interested in testing
$$H_0: \mu_X = \mu_Y \mbox{ vs. } H_1:\mu_X  \neq \mu_Y.$$

{\em Example 1.} 12 men and 9 women were employed in the experiment.
Let $X_i$ be the reaction time of the $i$-th man and $Y_j$ be the
reaction time of the $j$-th woman. There is a reason to believe that
$X_i \sim N(\mu_X, 0.18)$ and $Y_j \sim N(\mu_Y, 0.14)$. The
following measurements were taken: $\bar x = 3.6$ seconds, $\bar y=
3.8$ seconds. Is there any difference between the reaction times of
men and women?
\begin{verbatim}
> z=(3.6-3.8)/sqrt(0.18/12+0.14/9)
> z
[1] -1.144155
> qnorm(0.025)
[1] -1.959964
\end{verbatim}



\item Let $X_1,\cdots,X_n$ and $Y_1,\cdots,Y_m$ be two independent
samples with mean $\mu_X$, $\mu_Y$ respectively. Assume $n$ and $m$
to be sufficiently {\bf large}. The test statistic for testing
$$H_0: \mu_X = \mu_Y \mbox{ vs. } H_1: \mu_X \neq \mu_Y$$
is
$$Z=\frac{\bar Y - \bar X}{\sqrt{S_X^2/n + S_Y^2/m}} \sim N(0,1).$$


{\em Example 2.} A study was conducted to compare the reaction times
of men and women to a stimulus. 50 men and 65 women were employed in
the experiment. Let $X_i$ be the reaction time of the $i$-th man and
$Y_j$ be the reaction time of the $j$-th woman. The following
measurements were taken: $\bar x = 3.6$ seconds, $\bar y= 3.8$
seconds, $s_X^2=0.18$, $s_Y^2=0.14$. Is there any difference between
the reaction times of men and women?
\begin{verbatim}
> z=(3.6-3.8)/sqrt(0.18/50+0.14/65)
> z
[1] -2.63664

\end{verbatim}


What is the main reason you are getting the different results in
Example 1 and 2?



\end{enumerate}

{\em Review Problems.} Determine the $P$-values in Example 1 and 2.
Example 9.1., 9.4.

\end{document}
