\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 Simpson's paradox} \pz

We will not be covering most of the material from chapter 6. \pz
But it is useful to be aware of Simpson's paradox. \pz

\begin{fact}[Simpson's paradox]
It is possible for one individual to outperform another in
every category measured yet to not perform as well
in the aggregate. \pb
\end{fact}

\begin{example}
Let us look at flight delays for two of our local carriers, Alaska 
Airlines and America West Airlines, \pz  the former of which
has a hub in Seattle, the latter in Phoenix. \pz  At their hubs
we have the following data: \pz

\begin{center}
\begin{tabular}{|c|c|c|c|c|}     \hline
 * & Alaska OT & Alaska delayed & AW OT & AW delayed   \\ \hline
PHX      &   221     &  12 & 4840 & 415     \\ \hline
SEA     &   1841 & 305 & 201  &   61  \pz
\end{tabular} 
\end{center}

Calculate the on-time percentage of each airline at each airport. \pz
Calculate the on-time percentage over both airports. \pz  
Explain what you see.  \pz
\end{example}

It is simple to see how Simpson's paradox works if we look at a
simple enough example.  \pz Suppose Dick and Jane both take MA 243
and (somehow!) negotiate negotiate different weightings to compute
their final grades. \pz  Dick has HW count 10\% and the final exam 90\%, \pz
and Jane has HW count 90\% and the final exam count 10\%. \pz
They get A and A-, respectively, on their HW, \pz and C and C- on their
final exams, respectively.  \pz So Dick has scored better on both. \pz
But he ends up with a C+ and Jane with a B+. \pb

Some useful terminology, if thinking in terms of percentages:
there are two ways to take an average, a {\em weighted average} which
depends on the sample sizes, and a ``straight'' average of percentages \pz
(which really is not so straight).  \pz The weighted
average is the one which calculates the true percentage, but it
is susceptible to Simpson's paradox.  \pz A ``straight'' average behaves
predictably in this way, but the final answer depends on the categories
by which the data has been broken down. \pb

{\Large Looking at how data is produced}\pz

So far we have taken data as given and analyzed it.  \pz

For single variables have found mean, median, quartiles, and
seen the standard deviation.
If the variable is normally distributed, we can find answers to
more detailed questions about percentiles. \pz

For many variables, we have taken them two at a time and
compared them through scatterplots.  \pz Using the 
value $r$ and the regression line, we have looked for positive
and negative correlations. \pz

But so far we have not questioned how good our data is. \pz
That is an important question since data analysis, like any
analysis, obeys the maxim ``garbage in, garbage out.''  \pz
We now start to talk about generating reliable data. \pb

{\Large Sampling} \pz

Suppose you have a question you wish to answer about a large
population.  For example, \pz
\begin{itemize}
\item What percent of Americans think George Bush is doing a good job? \pz
\item What percentage of Americans know that the Earth orbits the sun in 
a year?
%\item What percentage of Oregonians are obese? \pz
\item What percent of people with headaches are helped by aspirin? \pz
\end{itemize}\pause 

Gathering data to answer these questions can be problematic. \pz

In all of these cases, there are simply too many people to find out
the answer for each one. \pz  We will see that \emph{carefully}
taking data from a subset, called ``sampling,'' is the best we can do
and can sometimes answer these questions well. \pz

In addition, for the third case, there is a question of how to measure
to what extent aspirin ``helps.'' \pb
%We will discuss what kinds of  questions can give definitive data. \pz

{\large Gathering data}\pz

There are two basic methods of gathering data:

\begin{definition} 
In an \emph{observational} study
one observes individuals and measures variables of those individuals. \pz
\end{definition}

If the study is to lead 
to conclusions about the overall population there are a two things that
must be considered: \pz
\begin{itemize}
\item Does the sample of individuals reflect the overall population?
\item Is the measure of the interesting variables accurate?
\end{itemize}\pause 


\begin{example}
Phoning 1000 randomly chosen residential phone numbers
during the workday, one asks for the answer to two variables,
\emph{age}, and \emph{how many hours of TV the subject watches per
day}. If the phone is not answered, one calls the next number. \pause 
What are possible problems? \pz
\end{example}
%\pause 
%\begin{itemize}
%\item You only reach people with phones! \pause You only reach people who are home during the 
% day.  \pause This may not
%be a good cross-section.  This is a \emph{convenience sample} since it
%has been chosen (in part) for the convenience of the interviewer. \pause 
%\item People are not always honest about how much television they watch.

Understanding what problems may arise in collecting data is an artform
best learned in the discipline or setting in which you are working.  \pz


\pause 
\begin{definition}
In an \emph{experimental} study
one treats a group of individuals in a particular way with the goal of
discovering the effect of that treatment.   \pz
\end{definition}

Experimental studies can be fraught with difficulties. \pz

If this study is to lead
to conclusions about the efficacy of a treatment one must \pz
\begin{itemize}
\item Make certain that there is a group of untreated individuals (a
\emph{control} group) with which to compare the treated indivuals.\pause 
\item One also wants to make sure that there isn't a lurking variable
distinguising between treated and untreated individuals.\pause 
\end{itemize}

\begin{example}
The ``placebo effect'' and other bias in medical studies, and the 
need for ``double-blind'' protocols. \pz
\end{example}

We will discuss this further later. 

%For example, if one is treating an illness, and half the people get
%medicine, and the other half get fake medicine (a placebo) one needs
%to make sure the the individuals are \emph{not} choosing which category they
%are in.  Also one needs to make sure that the person conducting the
%study isn't biased toward putting the sicker people into one group.
%In medicine,  one wouldn't let the people being studied know which
%group they were in, and often one wouldn't let the process by which
%people are assigned to the two groups be done in a way it could be biased.

Summarizing our discussions of data collection:

\textsc{{To get good conclusions, one must be careful
about how one is gathering data and what might be \emph{BIAS}ing
the sample}}\pause 


\begin{example}  A research firm phones 100 clients of
acupuncturists to ask if their treatment has improved their health.
What can one learn from this experiment about the efficacy of
acupuncture? \pz  (Efficacy vs. satisfaction) \pz
\end{example}\pause 

%The group being polled is composed of people who already believe that
%acupuncture may be useful.  It may be further complicated by how these
%100 clients names were obtained.  Further there is no clear way of
%measuring efficacy described, only the patients impression of
%efficacy, and there is no control group.\pause 

%So this survey is really worth nothing.  If the acupuncture patients
%were randomly chosen by the person conducting the study rather than by
%the acunpuncturists, you might be able to measure level of
%\emph{satisfaction} among acupuncture patients. \pause

If you \emph{really} want to measure acupuncture's efficacy, you need
to take a group of people and randomly assign half of them to get
treated by acupuncture, and half to be untreated (as a control group
if you want to compare acupuncture to no treatment) or treated by
western medicine (as a control group if you wanted to compare
acupuncture to western medicine).  This study would be even better if
the patients didn't \emph{know} whether they were being treated via
acupuncture or in the control group.\pause 


\begin{example} A local Eugene TV station asks callers to
phone in during the news  to say if they favor changing the time of
the Eugene Celebration Parade so as not to conflict with the Ducks
game.  What can one learn from this poll? \pb
\end{example}

This called a \emph{voluntary response sample}.  

%First it is
%restricted to viewers of that news program.  Second, it will contain
%more people with extreme positions than a typical sample of
%people who watch that news program since those with strong opinions
%will be more motivated to phone in. \pause 
To draw a conclusion about the population of Eugene, you would want to
poll a randomly selected group of Eugenians.  This kind of data can be
quite hard to get.\pb

\begin{example}
Poll at poll.excite.com:  ``Do you think the Iraq war was worth it?''
(Yes or No).
\begin{itemize}
\item yes: 46\%
\item no: 48\%
\item not sure: 4\%\pause 
\end{itemize}
16,926 answers.  

What is population?  What is sample size?
Is this sample random?  \pause What criticisms should we have of this
sample? \pause What general conclusion can we draw? \pause 
\end{example}

To excite's credit,  the following text appears below the poll results:

``The excite poll\dots  is a voluntary poll for our users, and is not
scientifically projectable to any other population.'' \pb


It is interesting to surf for various polling sites to see their
methodologies.  \pz One particularly interesting 
discussion for lay people is at:
{\tt http://mysterypollster.typepad.com/}. \pb


{\large Simple random sample} \pz

Generally one wants to avoid a
voluntary response sample, and one wants to avoid a \emph{convenience}
sample (chosen for the convenience of the person conducting the
study).

A \emph{simple random sample} is one made by choosing individuals at
random from the entire population. \pause 

Choose simple random sample from classroom.\pause   Get random numbers
from between 1 and 120, and read off until I get 10 people. \pause 
Is this random from class?  Is it random from students at the university?\pz

To be systematic, take the following steps.
\begin{itemize}
\item Label the individuals in your population numerically.  (Example:
students in class labeled 1-120).\pause 

\item Decide how many digits are required to hit all possible labels.  (In
our case, 3).  \pause 

\item Start someplace in Table B reading off groups of that many digits.
Discard numbers outside the range for your population.  (In our
example, if we start at line 129, we get $007, 051, 087, 045$, etc.)
\end{itemize}

This last step can be tedious and can involve discarding a lot of
numbers.  Another possibility is to obtain a randomly generated
sequence of numbers within the range indexing your population, 
say from {\tt http://www.random.org/}. \pz

Some polls use basically this methodology. \pz 
But even when getting a random sample across a population,
some polls will ``correct'' for making sure different
demographics are appropriately represented. \pz 
Neither method seems entirely satisfactory, but that is probably
because of issues inherent in polling complex issues with 
simple questions over populations which are much too small. \pb


{\Large Designing experiments} \pz

In an experiement you want to do something (\emph{treat}) a population
and try to understand what the effect of that treatment is. \pz

\begin{example}
You wish to understand the effect of pricing items so that their prices
end in \$9.   You prepare a catalog in which some items are priced
ending in \$9 and others ending in \$4.  You mail the catalog to
10,000 people and measure sales of items ending in \$4 and in \$9
to draw conclusions.\pause 

What are the weaknesses of such an experiment?
\end{example}

%\pause Even if more of the \$9 items sell,
%you won't know if they just happen to be more appealing items. \pause 

In order to address this weakness, consider the following alternate
experiment. 

\begin{example}
You wish to understand the effect pricing items so that their prices
end in \$9.   You prepare a catalog in which some items are priced
ending in \$9.  You prepare a second catalog in which the same items
are priced one dollar less, so the price ends in \$8. \pz

Out of your group of 10000, you pick 5000 people randomly to send one
catalog to, and you send the other catalog to the other 5000 people.
You keep track of orders for these specific numbers from
these two groups.\pause

How does this experiment design address the weaknesses of the previous
example? \pz
\end{example}

In this case you have a \emph{control group} for your hypothesis that
prices ending in \$9 encourage purchase.  


\end{document}
 