\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 Relating hypothesis testing to confidence intervals} \pz

The basic calculations for hypothesis testing and confidence intervals
are the same: \pz take a simple random sample, compute its mean,
and then calculate its $z$-statistics using the Central Limit Theorem.  \pz

In fact, these two procedures are logically related \pz (seeing
how helps us better understand both concepts). \pb

\begin{fact}
If some guess for a mean $\mu_0$ is not within a $1-\alpha$
confidence interval about an observed mean $\bar{x}$ then we
may reject the null hypothesis $\mu = \mu_0$ at significance
level $\alpha$. \pz
\end{fact}

It helps to sketch a picture of what this is saying and to choose some 
concrete numbers. \pz

\begin{example}
Suppose a variable has a standard deviation of $5$ and a measured mean
of  $172.1$ from a sample size of $80$.  \pz \\
\begin{itemize}
\item Find a confidence interval with $C = 95\%$ for this variable. \pz
\item Show that the null-hypothesis of a mean equal to  $175$ can 
be rejected at level $5\%$. \pb
\end{itemize}
\end{example}

{\Large Caution: garbage in, garbage out} \pz

The most common mistakes one sees in applications of
statistics are not in the mathematics of means and deviations \pz  --
with practice one can master these methods, and there
are sophisticated computer packages to help out \pz --
but in starting with biased data, whose error is comparable to
the confidence intervals in question. \pz

\begin{example}
What if in our UO height example, two of the sample taken were
members of the basketball team over 80 inches tall? \pz 
If these outliers are thrown out, what is our new confidence level
for the hypothesis that UO men are above average height? \pz
Recall heights obey $N (69.3, 2.8)$.  We took a SRS of 32 undergrad men from the UO
and found $\overline{x} = 70.4$.
\end{example}

One of the topics of Chapter 15 is to elaborate on problems which
can plague samples and surveys, in light of their effects on 
confidence intervals and hypothesis tests.  \pz  This material 
mostly applies common sense, not mathematics, as we did
when we looked at designing surveys and experiemens.   \pz  

We will not at all cover the material from Chapter 15 on type I and II errors
and power of tests.  \pz  This development of language is straightforward enough
so that you could learn it on your own if you encountered these terms outside
of class.  \pb


{\Large  Estimating the mean \emph{without} knowing $\sigma$} \pz

In \S 13 the method we learned for estimating our population mean $\mu$ 
had the serious drawback that we had to know the standard deviation
for our population.    We now wish to approximate $\mu$ \emph{without}
knowing the standard deviation.\pb

\noindent {\bf{Basic Idea:}} Take a SRS.  Calculate the standard
deviation of our sample, $s$.  This is called the \emph{standard error}
to distinguish it from the unknown standard deviation of our
population.  \pz

Calculate the mean of our sample $\overline{x}$.  Use $s$ to estimate
$\sigma$ and then techniques we've already learned to estimate $\mu$
from $\overline{x}$.\pb

TERMINOLOGY:  We use 
\[
{\mu} = \mbox{for our (unknown) \pause  {population mean},}\pause \]
 and 
\[
{\overline{x}} = \mbox{for our \pause {sample
mean}.} \pause 
\]
We now also need to distinguish between two standard deviations.
\[
{\sigma} = \mbox{for our (unknown) \pause  {populations standard
deviation}} \pause 
\]
and
\[
{s} = \mbox{for our \pause  {sample standard deviation}.}
\] \pz

Recall that if our population has distribution $N (\mu ,\sigma)$ and we
look at samples of size $n$,  our standardized sample mean
\[
z = \frac{\overline{x}-\mu}{\sigma /\sqrt{n}}
\]
has distribution $N (0,1)$.\pause 

If we look instead at the random variable 
\[
t = \frac{\overline{x}-\mu}{ {s}/\sqrt{n}}
\]
this is called the  \emph{t-statistic}. \pz

The t-statistic looks much like the z-statistic we used when 
we assumed knowledge of the true deviation.  
We give the t-statistic a distinct name because unlike
the z-statistic it is {\em not} normally distributed.  
If we applied the 68-95-99.7 rule, we would get incorrect 
answers! \pz

Instead, we must understand where the t-statistic
fits on what is called
the  {\em t-distribution with $n-1$ degrees of freedom}.  This
distribution is abbreviated $t(n-1)$, \pz and looks like a
normal distribution with ``fat tails'', which arise because of the
uncertainty of not knowing the true standard deviation. \pause 
If $k$ is large, $t (k) \sim  N (0,1)$. \pause 

The critical values for t-distributions are in Table C. \pz
We can check by comparing with the last row  
that with a t-statistic you need to be more deviations
away from the mean to have the same level of confidence
as a z-statistic. \pb

\begin{example}
Use $t$-statistics to estimate population mean with confidence 95\% if we
have an SRS of size $n=11$ with $\overline{x}=27$ and $s=2$.\pause 
\end{example}

\begin{example}
With data as above, say whether or not the null-hypothesis of $\mu = 30$
can be rejected. \pb
\end{example}

\begin{example}
If you sample $200$ 
bacterial lifespans and find an average of $10.41$ days and a deviation 
of $2.1$, does this finding support the hypothesis that these bacterial lifespans
are on average more than 10 days?
\end{example}


%\begin{itemize}
%\item Look for $t^{*}$ with 95\% of $t (10)$ between $t^{*}$ and
%$-t^{*}$.  \pause 
%\item From table C, $t^{*}=2.359$.\pause
%\item So 
%\[
%-t^{*} = -2.359 \leq \frac{\overline{x}-\mu}{ {s}/\sqrt{11}} \leq 2.359 =
%t^{*}.
%\]\pause 
%Using our numbers,  $\mu$ is $\overline{x} \pm
%2.359\frac{2}{\sqrt{11}} = 27 \pm 1.4225.$
%\end{itemize}

\newpage



\end{document}
 