\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}
\newcommand{\nid}{\noindent}

\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}

Today we develop two of the main ideas of statistical reasoning. \pz
We continue to work on confidence intervals, and then we move
on to hypothesis testing.  \pz  We will come back to these ideas repeatedly
in more sophisticated ways, but the basic groundwork is laid here.  \pb

{\Large Confidence intervals for the mean} \pz

\begin{definition}
The $z^*$ value for a confidence percentage C\%  is the number
of standard deviations from the mean (both over and under) 
needed to account for C\% of a normal distribution. \pz
\end{definition}

You can look up $z^*$ values in Table C. \pb

Our computations above of confidence intervals are summarized 
as follows. \pz

\begin{theorem}
Suppose a sufficiently large SRS of population $n$ is drawn from a population having
an unknown mean but known (or at least bounded above) deviation $\sigma$. \pz
A confidence interval with confidence percentage C\% is given by
$$ \overline{x} \pm z^* \frac{\sigma}{\sqrt{n}}, $$
where $z^*$ is the critical value associated to $C$ in Table C. \pz
\end{theorem}

\begin{example}
Suppose we wanted to estimate the mean property value in Eugene. \pz  
It is reasonable to assume a standard deviation of less than 200K.  \pz
Suppose we somehow surveyed 625 properties and found a mean
of 274K.  \pz Establish a confidence interval with confidence 95\%
for the true mean. \pz
\end{example}

While we may prefer to work things through rather than use a formula,
having the formula lets us understand the behavior of confidence
intervals with respect to different parameters (all of which agree with common
sense). \pz

\begin{itemize}
\item A high level of confidence requires a larger margin of error. \pz
\item A small margin of error means a lower level of confidence. \pz
\item The margin of error decreases as the sample size increases. \pz
\item A large initial deviation increases the margin of error. \pb
\end{itemize}

{\Large Finding sufficiently large populations} \pz

Most often the initial deviation is set, as is our desired margin
of error and level of confidence; that leaves us solving
for which population will allow us to achieve this confidence
interval with the parameters given. \pz  We can be pretty loose
in estimating standard deviation. \pb

\begin{example}
Suppose we assume that the standard deviation for IQ is less than 35
(a reasonable assumption).  \pz  How many IQ's would we need
to randomly survey to find the average IQ within a confidence
interval of 1 with 95\% certainty? \pz
\end{example}

\begin{example}
Assuming American men's heights have a deviation of at most five inches,
how many men must be measured to determine the average height
within one tenth of an inch with 90\% confidence.\pb
\end{example}

Of course we can streamline our algebra and just work from a formula.\pz

\begin{theorem}
The confidence interval for the mean of a population with sufficiently
large sample size will have a specified margin of error $m$ when  the
sample size is at least
$$ n = \left( \frac{z^* \sigma}{m} \right)^2, $$
where $z^*$ is the critical value associated to the confidence level desired. \pb
\end{theorem}

We can see how this formula gives the same answers as we worked out in
the previous two examples.  \pz

Before moving on we reiterate a...\pz

\noindent CAUTION: Our calculation of confidence intervals depends
very strongly on the sample being random.  \pz If the sample being
random, all bets are off (again, we may go through above
examples).   \pz

What would happen if we tried to make a confidence interval for income
or IQ over all of Oregon from a ``random'' sample we took from campus?  \pb

{\Large Tests of Significance}\pz

A test of significance is a way to establish some claim (in science, business,
politics...) by showing that the alternative claim goes against the evidence. \pz
More precisely, one shows that the alternative claim is {\em highly
unlikely}.\pz  

We go through some examples developing language as we go along before
formalizing things. \pb

{\large Example: The last part of the last question on the midterm} \pz

(Paraphrased and expanded:) in a state-wide exam students 
scored an average of 70 points with a standard
deviation of 10. \pz  At one school 50 students took the exam and averaged
63 points.  \pz The principal of the school says that it was just a slightly
off day, as could be expected for any group of students who are about
average.  \pz The superintendent says no, it has been statistically establish
that these students are underperforming.  Argue the superintendent's case. \pz

\nid{\bf{Timeout for language:}} \pz The claim that the students are about average
for testing purposes is an example of a {\em null hypothesis}.  \pz The claim that 
they are underperforming is called an {\em alternative hypothesis}.  \pz

\nid{\bf{Timeout for strategy:}}  \pz Have you ever seen a court show on TV where
the examining lawyer says ``OK Mr. Smith, let's say you were on your way home 
from work when the murder took place.  \pz  That would put you at the intersection
of 5th and Main sometime around 5:30.  \pz But there was a backup there on the
day in question because of the Shriner's convention.  \pz So there was no way
you could drop by the grocery store at 5:35 before getting home at 5:45 as
your wife says you did.''  \pz

OK, maybe you've never seen such a show, \pz but it is interesting to look at the logic. \pz
The first thing the prosecutor does is ``lose'' the argument.  \pz More precisely, he
takes the opposing view.  \pz  If only Mr. Smith could at that point say ``Yes, let's
say I was on my way home.  Now let's call it a day, shall we?''.  \pz  But the next 
thing the prosecutor does is show that if he takes the opposing view, he makes
conclusions at odds with reality.  \pz Thus he shows that the opposing view
is invalid, so that ultimately his view is valid. \pz  In the (math) business we say 
he is making an {\em argument by contradiction}. \pz

\nid{\bf{Back to our example:}}  As the superintendent we will start by accepting
the principal's (null) hypothesis: his school's students are about average.  \pz
We now make some deductions: \pz On a test with mean 70, deviation 10,
the sampling distribution for samples of size fifty
has mean 70, deviation $\frac{10}{\sqrt{50}} = \sqrt{2} \sim 1.41$. \pz
An average score of 63 among fifty students is thus almost five
deviations below the mean.  \pz  Observing a value five deviations
below the mean happens with probability less than one in ten-thousand. \pz
({\bf More language} This probability is an example of a {\em $P$-value}). \pz
Thus it is more likely that we buy a winning (low-stakes) lottery ticket
than it is that an average group of students would score so low.  \pz
Statistically speaking, the much more likely hypothesis to be true
is that these students were below average in their abilities on this exam. \pb

{\large Another example before some formalism}\pz

\begin{example}
We try to use survey methods to understand effects of lifestyle on cholesterol
levels (ideally we could do a double-blind study, but we might not have
the resources for that...). \pz  The average cholesterol level for Americans
is 221, and suppose we know that the standard deviation is 50.  \pz  We take
a sample of 400 people who did {\em not} drive to work and found their average
cholesterol level to be 212.  Does this show that people who commute to work
in some way other than driving have on average less cholesterol? \pz
Answer the same question if in our sample of 400 the average was
218. \pb
\end{example}   

{\large The language of tests of significance}\pz

\begin{definition}
\begin{itemize}
\item An alternative hypothesis ($H_a$) is a claim about some parameter for a population,
often claiming that some condition has an effect. \pz
\item A null hypothesis ($H_0$) is a claim in opposition to an alternative hypothesis, often
claiming that some condition has no effect. \pz
\item A test statistic is one used in comparing the value of some parameter as supposed by the 
null hypothesis with an estimate (confidence interval) from sample data. \pz
\item More formally, the probability assuming $H_0$ is true that the test statistic
would take the observed value is called the P-value of the test.  \pz The smaller
the P-value, the more evidence against $H_0$ and (if we have chosen
an appropriate alternative) for $H_a$. \pz
\item If the P-value is less than or equal to some number $\alpha$ we say that
the data are statistically significant to level $\alpha$. \pb
\end{itemize}
\end{definition}

You may have heard some of these terms bandied about in scientific circles. \pz

\begin{example}
An ecologist collects a liter of water from each of 45 random locations along a stream
and measures the amount of dissolved oxygen.  The mean is 4.62 mg.  \pz Suppose we
know that oxygen concentrations vary according to a normal distribution with deviation
$0.92$mg.  Is the sample mean strong evidence of a true mean less than 5mg. per 
liter? \pb
\end{example}

A little more language:

\begin{definition}
\begin{itemize}
\item A hypothesis is an equality hypothesis if it is of the form $x = a$.  \pz
\item A hypothesis is one-sided if it is of the form $x > a$, $x \geq a$, $x < a$
or $x \leq a$ etc. \pz
\item A hypothesis is two-sided if it is of the form $x \neq a$. \pz
\end{itemize}
\end{definition}

\begin{example}
Categorize the hypotheses in the examples above, both null and alternative,
into one-sided, two-sided, and equalities. \pz
\end{example}

\begin{example}
Sketch the values of a test statistic which support a one-sided, two-sided
or equality alternative hypothesis. \pz
\end{example}

\end{document}
 