% 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[12pt,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 14\\
Two-sample tests}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
%\date{Feb 20, 2003}
% For two authors (default example)
\maketitle
\thispagestyle{empty}
\section*{Concepts}
\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 $$Z=\frac{\bar X - \bar Y}{\sqrt{\sigma_X^2/n +
\sigma_Y^2/m}} \sim N(0,1).$$

\item Assume $n$ and $m$ to be {\bf large}. The test statistic for
testing
$$H_0: \mu_X = \mu_Y \mbox{ vs. } H_1: \mu_X \neq \mu_Y$$
$$Z=\frac{\bar X - \bar Y}{\sqrt{\sigma_X^2/n + \sigma_Y^2/m}} \sim N(0,1).$$

\end{enumerate}
\section*{In-class problems}

{\em Example 1.} A study was conducted to compare the reaction
times of men and women to a stimulus. 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)$. We want to test if the population
means are the same. 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
\end{verbatim}
{\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
> qnorm(0.025)
[1] -1.959964
\end{verbatim}

What is the main reason you are getting the different results in
Example 1 and 2?
%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.5]{chi.eps}
%\caption{$t_{1000}}
%\end{figure}



\section*{Self-study problems}
Determine the $P$-value in Example 1 and 2.
\end{document}
