\documentclass[30pt,landscape]{foils}

\usepackage{amsmath}

\usepackage{pause}               \usepackage{background}
\usepackage{graphicx}           \usepackage{geometry}
\usepackage{hyperref}

\usepackage{pp4slide}
\geometry{headsep=3ex,hscale=0.9}

\newtheorem{example}{Example} 
\newtheorem{question}[example]{Question}
\newtheorem{definition}[example]{Definition}
\newtheorem{theorem}[example]{Theorem}
\newtheorem{fact}[example]{Fact}
\newtheorem{notation}[example]{Notation}

\newcommand{\pz}{\pause}
\newcommand{\pb}{\pagebreak}

\definecolor{bgblue}{rgb}{0.03,0.39,0.23}
\vpagecolor{bgblue}

\hypersetup{pdftitle={lecture},
  pdfsubject={A mathematics lecture},
  pdfauthor={Dev Sinha, University of Oregon},
  pdfkeywords={pdftex, acrobat},
  pdfpagemode={FullScreen},
  linkcolor={red}
}

\begin{document}

{\Large Two-sample statistics} \pz

In the last class we started to look at { {two-sample}} problems. \pz
Here we have two populations, and wish to understand how some variable
differs from one population to another.\pause 

These sort of questions arise in a wide variety of situation when you wish to  \pz
\begin{itemize}
\item Compare two different treatments.  For example, two different
manufacturing processes, A and B, or two different medical
treatments. \pz   Here your two populations are those manufactured with
process A, and those manufactured with process B.\pause 
\item Compare some variable of two different populations, such as
 { {men}} and  { {women}}, or  { {left-handed people}} and
 { {right-handed people}}. \pause 
\end{itemize}

The methods used are much like for single sample confidence intervals
and hypothesis tests.  \pz  We gave some explicit formulae last time.
This time we will first ``just work things through'' in testing a hypothesis
and then give a step-by-step treatment of confidence intervals. \pb

{\large Example of hypothesis testing:  exercise 17.38 \pz}

This exercise gives some IQ data for some boys and girls from
the same midwestern school district and asks if there is a statistically
significant difference between the means. \pz
After keying some numbers into a calculator, we get the following
information for our two samples: \pz

\begin{tabular}{|l|l|l|l|l|}
\hline
Population & Mean &  Sample Size & Sample mean & Sample s.d.\\
\hline
Girls & $\mu_{1}$ & $31$ & $\overline{x}_{1}=105.84$ & $s_{1}=14.27$  \\
Boys & $\mu_{2}$ & $47$ & $\overline{x}_{2}=110.96$ & $s_{2}=12.12$  \\
\hline
\end{tabular}\pb

\begin{enumerate}
\item Our null hypothesis is that boys' IQ scores are the same as girls'
IQ scores.  That is 
\[
H_{0}:\mu_{1} = \mu_{2}. \pz
\]
Our alternative hypothesis is that boys have higher IQ scores.
\[
H_{a}:\mu_{1}<\mu_{2} \mbox{ or } \mu_{1}-\mu_{2}<0.
\] \pz

We wish to test this using our data.
\item We calculate our two-sample $t$-statistic 
\[
t =
\frac{\overline{x}_{1}-\overline{x}_{2}}{\sqrt{\frac{s_{1}^{2}}{n_{1}}+
\frac{s_{2}^{2}}{n_{2}}}} = \frac{105.84 - 110.96}{\sqrt{6.569 + 3.125}}
= \frac{-5.12}{3.114} = -1.644. \pz
\]
\item We calculate our $P$-value.  Since $H_{a}$ is
$\mu_{1}-\mu_{2}<0$, we wish to look for $P (t \leq -1.644)$.  We use
$t (30)$ since $31$ is our smaller sample size.  \pz (see p. 452 for a
more accurate way to determine degrees of freedom).

From the calculator, $P (t \leq -1.644) = .0553.$ \pb

\item We draw our conclusion: If we assume $H_{0}$ is \emph{true},
then the probability of seeing samples like the ones we have is
$.0553$.   \pz This is moderately low, so our assumption that $H_{0}$ was true
is probably wrong.  So, this is moderate evidence 
that boys score higher on IQ tests than girls.  \pz  Which is in turn
evidence that small differences
in tests such as IQ tests do not accurately reflect much of  anything. \pz 

\item We can ask the calculator to \emph{do} the test for us.  This is
under \fbox{STAT}, TESTS, 4:2-SampTTest.  We get $df = 56.93$,
$t=-1.64$, $P=.053.$

We \emph{still} need to do step 4 (conclusion) above.  And we need to
do it carefully, because we've possibly lost track of what all our
numbers mean. \pb
\end{enumerate}

{\large Recap of confidence intervals for difference
of means of two populations} \pz

In order to use t-statistics to study two-sample problems, 
we need the following conditions to be satisfied, 
just as for single-sample problems.\pause 
\begin{itemize}
\item An independent SRS from each populations.  For example if we
were trying to sample  { {men}} and  { {women}}, it  {won't}
work to take a random sample of men, and then to take their wives or
girlfriends as the other sample. \pause 
\item Both populations need to be  {normally} distributed, or...
 \pause 
\item If distributions aren't close to normal but no outliers and no
strong skewedness, need sample sizes over 15.\pause 
\item Generally sample sizes greater than 40 are OK even with strongly
skewed distributions or outliers. \pz
\end{itemize}

If these conditions hold then we can follow these steps to compare these 
different populations, finding a confidence interval for
the difference of means $\mu_{1}-\mu_{2}$. \pz 
\begin{itemize}
\item Compute the standard error of the two samples, 
$SE = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}$. \pz
\item Use the $t (k)$ distribution where $k$ is one less than the
 {smaller} of the two sample sizes. \pz
 \item Find $t^{*}$ as in the one-sample case so that C\% of the area is
between $-t^{*}$ and $t^{*}$. \pause   We can look this up in Table C.   \pz
\item With C\% confidence, \pz we can say
the true difference of means is between
$(\overline{x_1} -  \overline{x_2}) - t^* SE$ and 
$(\overline{x_1} -  \overline{x_2})  +  t^* SE$. \pb
\end{itemize}


\begin{example}
Mean body temperatures:  \pz In one study, 65 men and 65 women have their temperature
taken (in similar conditions).  \pz The male mean is 98.105 with a standard deviation of 0.699. \pz
The female mean is 98.394, with a standard deviation of 0.743. \pz  Give a 95\% confidence
interval for the difference between these means and test the hypothesis that women
have higher temperatures than men at  the 0.05 level. \pz  What if the data were drawn
from samples of only 20 men and 22 women?  \pb
\end{example}



\end{document}
 