\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 Sampling distributions} \pz

We will repeat our main goal many times in many ways.  \pz
Here's an easy question to remember: how does one compute
the ``margin of error'' for a poll?  \pz  How does Gallup know
that 65\% plus or minus 4\% of Americans like chocolate
chip cookies?  \pz  Do they really know that, anyways? \pz

Remember from last time that we are trying to understand
a parameter (like the true average of purchase
prices for cars in the U.S.) from a statistic (the average of say 
1000 of those purchases picked at random.  \pz

The main conceptual turn: we think of a statistic
as a random variable. \pz  After all, choosing 1000 car purchases
at random and taking (for example) the mean price is akin
to rolling dice  - unpredictable, but over many (thousands)
of random samples we expect to see the true mean purchase
price on average. \pz   

Taking this conceptual leap, we now look at all
possible samples from a given collection and see what
happens to the statistics. \pz

\begin{definition}
Given a population,  the  {sampling
distribution} for samples of size $n$ is the probability distribution
of some parameter of the samples (for example the mean)
as we go through all possible samples. \pz
\end{definition} 

We go thoroughly through an example looking
at sampling distributions and comment
thoroughly as we go along. \pb

Consider the collection of numbers 
\[
\mathbf{S} = \{2,2,5,6,7 \}.
\]
 What is the mean? \pz  Ans: 4.4.  \pause 
 
 We can consider all samples from our collection of size $1$.  There
are 5 of them and again, the mean of the samples is again $4.4$.  The
standard deviation is 2.302.\pb


We can now consider all samples from $\mathbf{S}$ of size $2,$
and take the mean of each sample.  \pz Our samples are
\begin{multline*} 
\{\{2,2 \},\{2,5 \},\{2,6 \},\{2,7 \},\{2,5 \},\{2,6 \}, \\
 \{2,7 \},\{5,6 \},\{5,7 \},\{6,7 \} \}.
\end{multline*} \pause 
Our means are 
\[
\{2,3.5, 4, 4.5, 3.5, 4, 4.5, 5.5, 6, 6.5 \}
\] \pz
Notice that the spread is smaller, even though there are more numbers. 
The mean is still 4.4, and the standard deviation is now 1.329.\pause 

The probability distribution of these numbers is an example of
 {sampling distribution}.   \pz In this case 
it is for the mean of a sample of 2 from the set $\mathbf{S}$.  \pz
 There
are 7 possible outcomes which \emph{don't} have equal probabilities. \pz

\noindent \begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
$X$ &  2 & 3.5 & 4 & 4.5 & 5.5 & 6 & 6.5   \\ \hline
Probability & .1  & .2 &  .2 & .2 & .1 & .1 & .1\\ \hline \pz
\end{tabular}
\pb

Now consider all samples of size 3, and their means.  \pz There are
again 10 such samples (you might recall this from our digression 
on binomial coefficients), which we won't list.  \pz  The means for these 10
samples are 
\[
\{3, 3.333, 3.667, 4.333, 4.667, 4.333, 4.667, 5, 5, 6 \}
\] \pz
The standard deviation is now only .886. \pz

Our  {sampling distribution} for samples of $3$ out of our original
group $S$ is 

\noindent \begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
$X$ &  3 & 3.333 & 3.667 & 4.333 & 4.667 & 5 & 6   \\ \hline
Probability & .1  & .1 &  .1 & .2 & .2 & .2 & .1\\ \hline
\end{tabular}

\pz

\begin{example}
Calculate the sampling distribution for the mean of samples of three 
out of the data set $\{-1, 0, 0, 2, 3, 6\}$. \pz
\end{example}

\pb

{\large Facts about  {sampling distributions}}


We see in these examples that the sampling distribution of size $n$ 
always has the same mean as the original list \pz 
and has a standard deviation which is decreasing as the size gets larger. \pz

\begin{theorem}
Let $X$ be a population with mean $\mu $  and standard deviation
$\sigma $.  \pz

Consider the  {sampling distribution} of means of samples of size
$n$ from our population. \pz
\begin{itemize}
\item The mean of the sampling distribution is again $\mu$. \pz
\item The standard distribution of the sampling distribution is $\sigma /\sqrt{n}$. \pz
\item If our population is $N (\mu ,\sigma)$ then our sampling
distribution is $N (\mu ,\sigma /\sqrt{n})$. \pz
\end{itemize}
\end{theorem}

These features of sampling distributions, which are true in general, 
will be critical in making statistical inferences. \pz


\newpage

{\Large The Central Limit Theorem} \pz

\begin{theorem}
 The sampling distribution of means of random samples of size $n$ from a
population with mean $\mu$ and standard deviation $\sigma$ is
approximately 
\[
N (\mu ,\sigma /\sqrt{n})
\]
when $n$ is large.  \pz
\end{theorem}

This theorem is true no matter what the original distribution of
our population is!  \pz (unlike the previous theorem) \pb

This theorem is key to the kingdom of statistics. \pz
Think of what is happening to the standard deviation \pz - getting smaller. \pz
What does that tell us? \pz  Knowing the deviation of the sampling
distribution and the fact that it is approximately normal, 
we know how likely it is that a sample 
is within that deviation (or some multiple) from the mean. \pz
So we can understand our basic question: how far our
sample mean probably is from the real mean. \pz

Before we do precisely these kinds of computations, let's
see the Central Limit Theorem in action. \pb

\begin{example}
We look at the grade distribution for an exam. \pz

\includegraphics[width=15cm]{Figures/exam1-hist.pdf}\pb

Now we take means of all samples of size 2, and look at the histogram
of those numbers.  (There are 7875 such samples.) \pz

\includegraphics[width=15cm]{Figures/exam1-hist2.pdf}\pb

Now samples of size 3. (325500)

\includegraphics[width=15cm]{Figures/exam1-hist3.pdf}
\end{example}

\newpage

\begin{example}
Suppose that the average price of a new car purchase is \$24145
with a standard deviation of \$3615. \pz  Suppose you take a 
survey of 1000 car purchases.  What is the probability that the average
over your survey is over \$25000?
\end{example}\pb

{\large Example: Process Control} \pz

The Central Limit Theorem has many applications, since sampling
can be useful well beyond the realms of surveys and opinion polls. \pz

\begin{itemize}
\item 
Imagine a manufacturing process for, say, ball bearings.  The bearings
are supposed to be 10 mm in diameter.  In fact, when the manufacturing
process is working correctly, they are distributed normally $N
(10,.7)$. \pb

\item 
We can't check every bearing as it is too time consuming.  Every hour
we take a sample of 10 bearings, and take the mean diameter.  The
sample distribution of the means,  $\overline{x}$ should be $N
(10,.7/\sqrt{10})  = N (10,.221)$.  \pz

\item 
This means (by the 68-95-99.7 rule) 99.7\% of the means will occur
\[
10-3 (.221) < \overline{x} < 10+3 (.221) 
\]
\[
9.337 <
\overline{x} < 10.663 \pz
\]

We are alarmed if we see any $\overline{x}$ outside of these limits,
and suspect that our manufacturing process has been disturbed. \pz

\item 
We keep track with a  {$\overline{x}$ control chart}.  This is a
graph, with a mark each hour for the value of $\overline{x}$ for that
hour.   \pz

The graph includes an  {upper control line} 3 standard deviations
above the mean, and a  {lower control lines}, 3 standard deviations
below the mean. \pz

\includegraphics[width=15cm]{Figures/control-plot.pdf} \pz

Notice the entry above the upper control line.  Since 99.7\% of the
entries should be between the control lines,  we should only get
entries outside of that range about 3/1000 times. \pz

So an entry above the upper control line should be a rare event and
should mean that we check our production line to see if problems have
developed. \pz


\end{itemize}



\end{document}
 