%Include [twoside] option after \documentclass for two-sided printing.
%\documentclass{article}
\documentclass[twoside]{article}
%The following imports commands created for formatting lecture notes.
%This is custom-made and not part of a latex install
\usepackage{lectures}
%The following imports a custom set of stat symbol definitions
\usepackage{statssymbols}
%Define a name for your course here.  At the end, set the course counter to
%the one to compile.  Note there is no MAT_201 inferential stats unit but we
%leave the entry here for consistency.
%Note that custom content can be introduced by using this with the \switch
%command. 
% MAT_201 (EDDT statistics unit)
\newcommand{\eddt}{1}
% STAT_201 (Civil, Environmental, Water Statistics}
\newcommand{\cew}{2}
% STAT_220 (Geomatics stats)
\newcommand{\geo}{3}
\newcounter{coursecounter}
% Set the course to compile here:
\setcounter{coursecounter}{\geo}
%Define your course info here
\institution{SIAST Palliser Campus}
\department{Mathematics}
\switch[\value{coursecounter}=]
\case{\cew}\course{STAT 201}\unitnumber{3}
\case{\geo}\course{STAT 220}\unitnumber{3}
\endswitch
\unittitle{Inferential Statistics}
\date{January 2011}
\title{STUDY GUIDE}
\author{Blake Friesen and Robert G. Petry}
%Note that the publisher is just the distributor of the printed copies and
%has no other claim on the document.  (See the GFDL license.)  It can be
%either a person or entity.
\publisher{the Department of Mathematics, SIAST Palliser Campus}
\begin{document}
%Create title page
\makeunittitle
%Include the copyright, etc. page.  Placed in a separate latex file for
%convenience.
\input{copyright}
%%%%%%%%%
%Make a table of contents.
\customtableofcontents
%Reset the pages to start the actual content and change to arabic numbering
%since \makeunittitle set it to roman numerals.
\setcounter{page}{1}
\pagenumbering{arabic}
\section{Sampling Distributions}
\subsection{Introduction}
The object of statistical sampling is to estimate the value of a
population parameter. Sample statistics provide the information for
making the estimates. To be a useful estimate of the parameter, each
estimate must satisfy two conditions:
\begin{enumerate}
\item It must provide a degree of \textbf{precision}. (How close do we think we are?)
\item It must provide a level of \textbf{confidence}. (What is the probability we are that close?)
\end{enumerate}

\example{A market analyst examined a sample of 500 households in a
  market area.  The research shows that 30\% of the households
  surveyed plan to buy a new vehicle in the next four years. The
  analyst has concluded that if this percentage were projected to the
  whole market area as an estimate of the proportion of households in
  the market area planning to buy a new vehicle in the next four
  years, this value would be within 4\% of the correct value in 95
  samples out of 100.
\begin{center}
\includegraphics[width=3.0in]{image3-1.png}
\end{center}
In this example the degree of precision is 4\%; the level of confidence
is 95\%.}

Sampling always produces estimates.  It is unlikely that the sample
value obtained exactly equals the population value to be estimated.
Why are samples used instead of gathering all of the population data?

The term \textbf{sampling error} is used to represent the difference
between the population parameter and the observed sample statistic.

\example{In the previous market study on buying intentions of
  homeowners, suppose that 35\% of the households in the market area
  actually intend to buy a new vehicle. Our sample results based on
  500 households showed a proportion of 30\%. In this case the
  sampling error is:
\[\serr=\sprop-\pprop = 0.30 - 0.35 = -.05 = -5\%\ .\]
This means that we are 5\% too low in our estimate.}
\clearpage

The sample has to be selected in such a way that the sample statistic
calculated is not \textbf{biased} with respect to the population
parameter.

There are many different ways of drawing a sample from a population. 
Some of these methods are referred to as probability sampling and some
are referred to as nonprobability samples.  Each of these methods of
sampling has specific uses. Probability methods of drawing samples
ensure that the estimate of the parameter used is unbiased.

A \textbf{probability sample} is one in which each member of the
population has a nonzero probability of being included in the sample.

A \textbf{simple random sample} is a probability sample in which each
item in the population has the same probability of being included in
the sample.


\reading{Read the text on page 229 -- 234, 236 -- 240 \& 242 - 247}

A procedure like drawing names from a hat guarantees a simple random
sample.  Before selections can be made like this, each item in the
population must be identified in order to give it a chance of being
selected in the sample.  Rather than draw items from a hat,
statisticians simulate the process by constructing a \textbf{sampling
  frame} and using a table of random numbers to draw from the sample
frame.  A small set of random\footnote{Most computer languages include
  a random number generator so this procedure can be done by machine.
  Modern calculators also have a random number button to produce such
  numbers. Where do computers and calculators get such random numbers?
  Computers are deterministic so there are algorithms which take a
  \emph{seed} number which you provide which they then manipulate
  repeatedly by a function to produce pseudo-random numbers, namely
  digits that appear random and hopefully are equally likely.
  Additionally computers will often keep an \emph{entropy pool} which
  contains random numbers linked to random events such as when you
  last turned on your computer, or touched your mouse and keyboard.
  More recently yet, some computer chip designers have been able to
  make quantum random number generators that exploit the inherent
  probabilities underpinning reality to produce true random numbers.}
digits is given below:
\begin{center}
{\small
\begin{tabular}{ccccccc}
56599 & 62463 & 25114 & 61055 & 45618 & 73993 & 60743\\
85197 & 30682 & 77780 & 08002 & 57545 & 96111 & 23842\\
58835 & 10840 & 63210 & 56254 & 73053 & 09915 & 32766\\
13532 & 75531 & 83167 & 22578 & 12146 & 51981 & 73807\\
64682 & 84233 & 72523 & 21601 & 57214 & 52660 & 19001\\
& & & & \\
12013 & 26749 & 84512 & 64112 & 28201 & 27741 & 84974\\
44599 & 13230 & 91202 & 95529 & 98096 & 05285 & 47421\\
35584 & 27278 & 03848 & 34905 & 85168 & 65804 & 68606\\
13434 & 46602 & 48712 & 58533 & 53769 & 48494 & 87451\\
47749 & 64307 & 69180 & 85351 & 02772 & 97869 & 93451\\
& & & & \\
32188 & 88035 & 98488 & 61690 & 70573 & 78592 & 68315\\
93405 & 81747 & 44672 & 91838 & 87334 & 35692 & 47561\\
40334 & 93806 & 58107 & 33344 & 45968 & 82226 & 11441\\
79081 & 35905 & 94398 & 94027 & 40312 & 91620 & 41141\\
72754 & 96584 & 17577 & 34772 & 53925 & 52740 & 97393
\end{tabular}
}
\end{center}
\example{Construct a sampling frame of a class of 35 students and use
  the table of random numbers to draw a simple random sample of size
  5.}{Construct a sampling frame for the class by assigning each class
  member a two digit number starting at 01 and sequentially ending
  with the last class member, student 35. Read down the first two
  digits of the first column selecting the first five numbers that
  appear in sequence that are in the range from 01 to 35 and rejecting
  those numbers outside of the range.}

\clearpage
In many applied sampling situations, all the items in the population are
not available.  Only the sample observations are known.

\example{A sample of 10 families from a new large suburb are surveyed
regarding the balance owing on their house mortgages.  The following
balances were observed: (\$)
\begin{center}
\begin{tabular}{ccccc}
145,000 & 280,000 & 282,000 & 290,000 & 350,000 \\
358,000 & 402,000 & 466,000 & 664,000 & 714,000
\end{tabular}
\end{center}
\begin{enumerate}
\item What is the estimate of the population mean?
\item If another sample of size 10 were drawn, do you think that the
same sample estimate of \pmean\ would occur?
\item What is an estimate of the population standard deviation?
\item If another sample of size 10 were drawn, do you think that the
same sample estimate of \pdev\ would occur?
\item Draw a sketch of the distribution of balances in the community
based on a normal curve assuming the estimates of the parameters are
accurate.\vspace{2in}
\item Without the assumption of normality is the sketch accurate?
\item Where is a balance of \$450,000 located in the distribution?
\item Is there a lot or a little variation in balances?
\item What is the sampling error in the estimate of \pmean\ if we know
the population mean, \pmean, is \$396,000?\vspace{.5in}
\item Why is it not always possible when sampling to find the exact
sampling error in a sampling procedure as was done in the last question?\vspace{.5in}
\end{enumerate}}

\subsection{The Central Limit Theorem}

In an applied sampling problem, usually one sample is drawn for purposes
of determining the population parameter.  In theory, it is possible to
draw many more samples.

\example{In Saskatchewan there are about 180,000 residents in the age
group between 15 and 25 years of age. A market analyst would like to
make projections about this group based on a sample of size 1000
individuals. Imagine that the parameter of interest is related to the
sporting industry and concerns the average expenditure per individual
on sporting equipment per year.
\begin{center}
\includegraphics[width=3in]{image3-2.png}
\end{center}
A list of 1000 expenditures is drawn without replacement from 180,000
expenditures. To have 100\% confidence that we have the exact value of 
\pmean, all 180,000 values would have to be identified. The value that
we observe in the sample depends on which values are drawn in the
sample. If we sample without replacement, there are  \com{180,000}{1000}
different samples that could be obtained each with its own mean. If we sample with replacement then there are $180,000^{1000}$ possible samples.  The
size of this combination or power is too large for purposes of visualizing all
the different possible sample possibilities. The sampling error in our
estimate depends on which sample we happen to select.}

The previous example illustrates the following points which will be
true when we try to estimate any population parameter with a sample
statistic:
\begin{itemize}
\item There are usually a large number of samples that are possible
  (\com{\np}{\ns} without replacement, $\np^\ns$ with replacement).
\item Each sample will generate a sample statistic (e.g. \smean) which
  will estimate the population parameter (e.g. \pmean).
\item Each such sample statistic will be in error; it will differ from
  the population parameter by its sampling error \serr.  The sample
  statistics in general do not equal each other and therefore neither
  will their errors.
\end{itemize}
These points make it clear that for an individual sample mean, \smean,
to be useful one has to have some idea how close it is to the true
population mean, \pmean.  To analyze the problem we consider a
\textbf{sampling distribution}.  Suppose we took all possible samples
of size \ns\ from the population and measured the sample statistic
(e.g. \smean).  The frequency of these mean values would themselves
form a distribution.

The above example is too large to study the sampling distribution of
the mean so let us consider a simple example where the total number of
possible samples is manageable. This situation is too small to
actually use sampling techniques to analyze but we will use this
example because it is small enough to visualize all of the possible
samples that can occur.

% The following is for some asymptote code which is used below in our
% example.  Unfortunately asymptote code breaks within our example command.
% I can perhaps fix this along the lines of my alignvert.sty package which
% seems to wrap the code to get around this with a box.
\newbox\cltgraphs
\setbox\cltgraphs=\hbox{%
\begin{asy}
  import graph;
  size(6cm,0);
  xaxis(xmin=0, xmax=10, arrow=Arrow(SimpleHead), LeftTicks(Label(fontsize(9pt)),Step=1, step=.5, OmitFormat(10), begin=false, end=false));
  labelx(scale(.7)*"$\X\ \left[\mbox{occupants}\right]$",(5,-.5),S);
  yaxis(ymin=0, ymax=6, arrow=Arrow(SimpleHead), LeftTicks(Label(fontsize(9pt)),Step=1, OmitFormat(0,6), begin=false, end=false));
  labely(scale(.7)*"$P(\X) \left[\frac{1}{16}\right]$",(-1,3),W);
  label(scale(.7)*minipage("\centering Distribution of Occupants\\ in Village", width=5cm),point(N));
\end{asy}
~~~~~~~~~~
\begin{asy}
  import graph;
  size(6cm,0);
  xaxis(xmin=0, xmax=10, arrow=Arrow(SimpleHead), LeftTicks(Label(fontsize(9pt)),Step=1, step=.5, OmitFormat(10), begin=false, end=false));
  labelx(scale(.7)*"$\smean\ \left[\mbox{occupants}\right]$",(5,-.5),S);
  yaxis(ymin=0, ymax=6, arrow=Arrow(SimpleHead), LeftTicks(Label(fontsize(9pt)), Step=1, OmitFormat(0,6), begin=false, end=false));
  labely(scale(.7)*"$P(\smean) \left[\frac{1}{16}\right]$",(-1,3),W);
  label(scale(.7)*shift(5mm*N)*minipage("\centering Distribution of Mean Number of Occupants in Samples (\ns=2)",width=5cm),point(N));
\end{asy}
}
\example{Suppose a social scientist drives through a small village
  consisting of 4 households. Each household has a different number of
  occupants specified by the number inside the graphic
  below.\footnotemark\ Imagine this to be a sampling situation where the
  scientist can only observe some of the households. The scientist is
  interested in the mean number of occupants per household in the
  village. Suppose 2 households are selected.
\begin{center}
\includegraphics[width=2.5in]{image3-3.png}
\end{center}

How many samples of size 2 can the analyst draw from this village?  This
depends upon how the sampling is done.
\begin{itemize}
\item If sampling is done \textbf{without replacement}, the answer is
  \com{4}{2}. Confirm that \com{4}{2} = 6.
\item  If sampling is done \textbf{with replacement}, the answer is $4^2 = 16$.
\end{itemize}
In this type of problem sampling would likely be done without
replacement but in problems where the sample size is a small fraction
of the population the calculations can be done assuming sampling is
done with replacement and the population looks the same from one draw
to the next.  For our purposes we will sample with
replacement.\footnotemark

The following table shows the 16 possible samples based on
sampling with replacement.  (Place the mean to the right of the sample
for each possibility).
\begin{center}
\begin{tabular}{c|l|l}
Sample & Sample Mean, \smean & ~~~~~$\smean^2$~~~~~~ \\ \hline
(2,2) & & \\
(2,4) & & \\
(2,6) & & \\
(2,8) & & \\
(4,2) & & \\
(4,4) & & \\
(4,6) & & \\
(4,8) & & \\
(6,2) & & \\
(6,4) & & \\
(6,6) & & \\
(6,8) & & \\
(8,2) & & \\
(8,4) & & \\
(8,6) & & \\
(8,8) & & \\ \hline
& $\displaystyle\sum\smean=$ & $\displaystyle\sum\smean^2=$\\
\end{tabular}
\end{center}
The above table shows that when drawing random samples, the sample
mean is itself a variable.\footnote{If the sample statistic \smean\ is
  itself a \emph{variable}, what is the \emph{population} it is
  measuring?} This collection of observations for the sample mean is
called the \textbf{sampling distribution of the mean}.

\textbf{Questions on this Sampling Distribution Example}
\begin{enumerate}
\item On your calculator, calculate the population mean and standard
  deviation of the measured values (2, 4, 6, and 8).

 $\displaystyle \pmean= \hspace{2in} \pdev=$
\item Calculate the mean of the sample mean column.

$\displaystyle \pmean_{\smean}=\frac{\sum\smean}{16}=$
\item How does the mean of all sample means, $\pmean_{\smean}$ compare
  to the mean of the \X\ values in the population, \pmean?
\item If the third sample is the one randomly chosen, what is the
sampling error in estimating \pmean?

$\displaystyle \serr=\smean-\pmean=$
\item Calculate the standard deviation of the sample mean column.

$\displaystyle \pserrmean=\sqrt{\frac{\sum\smean^2}{16}-\left(\frac{\sum\smean}{16}\right)^2}=$
\item How does the standard deviation of the \smean\ values, \pserrmean,
compare to the standard deviation of the \X\ values in the population, \pdev?
\item Complete the following tables for the probability distribution of \X\ and \smean.
\begin{center}
\resizebox{2.8in}{!}{%
\begin{tabular}{c|r}
\X & ~~~~P(\X)~~~~~~ \\ \hline
2 & /4~ \\
4 & /4~ \\
6 & /4~ \\
8 & /4~ \\ \hline
& $\sum P(\X)=~~~~$
\end{tabular}~~~~~~~~~~~% 
\begin{tabular}{c|r}
\smean & ~~~~P(\smean)~~~~~~ \\ \hline
2 & /16~ \\
3 & /16~ \\
4 & /16~ \\
5 & /16~ \\
6 & /16~ \\
7 & /16~ \\
8 & /16~ \\ \hline
& $\sum P(\smean)=~~~~$
\end{tabular}}
\end{center}
\item Now make histograms for these two probability distributions.
  Add a frequency polygon to your distribution of $P(\smean)$.
\begin{center}
\resizebox{4.5in}{!}{\usebox\cltgraphs}
\end{center}\vspace{1em}
\item What is the shape of the distribution of sample means?
\end{enumerate}
}
%We have to play with the footnote counter to get the numbers correct at the
%bottom of the page.
\addtocounter{footnote}{-2}%
\footnotetext{In this example having a different number of occupants
  in each household will make our visualization of the samples easier,
  but it is unnecessary.  Try to think how you would approach the
  analysis if two of the houses had the same number of occupants.}
\addtocounter{footnote}{1}%
\footnotetext{See problem \ref{item:withoutreplacement} on page~\pageref{assign:meansamp} for an analysis of the problem sampling without replacement.}

The behaviour of the distribution of the mean is summarized by the
\textbf{Central Limit Theorem (\CLT)}.  It states the following:
\begin{enumerate}
\item The \textbf{shape} of the distribution of sample means
  approaches a \textbf{normal curve}, as the size of the sample grows
  larger when sampling from a large population.  For sample sizes of
  $\boxed{\ns\ge 30}$ the distribution of \smean\ will be approximately normal.

  ** Look at the shape of the frequency polygon in your diagram on the
  right, it is symmetrical but it does not have enough points to
  produce a smooth bell shape. If our sample size had been 30 or more rather than 2 the shape would be very close to a bell curve. **
\item The mean of the sampling distribution is the same as that of the
population.
\[\pmean_{\s\smean}=\frac{\sum{\smean}}{\com{\np}{\ns}\ \mbox{or}\ \np^\ns}=\pmean\]
\begin{center}
** Examine your two graphs. Their balance points are identical. **
\end{center}
\item The standard deviation of the sampling distribution, called the
  \textbf{standard error of the mean}, is less than the standard
  deviation in the population.  If we are sampling from a distribution
  that is very large compared to the size of the sample
  $(\ns/\np<.05)$ or we are sampling with
  replacement as above, the standard error is found by:
\[\boxed{\pserrmean=\frac{\pdev}{\sqrt{n}}}\]
\begin{center}
** Verify this holds for the standard deviations you found above. **
\end{center}
\end{enumerate}

As \ns\ becomes large relative to \np, the standard error becomes
small due to the $\sqrt\ns$ in the denominator which also gets larger.
A small standard error means that little variation can be expected
from one sample mean to the next. Any sample mean we observe for
purposes of estimating \pmean\ is expected to have little sampling
error and so is a good estimate.
\example{Suppose a population variable has a standard deviation \pdev\
  of 12 cm and a mean \pmean\ of 115 cm.  Random samples are drawn
  from this population for the purpose of analyzing the expected
  variability in sample means from 115 cm.  Compute the standard error
  of the mean, \pserrmean, if samples of size 50, 100, 500, and 5000
  are drawn from the population.  Assume we are sampling without
  replacement but that the population is large with respect to the
  sample size, $\ns/\np<.05$\ .}%
{Since all of our sample sizes are 30 or more, the \CLT\ states that
  the samples will have means that are normally distributed.  The fact
  that
\[\frac{\ns}{\np}=\frac{\ns}{\mbox{``\,large\,''}} \approx 0 <.05\]
means we can use the formula above for the standard error of the
mean.
\begin{center}
\begin{tabular}{c|r}
\rowrulesmall\ns & $\pserrmean=\frac{\pdev}{\sqrt{\ns}}$ (cm)\\ \hline
\rowrulesmall~~50 & $\frac{12}{\sqrt{50}}=1.70$ \\
\rowrulesmall~100 & $\frac{12}{\sqrt{100}}=1.20$ \\
\rowrulesmall~500 & $\frac{12}{\sqrt{500}}=0.54$ \\
\rowrulesmall5000 & $\frac{12}{\sqrt{5000}}=0.17$
\end{tabular}
\end{center}
If we plotted several of these distributions they would look as follows:
\begin{center}
\includegraphics[width=3in]{image3-7.png}
\end{center}
As \ns\ becomes large relative to \np, the standard error becomes
small.  A small standard error means that little variation can be
expected from one sample mean to the next. The larger sample size
ensures that any sample mean we measure is much more likely to lie
near the unknown population mean we are trying to estimate. In other
words, any sample mean we observe for purposes of estimating \pmean\
is expected to have little sampling error.  This is why we prefer larger
samples.}
\reading{Read your textbook pages 248-250 \& 252 - 253}

\subsection{The Central Limit Theorem Applied}
To aid in understanding the \CLT\ we can solve conceptual problems
involving the likelihood of finding a given sample statistic if the
population parameters are known.  In practice the latter is not
usually the case -- we are taking a sample to estimate an unknown
population parameter.  We will see in later sections how we can use
the \CLT\ to our advantage in this estimation and for hypothesis
testing. For now, however, consider the following simpler conceptual
problem.
\example{A fast food service has a very large clientele.  On the
  average it takes 2 minutes with a standard deviation of 1 minute to
  take an order from a customer.  Suppose a simple random sample of
  100 customers is observed, what is the probability that the average
  time \smean\ it takes to take a customer's order within the sample
  is:
\begin{enumerate}
\item Between 2 and 2.1 minutes?
\item Less than 1.8 minutes?
\item Over 3 minutes?
\end{enumerate}}%
{Notice that there is no information about
the shape of the distribution of times to take a
customer's order among all of the clientele.  It may be
skewed or bimodal.  It could look like this:
\begin{center}
\includegraphics[width=4in]{image3-8.png}
\end{center}
Since $\ns=100\ge 30$ the \CLT\ guarantees us that if all possible samples of size 100 are
taken from this population of times, the distribution of mean times
from sample to sample will be a normal curve.
The mean and standard deviation of this sampling distribution are
known.  The mean of the sampling distribution is the same as that of
the population, namely
\[\pmean_{\smean}=\pmean=2\ \mbox{min}\ .\]
The standard deviation of the sampling distribution (the standard
error of the mean) is less than the standard deviation of the
population.\footnotemark
\[\pserrmean=\frac{\pdev}{\sqrt{\ns}}=\frac{1\ \mbox{min}}{\sqrt{100}}=0.1\ \mbox{min}\]

The sampling distribution of mean times would look like this:
\begin{center}
\includegraphics[width=5in]{image3-9.png}
\end{center}

Since the shape, mean, and standard deviation of the sampling
distribution curve are known, the probability associated with an
interval under this curve can be found by using a table of areas under
the normal curve, where \Z\ on the sampling curve is found by:
\[\boxed{\Z=\frac{\smean-\pmean}{\pserrmean}}\]
\begin{enumerate}
\item For example, to find $P(2\ \mbox{min}<\smean<2.1\
  \mbox{min})$, find the \Z\ values for \smean's of 2 and 2.1
  minutes.  Since 2~minutes is the mean, its \Z\ value is 0.00\ .
\begin{center}
\includegraphics[width=5in]{image3-10.png}
\end{center}
If $\smean=2.1$ minutes then
$Z=\frac{\smean-\pmean}{\pserrmean}=\frac{2.1-2}{0.1}=1.00$\ .

Look up the area between centre and Z = 1.00 in the table. The answer is
0.3413.

The proper use of probability symbols in this case is:
\[P(2\ \mbox{min}<\smean<2.1\ \mbox{min})=P(0.00<\Z<1.00)=0.3413\]
Caution:  A common error is to use the population standard deviation
rather than the standard error for the standard deviation in the Z
value calculation.
\end{enumerate}

Compute the answers to parts 2 and 3 by drawing the diagrams,
shading in the correct region and doing the calculation. Satisfy
yourself that they should be as follows.
\begin{enumerate}
\addtocounter{enumi}{1}
\item ~
\begin{center}
\includegraphics[width=4.5in]{image3-11.png}
\end{center}
\[P(\smean<1.8\ \mbox{min})=P(\Z<-2.00)=0.0228\]
\item ~
\begin{center}
\includegraphics[width=4.5in]{image3-12.png}
\end{center}
\[P(3\ \mbox{min}<\smean)=P(10.00<\Z)=0.0000\]

Notice that if we had just asked the probability that a single order
(\X) was longer than 3 minutes the answer would have been, if the
underlying population variable \X\ were normally distributed,
\[P(3\ \mbox{min}<\X)=P(1.00<\Z)=0.1587\ .\] The result here is
significantly different than that of the sample mean due to the use of
the standard deviation when calculating~\Z.
\end{enumerate}
}
\footnotetext{The finite correction factor (see
  Section~\ref{subsubsec:finitepop}) is not required here because it
  is stated that the population is very large so the sample is of
  insignificant size ($< 5\%$) relative to the population and the \FCF\
  would be very close to 1.  Note that the underlying population here
  is the orders, not the customers so a large clientele implies a
  large number of orders.  Even a pub with only 20 regular customers
  would still have a large number of orders (effectively infinite)
  over time.}

\subsection[Extending the \CLT]{Extending the Central Limit Theorem}
The central limit theorem describes the behaviour of the distribution
of sample means.  In the previous examples, it has been demonstrated
that the sample mean is itself a random variable.  When one sample is
drawn from a population, the only information that is known about the
population mean is that the mean of this sample is one of the possible
sample means.  If the conditions of the \CLT\ are met, then this
sample mean will lie on a normal distribution curve that has the
population mean as its centre.

The central limit theorem as stated requires a sample size of
$\ns\ge 30$.  When sampling without replacement we also have required a
population that is much larger (``infinite'') compared to the sample
size ($\ns/\np<.05$).  If these conditions do not hold then some
adjustments must be made about some of the statements in the central
limit theorem.

\subsubsection{Finite Populations}
\label{subsubsec:finitepop}
If the population cannot be considered to be infinite, that is when
the \textbf{sample size constitutes 5\% or more of the population},
there will be less variation among sample means than can be expected
by the \CLT\ when we are sampling \textbf{without replacement}.  In
this case the \textbf{finite correction factor ($\bm{\FCF}$)} is applied to
the standard error of the mean, 
\[\boxed{\pserrmean=\left(\FCF\right)\cdot\frac{\pdev}{\sqrt{\ns}}}\ ,\]
where
\[\boxed{\FCF=\sqrt{\frac{\np-\ns}{\np-1}}}\ .\]
Since the $\FCF\le 1$, its inclusion makes the standard error smaller.
\example{Repeat the last example ($\pdev=12$~cm, $\pmean=115$~cm) but
  now with a population of size $\np= 10,000$.  Compute the standard
  error of the mean if samples of size 50, 100, 500, and 5000 are
  drawn without replacement from the population.}%
{\begin{center}
\begin{tabular}{c|c|c|r}
\ns & $\ns/\np$ & $\FCF=\sqrt{\frac{\np-\ns}{\np-1}}$ & $\pserrmean=\left(\FCF\right)\cdot\frac{\pdev}{\sqrt{\ns}}$ (cm)\\ \hline
\rule{0em}{1.5em}~~50 & .005 & $\sqrt{\frac{9950}{9999}}=.9975$ & $\sqrt{\frac{9950}{9999}}\cdot\frac{12}{\sqrt{50}}=1.69$ \\
\rule{0em}{1.5em}~100 & .010 & $\sqrt{\frac{9900}{9999}}=.9950$ & $\sqrt{\frac{9900}{9999}}\cdot\frac{12}{\sqrt{100}}=1.19$ \\
\rule{0em}{1.5em}~500 & \boxed{.050} & $\sqrt{\frac{9500}{9999}}=\boxed{.9747}$ & $\sqrt{\frac{9500}{9999}}\cdot\frac{12}{\sqrt{500}}=\boxed{0.52}$ \\
\rule{0em}{1.5em}5000 & \boxed{.500} & $\sqrt{\frac{5000}{9999}}=\boxed{.7071}$ & $\sqrt{\frac{5000}{9999}}\cdot\frac{12}{\sqrt{5000}}=\boxed{0.12}$
\end{tabular}
\end{center}
For \ns\ small relative to the size of \np, that is for $\ns/\np <
.05$, the size of the \FCF\ is approximately 1, and as a result makes
very little difference to the value of the standard error from the
last example.  In these two cases ($\ns=50$, $\ns=100$) the population
is effectively infinite and we can neglect the \FCF~.  For the cases
where $\ns/\np \ge .05$ the \FCF\ differs significantly from 1 and
introduces a significant modification to the standard error in the
mean as can be seen by comparing the entries (boxed) for $\ns=500$ and
$\ns=5000$ to their previous values.  In these cases the finite size
of the population is noticeable.

Note that had we sampled with replacement, no \FCF\ would have been
required regardless of the sample size.  \textbf{We will always assume
  we are sampling without replacement unless stated otherwise.} Therefore
test to see if $\ns/\np < .05$\ .  If it is not, the \FCF\ is required.}

\subsubsection{Small Samples}
The sampling distribution of the mean is always symmetrical in shape
regardless of the size of the sample or the shape of the population
from which the sample is drawn.  If the sample size is thirty or more
and the population is infinite the distribution of sample means will
always be normal regardless of the shape of the population
distribution from which the sample is drawn. However sometimes large
samples are very expensive or impossible to get.

If the sample size is less than~30, the sampling distribution of the
mean is no longer normal.  However if the variable \X\ itself is known
to have a normal distribution then the sample mean \smean\ also will
be normally distributed.  However, for reasons that will be discussed
in Section~\ref{subsec:smallmean} the small sample size problems we
will be interested in ultimately require the use of what is called a
\textbf{$\bm{\T}$ distribution}.

If the \CLT's conditions are met (infinite population, large sample),
one could wonder why we do not use the finite correction factor and a
\T-distribution even then if the results are more accurate.  In
principle we could and some do.  However, in this course the neglect
of the \FCF\ for infinite populations and the use of a normal
distribution for large sample size will be used both because it is
easier and also to give a better understanding of what is going on.

\newcommand{\meansampanswers}{\begin{enumerate}
\item\begin{enumerate}
\addtocounter{enumi}{1}
\item $P(\$9550<\smean<\$9650)$\newline
$=P(-2.50<\Z<2.50)=0.9876$
\item $P(\$9660<\smean)$\newline
$=P(3.00<\Z)=0.0013$
\end{enumerate}
\item\begin{enumerate}
\addtocounter{enumi}{1}
\item $P(2300\ \mbox{kg}<\smean<2700\ \mbox{kg})$\newline
$=P(-1.80<\Z<1.80)=0.9282$
\item $P(\smean<2000\ \mbox{kg}\ \OR\ 3000\ \mbox{kg}<\smean)$\newline
$=P(\Z<-4.50)+P(4.50<\Z)\approx 0$
\end{enumerate}
\item\begin{enumerate}
\item $P(76\%<\smean)=P(1.12<\Z)=.1314$
\item 95\% of all sample means would fall between 73.25\% and 76.75\%
\end{enumerate}
\item\begin{enumerate}
  \item $\pserrmean=\pdev$.  The mean of a sample of size 1 is the
    same as measuring \X.
\item $\pserrmean=0$ since $\FCF=0$.  No uncertainty as the sample mean is the population mean.
\end{enumerate}
\item\begin{enumerate}
  \item \{2,4\}, \{2,6\}, \{2,8\}, \{4,6\}, \{4,8\}, \{6,8\}\newline
    Note that when sampling without replacement we use selections
    (order does not matter), while when sampling with replacement the
    samples are permutations.  (Hence our use of braces here rather
    than parentheses.)
\item $\pmean_{\smean}=5\ \mbox{occupants}=\pmean$
\item $\pserrmean=\sqrt{\frac{5}{3}}\ \mbox{occupants}=\sqrt{\frac{4-2}{4-1}}\cdot\frac{\sqrt{5}}{\sqrt{2}}$\newline
$=(\FCF)\cdot\frac{\sqrt{\pdev}}{\sqrt{\ns}}$
\item The distribution $P(\smean)$ is not normal. (Graph it!)
\end{enumerate}
\end{enumerate}
}
\clearpage
\assignment{\label{assign:meansamp}\answer{\protect\meansampanswers}
For any conceptual problem involving application of the \CLT\ :
\begin{compactenum}[$\Rightarrow$]
\item Draw a Venn diagram with labeled parameters and statistics.
\item Draw a sampling curve with appropriate labels and the region
  that answers the question shaded.
\item Use the proper symbols for sampling distributions and probability.
\end{compactenum}
\begin{enumerate}
\item The average income in a country of 2,500,000 people is \$9600 with
a standard deviation of \$640.  A simple random sample of 1024 of the
citizens of this country is selected and their average income is
computed.
\begin{enumerate}
\item Draw a diagram of the sampling distribution of the mean.
\item What is the probability of observing a sample average within
  \$50 of the population average?
\item What is the probability of observing a sample average that is
more than \$60 higher than the population average?
\end{enumerate}
\item The average weight of a vehicle traveling on a municipal road is
2500 kg with a standard deviation of 700 kg.  A simple random sample of
40 vehicles traveling the road is selected.
\begin{enumerate}
\item Draw a diagram of the sampling distribution of the mean.
\item What is the probability of observing a sample mean within 200
kg of the average weight?
\item What is the probability of observing a sample mean that
differs from the average weight by more than 500 kg?
\end{enumerate}
\item A personnel test is administered to 500 applicants.  A simple
random sample of 100 scores is selected from the group of all test
scores.  The average test score for all people writing the test is
75\% with a standard deviation of 10\%.
\begin{enumerate}
\item What is the probability the sample mean will be above 76\%?
\item Between what two values would the average for the sample fall in
  95 cases out of 100?
\end{enumerate}
\begin{center}
 ** Caution:  How does \ns\ compare with \np\ and what are the implications? **
\end{center}
\item What happens to the standard error in the mean, \pserrmean, when
  \begin{enumerate}
  \item The sample size is just one, $\ns=1$\ ?
  \item The sample is the whole population, $\ns=\np$\ ?
  \end{enumerate}
  Explain your answers.
\item \label{item:withoutreplacement}Repeat the example of sampling two of the four houses in the
  village for the number of occupants, but now sampling without
  replacement.
\begin{enumerate}
\item What are the $\com{4}{2}=6$ possible samples?
\item What is the mean of the sample means, $\pmean_{\smean}$? Compare
  it to the population mean,~\pmean.
\item What is the standard error of the mean, $\pserrmean$?  Show that
  it satisfies the equation for \pserrmean\ of the \CLT\ if the finite
  correction factor is used.
\item Which of the conclusions of the \CLT\ are not true in this example? 
\end{enumerate}
\end{enumerate}
}
\reading{Exercises pp 251-252 \& 256-261}

\subsection{Sampling Distribution of Proportions}
\label{subsec:samplingproportions}

Every sample statistic has a sampling distribution.  That is, for any
given sample statistic, there is bound to be some variation observed
from sample to sample in the sample statistic.  The \CLT\  describes the
behaviour of the variation among sample means.  The distribution of
sample modes, sample medians or sample standard deviations could be
analyzed in a similar manner.  Each of these distributions would have
the same attributes related to shape, centre and variability. 

Another statistic of importance whose value varies from sample to sample
is the sample proportion p. The symbol for the population parameter is
${\pi}$.

\example{Suppose a simple random sample of 50 people is selected from
  a large group of people.  It is found that 30 people in the sample
  are in favour of more wind power generation.  Estimate the
  proportion of the population in favour of more wind power
  generation.}%
{\begin{center}
\includegraphics[width=5in]{image3-13.png}
\end{center}

Is it likely that  $\sprop=\pprop$?  If we took another sample of size 50
we are unlikely to observe the same \sprop\ value?}

Large samples are always used to estimate population proportions. For
samples of fixed size $\ns$, the distribution of the sample proportion
has the following three features.
\begin{enumerate}
\item The distribution of \sprop\ approaches a normal curve as \ns\
  increases.  The normal approximation is valid provided $\ns\pprop>5$
  and $\ns(1-\pprop)>5$.
\item The mean of all sample proportions is the population proportion, \pprop:
\[\pmean_{\sprop}=\pprop\]
\item The standard deviation of sample proportions, called the
  \textbf{standard error of proportion}, is found
  by\footnote{Note:\begin{itemize}\item The similarity to the standard
      deviation formula of the binomial probability distribution is no
      coincidence.  The result arises from the fact that the binomial
      distribution is approximately normal under the constraints given
      above.  The connection between a binomial probability and a
      sample proportion is demonstrated in problem 2 on
      page~\pageref{assign:propsamp}\ .
    \item Some use $\ns\pprop>10$ and $\ns(1-\pprop)>10$ for the realm
      of validity.  Once again see problem 2 for an example of the
      magnitude of error introduced near the cutoff.\end{itemize}}
\[\boxed{\pserrprop=\sqrt{\frac{\pprop\cdot\left(1-\pprop\right)}{n}}}\]
\end{enumerate}

\example{In the previous example, suppose that \pprop, the proportion
  of the population who support more wind power, is 0.65.  What is the
  probability of finding a sample proportion, p, between 0.60 and
  0.65?}%
{Since we have that $\ns\pprop=(50)(.65)=32.5>5$ and
  $\ns(1-\pprop)=(50)(.35)=17.5>5$, \sprop\ should be approximately
  normally distributed.  Draw the sampling distribution curve for the
  statistic.
\begin{center}
\includegraphics[width=4.5in]{image3-14.png}
\end{center}
The mean of the sampling distribution curve is the same as the
population proportion 0.65 but the standard error or proportion is:
\[\pserrprop=\sqrt{\frac{\pprop\cdot\left(1-\pprop\right)}{n}}=\sqrt{\frac{(0.65)(.35)}{50}}=0.0675\]

Compute the \Z\ value under the normal curve that corresponds to a \sprop\
value of 0.60 and 0.65. For $\sprop=0.60$,
\[\Z=\frac{\sprop-\pprop}{\pserrprop}=\frac{.60-.65}{0.0675}\;=-0.74\]
The area between centre and that \Z\ value in the table is 0.2704.  The
answer written in proper probability symbols is:
 \[P(0.60<\sprop<0.65)=P(-0.74<\Z<0)=0.2704\]

**Caution: A common confusion here is calculating the value of the
standard deviation of this sampling distribution using \sprop\ rather than \pprop.}

For the rest of the unit we will be dealing with problems involving
either sample means, \smean, or sample proportions, \sprop.  To
identify the type of problem that you are working with, it is helpful
to note that in sample mean problems the underlying variable \X\ is
always quantitative, since it is something that has to be averaged.
For a proportion problem, the underlying variable \X\ is qualitative
since we are calculating the proportion of the population that
satisfies some criterion.  As such the values of the variable are
either $\X=\mbox{true}$ (satisfies the criterion) or $\X=\mbox{false}$
(does not satisfy the criterion).  To simplify the notation when
dealing with proportions as done in the last problem we will tend to
write $\sprop=\frac{\X}{\ns}$ where here \X\ means the number of
sample elements satisfying the criterion.  As such our usage of \X\
here corresponds to the count appearing in the binomial distribution.
Finally note that as a proportion, it must be the case that $\sprop$
be dimensionless and satisfy $0\le\sprop\le1$\ .
\clearpage
\newcommand{\propsamplinganswers}{\begin{enumerate}
  \item $P(\sprop<.43\ \OR\ .47<\sprop)$\newline
    $=P(\Z<-1.29)+P(1.29<\Z)=.1970$
  \item\begin{enumerate}
    \item $P(.1<\sprop<.2)$\newline $=P(-1.37<\Z<0.00)=.4147$
    \item $P(3\le\X\le 6)$\newline$=P(3)+P(4)+P(5)+P(6)$\newline
$=.0785+.1325+.1723+.1795=.5628$
    \item $P(.0833<\sprop<.2166)$\newline
      $=P(-1.60<\Z<0.23)=.5362$\newline Comparing to (b) shows a
      smaller difference than between (a) and (b). Note that
      $\ns\pprop=6$ which shows we are close to being outside of the
      region of validity for $\sprop$ to be approximately normal so
      some difference is expected.
    \end{enumerate}
    \end{enumerate}
  } 
\assignment{\answer{\protect\propsamplinganswers}%
\label{assign:propsamp}
\begin{enumerate}
\item Currently the ruling political party in a large country is
supported by 45\% of the voters.  If a simple random sample of 1024
voters is chosen in this country, what is the probability that the
proportion in the sample in favour of the ruling party differs by more
than 2\% from the population proportion?
\item A large box of batteries contains 20\% that are defective.  A
simple random sample of 30 batteries is chosen.  What is the
probability of finding from 3 to 6 batteries in the sample defective
\begin{enumerate}
\item Using the normal approximation for a sample proportion?
\item Using an exact binomial probability formula calculation?
\end{enumerate}
Your answers should differ considerably. One reason is that we are
approximating the discrete binomial probability distribution with a
continuous distribution.  For instance if we wanted to evaluate the
probability of exactly $\X=3$ defective batteries we would need to
evaluate the area under the continuous normal curve for the proportion
range corresponding to 2.5 to 3.5 defective batteries.
\begin{enumerate}
  \addtocounter{enumii}{2}
\item To improve on our approximation, redo part (a) using the
  proportions for 2.5 to 6.5 defective batteries instead and compare
  this with the actual answer in~(b).  Modifying intervals in this
  ways is referred to as introducing a \emph{continuous correction
    factor}.
\end{enumerate}
\end{enumerate}
}

\section[Point Estimates \& Confidence Intervals]{Point Estimates and Confidence Intervals}
\subsection[Confidence Intervals for the Mean]{Confidence Intervals for the Population Mean (Large Samples)}
The previous sections have demonstrated the theoretical working of the
\CLT\ for sample means and the equivalent theorem for sample
proportions. We will modify this slightly to apply the theory in a
practical setting.

In all of the sampling theory developed so far, the assumption was
made that the population parameters were known.  For example, to
compute $\pmean_{\s\smean}$ or \pserrmean, the
assumption is made that \pmean\ and \smean\ are known.  If this were
the case, there would be no need to sample because one would never use
an estimate if an exact value were available.

In practice only one sample is selected.  This means that we have
exactly one point known to us on the whole sampling distribution curve.
 The exact position of this point on that curve is also unknown to us.

 \example{A simple random sample of 50 wage earners from a population
   of 10,000 is selected.  The average wage in the sample is \$42,000
   with a standard deviation of \$5000.  Suppose we wish to estimate
   \pmean.  If another sample of size 50 was chosen, is it likely that
   we would see the same sample statistics?}%
 {Because the sample size exceeds 30, the only thing known here is:
\begin{center}
\includegraphics[width=4.5in]{image3-15.png}
\end{center}
We do not know whether to place the \smean\ we observed to the right
or to the left of \pmean.  The best we can say is that
$\pmean\approx\smean=\$42,000$.}  We call sample statistics such as
these \textbf{point estimates} of the parameter because they represent
only one of the many possible points on the distribution curve.
\begin{center}
\begin{tabular}{c|c}
Parameter &  Point Estimate \\ \hline
\pmean & \smean \\
\pdev & \sdev \\
\pprop & \sprop
\end{tabular}
\end{center}
The problem with point estimates is that there is no way to assess how
precise they are or how much confidence to place in them.  To satisfy
these criteria, we construct \textbf{interval estimates}.
\begin{center}
\includegraphics[width=3.5in]{image3-16.png}
\end{center}
The above diagram shows that P\% of all sample means are within a
distance of $\boxed{\serr=\Z\cdot\pserrmean}$ of the mean.  In probability
symbols:
\[\boxed{P\left(\left[\smean-\serr\right]<\pmean<\left[\smean+\serr\right]\right)=P\%}\]
This probability event is called a confidence interval estimate for
the population mean.  This interval estimate
$\left[\smean-\serr\right]<\pmean<\left[\smean+\serr\right]$ has a
\textbf{precision} of $\serr$ and a \textbf{degree of confidence} of
$P\%$.

\example{Using the previous sampling problem on incomes, construct a
  95\% confidence interval for \pmean.}%
{Keeping in mind that the goal is to fill in the blanks of the
  confidence interval statement,
\[P\left(\left[\smean-\serr\right]<\pmean<\left[\smean+\serr\right]\right)=P\%\ ,\]
proceed with the following steps for any confidence interval:
\begin{enumerate}[Step 1)]
\item Identify all given information with symbols.  This is conveniently done with a Venn diagram:
\begin{center}
\parbox[t]{2.5in}{\vspace{0em}{\resizebox{2in}{!}{\input{mean_conf.pdf_t}}}}
\end{center}
\item Draw a diagram of the sampling distribution.  Since $\ns=50\ge 30$
  the distribution of \smean\ is approximately normal by the \CLT\ .
\begin{center}
\includegraphics[width=4.0in]{image3-17.png}
\end{center}
\item Calculate the \Z-value.  Use the confidence, here $P=95\%$, to
  find the area required for the table,
\[A=\frac{.95}{2}=0.4750\ ,\]
and the corresponding $\Z$-value,
\[\Z=1.96\ ,\]
 from the table.
\item Calculate the standard error.  To calculate the precision
  $\serr$, we require the standard error of the mean,
  $\pserrmean=\frac{\pdev}{\sqrt{\ns}}$, but \pdev\ is unknown so
  replace it by its point estimate, \sdev.  We designate the
  approximate standard error of the mean as
  \[\boxed{\sserrmean=\frac{\sdev}{\sqrt{\ns}}}=\frac{\$5000}{\sqrt{50}}=\$707.11\]
  ** Note that at this step we used the fact that
  $\frac{\ns}{\np}=\frac{50}{10000}=.005 < .05$ so that, assuming we
  were sampling without replacement, we could ignore a \FCF\ in these
  formulae.  If $\frac{\ns}{\np}>.05$ we would have to introduce an
  \FCF\ into the standard error here.
\item Calculate the precision (maximum sampling error).
\[\boxed{\serr=\Z\cdot\sserrmean}=(1.96)(\$707.11)=\$1385.94\]
\item Make the confidence interval statement.
\begin{eqnarray*} P\left(\left[\smean-\serr\right]\right.\ < & \pmean & <\ \left.\left[\smean+\serr\right]\right) = P\% \\
P\left(\left[\$42,000 - \$1385.94\right]\right.\ < & \pmean & <\ \left.\left[\$42,000 + \$1385.94\right]\right) =  95\% \\
P(\$40,614.06\ < & \pmean & <\ \$43,385.94) = 95\%
\end{eqnarray*}
In words there is a .95 probability that the population mean \pmean\
is between \$40,614.06 and \$43,385.94.
\end{enumerate}
}
Notes:\
\begin{enumerate}
\item Some terms that are used in connection with confidence intervals are:
\begin{description}
\item[Lower Limit] \$40,614.06
\item[Upper Limit] \$43,385.94
\item[Precision or Maximum Sampling Error] \$1385.94
\item[Confidence Coefficient] 95\%
\end{description}
\item The reason we will always write a confidence interval statement
  which includes the interval along with the confidence is because the
  interval \textbf{depends on the confidence coefficient chosen}.  To
  see this, repeat the above calculation at a 99\% level of
  confidence.
\begin{enumerate}[Step 1)]
\item Identify all given information with symbols on a Venn Diagram.\vspace{1.3in}
\item Draw a diagram of the sampling distribution.\vspace{1.3in}
\item Calculate the \Z-value.\vspace{1.3in}
\item Calculate the standard error.\vspace{1.3in}
\item Calculate the precision (maximum sampling error).\vspace{1.3in}
\item Make the confidence interval statement.\vspace{1.3in}
\end{enumerate}
\item One does not get something for nothing when creating confidence
  intervals with the same raw information.  Comparing our 99\%
  confidence interval with the 95\% confidence interval we see that if
  we want to be more confident about catching the population mean we
  have to have a wider interval (larger \serr).  If you wanted a
  narrower interval with the same level of confidence what would you
  have to do?
\clearpage
\item When creating a confidence interval we choose the level of
  confidence.  Usually we want to be fairly confident we have caught
  the population mean in the interval.\footnote{A level of confidence
    of 30\% would not be very useful information since the probability
    of being outside the stated interval would be 70\%!} Standard
  confidence coefficients are in the following table, along with their
  corresponding \Z-value for normally distributed sample statistics.
\begin{center}
\begin{tabular}{c|c}
Confidence, $P$ & \Z \\ \hline
80\%~~ & 1.282 \\
90\%~~ & 1.645 \\
95\%~~ & 1.960 \\
98\%~~ & 2.326 \\
99\%~~ & 2.576 \\
99.9\% & 3.291
\end{tabular}
\end{center}
These may be verified up to two digits after the decimal from the
normal distribution table.
\item We stated that the generic confidence interval for the sample mean is
\[P\left(\left[\smean-\serr\right]<\pmean<\left[\smean+\serr\right]\right)=P\%\ ,\]
but looking at the sampling distribution it ought to read 
\[P\left(\left[\pmean-\serr\right]<\smean<\left[\pmean+\serr\right]\right)=P\%\
\ !\] What gives?  To see why we can exchange the population and sample
means consider the following diagram illustrating means of 20 possible
samples.  The 95\% confidence interval around the population mean is
indicated and as expected there is one sample out of 20 (the third)
which does not lie in this interval while 19/20 or 95\% lie within the
interval.
\begin{center}
\parbox[t]{2.5in}{\vspace{0em}{\resizebox{2.5in}{!}{\input{confidence_switch_nobar.pdf_t}}}}
\end{center}
In the next diagram we draw the confidence intervals centred on each sample mean.
\begin{center}
\parbox[t]{2.5in}{\vspace{0em}{\resizebox{2.5in}{!}{\input{confidence_switch.pdf_t}}}}
\end{center}
One notices that 19 of the 20 sample confidence intervals (95\%) contain the
true population mean~\pmean\ while only one (again the third) does
not.  As such for a sample chosen at random we have a 95\% chance of
containing the actual population mean within the confidence interval
centred on the sample mean which is the statement we wanted to make.
Note however that when drawing the sampling distribution, the variable
is the sample statistic \smean\, not the population parameter \pmean.
The latter is a fixed, if unknown, constant.
\end{enumerate}
\reading{Read your textbook pages 262 to 271}

\newcommand{\meanconfanswers}{\begin{enumerate}
\item $P(.300-.016\ \mbox{ppm}<\pmean<.300+.016\ \mbox{ppm})$\newline
$=P(.284\ \mbox{ppm}<\pmean<.316\ \mbox{ppm})=98\%$
\item $P(\$512-\$9.54 < \mbox{\pmean} < \$512+\$9.54)$\newline
$=P(\$502.46<\pmean<\$521.54)=90\%$
\item\begin{enumerate}
\item $P(\$85-\$3.02<\pmean<\$85+\$3.02)$\newline
$=P(\$81.98<\pmean<\$88.02)=95\%$
\item $P(\$85-\$3.94<\pmean<\$85+\$3.94)$\newline
$=P(\$81.06<\pmean<\$88.94)=99\%$
\end{enumerate}
\item \ns\ must be 30 or greater to use the \CLT\ .
\item\begin{enumerate}
\item $P(82-1.15\%<\pmean<82+1.15\%)$\newline
$=P(80.85\% < \pmean < 83.15\%)=99\%$
\item $P(82-1.04\%<\pmean<82+1.04\%)$\newline
$=P(80.96\% < \pmean < 83.04\%)=99\%$
\end{enumerate}
\end{enumerate}}
\clearpage
\assignment{\answer{\protect\meanconfanswers}%
\begin{enumerate}
%The following problem used mean and standard deviation estimated from a
%graph in this report:
%http://www.nlh.nl.ca/hydroweb/nlhydroweb.nsf/A30C9A3018952796A3257610005FDEE1/$File/Wakelin-ManitobaHydroMercuryMonitoring.pdf
%The sample size of 36 was just made up. 
\item Mercury levels were tested in a sample of 36 Walleye at
  Threepoint Lake in northern Manitoba in 2005 and found to have a
  mean of .300 ppm (parts per million) with a standard deviation of
  .040 ppm.  Assuming the Walleye population in the lake is
  significantly larger, construct a 98\% confidence interval for the
  average concentration of mercury in Walleye in that lake for that
  year.
\item To estimate the average amount owing in a large journal of
receivables, a random sample of 100 entries is selected from the
entries.  The average amount owing in the sample is \$512 with a
standard deviation of \$58.  Construct a 90\% confidence interval for
the average amount of an entry in the journal.
\item A community has 500 family units.  An estimate of the average
amount spent per household winterizing a family dwelling is required. 
80 families are randomly selected.  The average amount in the sample
spent on winterizing a dwelling is \$85 with a standard deviation of
\$15.
\begin{enumerate}
\item  Construct a 95\% confidence interval for the average amount of
money spent on winterizing a dwelling.  ** Caution:  Examine \ns. **
\item Repeat (a) but for a 99\% confidence interval.
\end{enumerate}
\item A taxi company wishes to obtain an estimate of an average fare.  A
random sample of 20 customers shows that the average fare is \$19.50
with a standard deviation of \$4.80.  Why can our knowledge of the \CLT\ 
not be used to construct a 90\% confidence interval or any other
confidence interval in this case?
\item A training seminar has been offered many times over the course of
the life of a business to many of its employees.  At the end of the
seminar an exam is administered to measure the knowledge level of an
employee at the end of the seminar.  An estimate is to be obtained of
the average score on the test from the large bank of test scores of all
employees who have taken the test.  A random sample of 180 scores from
the files of the company show the average in the sample to be 82\% with
a standard deviation of~6\%.
\begin{enumerate}
\item Construct a 99\% confidence interval for the average of all test
  scores.
\item Repeat part (a) but now assume that our sample of 180 was taken
  out of a population of only 1000 exams.
\end{enumerate}
\end{enumerate}
}
\reading{Exercises in the textbook pages 271-272 \& 274}
\clearpage
\subsection[Confidence Intervals for Proportion]{Confidence Intervals for the Population Proportion}
The same theory holds for sample proportions as for sample means as
was done on the previous example with the exception that the standard
error of the sampling distribution is the standard error of
proportion.  Ultimately we wish to make a confidence interval
statement of the form
\[\boxed{P\left(\left[\sprop-\serr\right]\right. < \pprop < \left.\left[\sprop+\serr\right]\right) = P\%}\ ,\]
from which the steps below logically follow.  The maximum sampling
error (precision) now depends on the standard error of
proportion, $\boxed{\serr=\Z\cdot\pserrprop}$\ .

\example{A previous problem dealt with a sample of size 50 randomly
  selected from a large group for the purpose of estimating the
  proportion of the group who support more wind power
  generation. Construct a 99\% confidence interval for the proportion
  in the population who support more wind power if it is observed that
  there were 30 supporters in the sample.}%
{\begin{enumerate}[Step 1)]
\item Draw a Venn diagram labelling the information known.  It is also convenient to calculate the sample proportion here.
\begin{center}
\parbox[t]{2.5in}{\vspace{0em}{\resizebox{2.5in}{!}{\input{prop_conf.pdf_t}}}}
\end{center}
\item Construct a sampling distribution diagram.  Since we are now
  assuming we do not know what the true population proportion is, we
  can use the the point estimate of $\pprop\approx\sprop=.6$ to
  confirm that, $\ns\pprop\approx(50)(.6)=30>5$ and
  $\ns(1-\pprop)\approx(50)(.4)=20>5$ so the distribution of sample
  $\sprop$ should be normal.
\begin{center}
\includegraphics[width=4.5in]{image3-18.png}
\end{center}
\item Calculate the \Z-value.  To trap 99\% of all sample proportions
  about the centre, we require an area of
  \[A=\frac{.99}{2}=.4950\ ,\] so from the tables (selecting the value
  midway between 2.57 and 2.58) we need to go out 2.575 standard
  deviation from the centre, that is
\[\Z= 2.575\ .\]
\item Calculate the standard error.  The standard error of proportion,
  in theory is found by
  \mbox{$\pserrprop=\sqrt{\frac{\pprop\cdot(1-\pprop)}{\ns}}$\ .}
  Since \pprop\ is unknown in this case, \pprop\ is replaced by its
  point estimate, \sprop, and the approximate standard error of
  proportion, designated by \sserrprop, is replaced by
\[\boxed{\sserrprop=\sqrt{\frac{\sprop\cdot\left(1-\sprop\right)}{\ns}}}=\sqrt{\frac{(0.60)(0.40)}{50}}=0.069\ .\]
Note that at this step we had no need for a \FCF\ because
$\frac{\ns}{\np}=50/\mbox{``Large''}\approx 0<0.05$.  Had this not
  been the case we would have had to include a \FCF\ in our standard
  error formula.
\item Calculate the precision (maximum sampling error).
\[\boxed{\serr=\Z\cdot\sserrprop}=(2.575)(0.069)=0.18\]
\item Make the confidence interval statement.
\begin{eqnarray*} P\left(\left[\sprop-\serr\right]\right.\ < & \pprop & <\ \left.\left[\sprop+\serr\right]\right) = P\% \\
P\left([.6 - 0.18]\right.\ < & \pprop & <\ \left.[.6 + 0.18]\right)=99\% \\
P(.42\ < & \pprop & <\ .78) = 99\%
\end{eqnarray*}
In words there is a .99 probability that the population proportion \pprop\
is between .42 and~.78\ .
\end{enumerate}
}
\reading{Read textbook pp 279 - 284}
\newcommand{\confpropanswer}{
\begin{enumerate}
\item \begin{enumerate}
\item Yes. $\pprop\approx\sprop=.005794$, so $\ns\pprop\approx 197>5$ and $\ns(1-\pprop)\approx 33803>5$.
\item $P(.0058-.0007<\pprop<.0058+.0007)$ $=P(.0051<\pprop<.0065)=90\%$
\item Yes, since the selection process is not random.  Sick animals
  are selected and infected areas have increased hunting quotas.  This
  would mean our estimate will be too high.  (Alternatively, CWD tests
  are likely difficult with infected animals not having observable
  symptoms resulting in false negatives.)
\end{enumerate}
\item\begin{enumerate}
\item $\pprop\approx\sprop=.520$
\item $P(.520-.175<\pprop<.520+.175)$ $=P(.345<\pprop<.695)=99\%$
\end{enumerate}
\item \begin{enumerate}
\item $P(.56-.03<\pprop<.56+.03)$ $=P(.53<\pprop<.59)=95\%$\newline Note a pollster would say ``Support of the PP is 56\%.  This result is accurate to within $\pm3\%$, 19 times out of 20.''
\item Yes, since .50 is not in the interval.
\item Yes, $P(.56-.04<\pprop<.56+.04)$ $=P(.52<\pprop<.60)=99\%$\newline which still does not contain .50\ . 
\end{enumerate}
\end{enumerate}}
\clearpage
\assignment{\answer{\protect\confpropanswer}
\begin{enumerate}
% The following problem is based on the information at http://www.ccwhc.ca/cwd_surveillance_in_saskatchewan.php
\item The Saskatchewan Ministry of the Environment has a surveillance
  program to monitor the incidence of Chronic Wasting Disease (CWD).
  Between 1997 and 2007 around 34,000 cervids (which include deer,
  elk, and moose) in Saskatchewan have been tested for CWD with 197
  testing positive.
\begin{enumerate}
\item Will the sample proportion \sprop\ of infected animals be
  normally distributed?
\item Construct a 90\% confidence interval for the proportion of
  cervids in Saskatchewan with CWD.  (Assume the actual population
  size of cervids in Saskatchewan is in the millions.)
\item According to the Ministry of Environment (MOE) website:
\begin{quote}
  ``The CWD surveillance program is based primarily on the testing of
  hunter-killed animals and to a lesser extent on the testing of
  cervids submitted through the passive surveillance of sick or dead
  animals in the province. In areas where CWD was detected, MOE
  implemented herd reduction programs, primarily through increased
  hunting quotas and reduced hunting licence fees, in an attempt to
  increase hunter harvest to reduce deer densities and limit the
  spread of CWD.''
\end{quote}
Does this affect the conclusion in (b)?  If so, how?
\end{enumerate}
\item A credit union branch has 650 members some of which have more
  than one type of account.  A random sample of 50 of the members
  shows that 26 have a secondary account.
\begin{enumerate}
\item What is a point estimate for the proportion of members who have
  a secondary account at the credit union?
\item Construct a 99\% confidence interval for the proportion of
  members who have a secondary account at the credit union.

** Hint: Note size of \ns\ and \np.
\end{enumerate}
\item A poll of 1000 people taken from a large population asking their
  voting intention gave the following results:
\begin{center}
\begin{tabular}{|l|c|}\hline
Response & Number \\ \hline
Pink Party & ~560 \\
Blue Party & ~320 \\
Green Party & ~~90 \\
Undecided & ~~30 \\ \hline
& 1000 \\\hline
\end{tabular}
\end{center}
\begin{enumerate}
\item Construct a 95\% confidence interval for the proportion of
  people who support the Pink Party.
\item Based on your result in (a) can we conclude that the majority
  (more than half) of the population support the Pink Party?
\item If you wanted to be 99\% confident that the Pink Party had
  majority support would your result in (b) still be true?
\end{enumerate}
\end{enumerate}}

\reading{Exercises in textbook pages 284 - 285}

\subsection{Sample Size Determination}

In all of the previous problems, it was assumed that a sample had
already been taken and an estimate was to be based upon this sample. 
In a practical situation, a sample must first be selected before any of
the sample statistics can be computed.  The size of the sample cannot
just arbitrarily be selected.  There are three factors that determine the
size of the sample to be selected both from a statistical point of view
and from an economic point of view.

From an economic point of view, the sampling size turns out to be costly
because it involves the time, resources, and funds of the firm.  The
method of choosing the sample should minimize these costs while at the
same time guaranteeing the statistical reliability and precision of the
estimate provided.

From a statistical point of view, the size of the sample depends upon
three things:
\begin{enumerate}
\item The amount of precision required in the estimate.
\item The degree of confidence to be placed on the estimate.
\item The amount of variation in the population.
\end{enumerate}

Recall that:
\begin{itemize}
\item In estimating \textbf{means}, the maximum possible sampling error (precision) is found by:
\[\serr=\Z\cdot\pserrmean=\Z\cdot\frac{\pdev}{\sqrt\ns}\]
Solve this equation for \ns:  
\[\boxed{\ns=\left[\frac{\Z\cdot\pdev}{\serr}\right]^2}\]

\item In estimating \textbf{proportions}, the maximum possible sampling error (precision) is found by:  
\[\serr=\Z\cdot\pserrprop=\Z\cdot\sqrt{\frac{\pprop\cdot(1-\pprop)}{\ns}}\]
Solve this equation for \ns:
\[\boxed{\ns=\pprop\cdot(1-\pprop)\cdot\left[\frac{\Z}{\serr}\right]^2}\]
\end{itemize}
Notice that in both the case of estimating means and of estimating
proportions, the formula developed requires the value of a parameter
in the population.  The parameters in the population are unknown to us
so an estimate of these parameters must be available to us before the
sample is selected.  This is often done by using a small pilot survey
or in the case of proportions the worst case can be assumed, namely
where, $\pprop=0.5$\ .  The latter maximizes the function
$\pprop\cdot(1-\pprop)$.  Note the sample size \ns\ must be an integer
and to be conservative we always round up regardless of the decimal fraction.

\example{A survey is planned to determine the amount of time
  computer-owning adults in Regina spend on their home computers
  during a week.  A pilot survey of such adults found that 8 hours
  were spent on average with a standard deviation of 3 hours.  If we
  want to estimate the actual average weekly home computer use to
  within 1/4 of an hour, how many should be surveyed if we want to be
  95\% confident of the result? (Answer: $\ns=554$ computer-owning
  Regina adults)}%
{\vspace{4in}} \example{In a previous example a sample of 50 was taken
  from a large population and it was found that 30 were supporters of
  more wind power generation.  The 99\% confidence interval
  for the proportion of support based on this small sample was quite
  wide, namely $([.6 - 0.18]< \pprop < [.6 + 0.18])=(.42<\pprop<.78)$
  .
\begin{enumerate}
\item How large a sample should be taken if we desire to know the true
  proportion to within .05, still at a 99\% level of confidence.  Use
  the small sample proportion as an estimate of \pprop.\\*
(Answer: $\ns=637$ people, if $\Z=2.575$ is used.)
\item How large a sample should be used if no estimate of \pprop\ had been available?\\*
(Answer: $\ns=664$ people)
\end{enumerate}}%
{\begin{enumerate}
\item ~\vspace{1.5in}
\item ~\vspace{2in}
\end{enumerate}
}

\reading{Read the textbook pages 266 \& 283 - 284}
\newcommand{\samplesizeanswers}{%
\begin{enumerate}
\item 97 measurements
\item 16,588 Quebec citizens (if the 1995 result is used as an estimate)
\item 75 vehicles
\item \begin{enumerate}
\item 601 burial plots
\item 505 burial plots
\item Lower the confidence and/or increase max sampling error.
For example, with $P=90\%$ and $\serr=10\%=.10$, we need only $\ns=57$ burial plots.
\end{enumerate}
\end{enumerate}
}
\assignment{\answer{\protect\samplesizeanswers}%
\begin{enumerate}
\item A manufacturing company produces a component for a product on an
  assembly line.  The company wishes to know the average time taken
  for the component to travel from one workstation on the line to the
  next.  By taking a handful of such measurements a worker has
  estimated that the mean time taken is 202.0 seconds with a standard
  deviation of 5.0 seconds.  What sample size should be used in the
  actual analysis in order to be 95\% certain that the mean transfer
  time is estimated to within 1.0 seconds in the final confidence
  interval?
\item What sample size should a government official employ if he
  wishes to estimate the proportion of citizens of Quebec who wish to
  secede from Canada to become a sovereign country to within 1\% at a
  99\% level of confidence.  (The last Quebec referendum in 1995 was
  49.42\% in favour of leaving Canada.)
\item In order to assess the cost of commuting daily between Regina
  and Moose Jaw the average mileage of carpool vehicles is required.
  A pilot survey of six such vehicles found the following mileages:
\begin{center}
6.8,\ \ 8.1,\ \ 8.5,\ \ 9.4,\ \ 12.3,\ \ 13.6\ \ \ (km/litre)
\end{center}
If the average mileage is desired to be known to within .5 km/litre at
a 90\% level of confidence, how many car mileages should be measured
in the actual survey?
\item In an attempt to assess the status of women in nineteenth century
  Paris, a researcher wishes to know the proportion of burial plots
  occupied by women in the P\`{e}re Lachaise cemetery, a large
  affluent necropolis in Paris containing over 300,000 burial
  plots.
\begin{enumerate}
\item If the researcher wishes to know the fraction of female burials
  to within 4\% at a 95\% level of confidence, how many nineteenth
  century burial plots will she need to examine in the cemetery?
\item In an attempt to lessen the number of plots requiring
  examination, the researcher chooses 20 nineteenth century plots at
  random, looks at the names, and determines that 6 are women.  How
  large a sample size would she need now to achieve a confidence
  interval with the requirements given in (a)?
\item The researcher decides that this is still a larger sample size than
  she wishes to take.  What other options does she have to reduce the
  sample size required?
\end{enumerate}
\end{enumerate}}
\reading{Exercises in the textbook page 285}
\clearpage
\subsection{The Sampling Distribution of the Mean Using Small Samples}
\label{subsec:smallmean}
In some instances it is not practical to take the large sample
($\ns\ge 30$) required for the \CLT\ to be applied. (Name some!)  However, if a
random variable \X\ is \textbf{known to be approximately normally
  distributed} (something not required by the \CLT) it can be shown
theoretically that both \smean\ and
\mbox{$\Z=(\smean-\pmean)/\pserrmean=(\smean-\pmean)/(\pdev/\sqrt{\ns})$}
are normally distributed even for small samples
($\ns<30$).\footnote{Here we neglected the \FCF\ in \pserrmean\ since we
  will assume a small sample always satisfies $\ns/\np<.05$ as \ns\ is
  small~($<30$).}  The problem that arises for small samples, however,
is that, as before, we typically do not know the population standard
deviation \pdev\ but wish to approximate it by the sample standard
deviation \sdev\ .  Now the test statistic, call it \T, defined in the
same way as was done for \Z,
\[\boxed{\T=\frac{\smean-\pmean}{\sserrmean}}=\frac{\smean-\pmean}{\sdev/\sqrt{\ns}}\ ,\]
is no longer normally distributed as it was before for large samples.
It has what is called a $\mathbf\T$ \textbf{distribution}.
Essentially when $\ns<30$ the variation of \sdev\ about \pdev\ causes
the above value to depart from normality. By definition, the \T-value
measures the number of standard deviations from the mean of a given
value, just as with the \Z-score.
%Reference: Mendenhall et. al. Intro to Probability and Statistics 2nd
%Canadian edition page 411.

The shape of the \T\ distribution depends upon the sample size \ns.
The larger the sample, the closer the shape is to a normal curve.  The
smaller the size of the sample, the more the distribution tends to be
dispersed from the centre and the flatter the sampling distribution
curve.
\begin{center}
\includegraphics[width=4.5in]{image3-19.png}
\end{center}
The total area under any of these curves, is, as usual for a
continuous probability distribution, equal to one.  Rather than label
the different \T\ curves by their associated sample size \ns,
statisticians use a related number called the \textbf{number of
  degrees of freedom}, defined by
\[\boxed{\df=\ns-1}\ .\]
This is the same quantity that is the denominator in the sample
variance formula:
\[\svar=\frac{\sum\left(\X-\smean\right)^2}{\ns-1}=\frac{\sum\left(\X-\smean\right)^2}{\df}\]

Essentially one has a different \T\ distribution for each different
value of \df\ (or \ns), and we could make an area under the curve
table for each one as was done for the normal (\Z) distribution.  In practice,
since we are only interested in applying the \T\ distribution to find
confidence intervals (and later for hypothesis testing) this is
unnecessary; we do not need 30 tables. Recall only a handful of
numbers off the normal distribution table were required for these
problems.  We will grab the same set of numbers for each
\T\ distribution and put them on a single table.  Furthermore our
\T\ table will illustrate the area under the \T\ distribution in a
different format than the \Z\ table; we will use the area in the
tails rather than the area in the centre.  Finally, whereas the normal
table has the area (probability) inside the table, since we will be
interested in doing reverse lookups (using area to get \T), it is the
\T-value which is inside the table.  See the \T\ distribution table.
Notice that the values for the \Z\ distribution are given at the bottom
($\df=\infty$).\footnote{The $\infty$ symbols means infinity, or
  ``very large'' \df.  Recall as \ns\ gets really large ($\ge 30$) the
  \T\ distribution converges to the normal curve.}

\reading{See page 497 in the textbook.}

\example{Find the \T-value based on a sampling distribution with
  samples of size 20 that places 5\% of the area under the curve in
  two tails.  Draw a sketch of the sampling curve.}%
{If $\ns=20$ then $\df=n-1=20-1=19$.
\begin{center}
\includegraphics[width=4.5in]{image3-20.png}
\end{center}
% Add \mu+t\sigma \mu-t\sigma to \smean axis.
% Note for a t-distribution this approach of putting two axes is false since
% the sample mean is normally distributed yet t is not so the two curves
% could not be the same.  However putting a comment to that effect might only
% confuse the student.  Also the idea that a sample mean still maps to
% a given t value is still largely relevant.  (Though really it is the
% sample mean + sample standard deviation which maps to the value.)
The total shaded region in two tails is 0.05 . Read down the
appropriate column to find $\T=2.093$.}

Confidence intervals for the mean are done exactly as before but now
we need to be careful to identify which \T\ distribution is the correct
one to find \T\ by using \df\ as just shown. Also since we are using a
\T\ distribution rather than the normal distribution our maximum
sampling error (precision) for our confidence interval is
$\boxed{\serr=\T\cdot\sserrmean}$.  Finally we note that the
assumption that \X\ be normal is not overly restrictive as many
distributions are normal.  Moreover the \T\ statistic is
\textbf{robust} which means that its distribution remains largely
unchanged even if the underlying distribution is not normal.  In
practice if \X\ has a distribution that merely has a mound in the
centre this analysis will still typically work.
%Reference: Mendenhall et. al Intro to Probability and Statistics 2nd
%Canadian edition page 415.

\example{A simple random sample of 10 small cars is tested for fuel
economy.  Here are the results:
\begin{center}
5.3,\ \ 6.2,\ \ 8.2,\ \ 6.1,\ \ 5.9,\ \ 7.3,\ \ 9.7,\ \ 5.5,\ \ 10.3,\ \ 7.5\ \  (litres/100 km)
\end{center}
Construct a 98\% confidence interval for the mean fuel economy of
small cars based upon this evidence if the fuel economy of cars is
known to be approximately normally distributed.}%
{We follow the same steps as before, guided by what we need to fill in
  the confidence interval statement.\clearpage
\begin{enumerate}[Step 1)]
  \item Identify all given information with symbols on a Venn Diagram.
    Compute $\smean$ and $\sdev$ using your calculator and the
    appropriate statistical keys.
\begin{center}
\parbox[t]{2.5in}{\vspace{0em}{\resizebox{2in}{!}{\input{tdistributionvenn.pdf_t}}}}
\end{center}

\item Draw a diagram of the sampling distribution for samples of this
  size.  Since $\ns=10$ is less than thirty and $\X$ is known to be normal
  we will need a \T\ distribution.\footnotemark
\begin{center}
\includegraphics[width=3.8in]{image3-21.png}
\end{center}
\item Calculate the \T-value.
\begin{itemize}
\item Decide on the number of degrees of freedom, $\df=\underline{\ \ \ \ \ \ \ \ \ }$.
\item Find the total shaded area in two tails, $\mbox{Area}=1-\underline{\ \ \ \ \ \ \ \ \ \ }=\underline{\ \ \ \ \ \ \ \ \ \ }$.
\item The \T-value from the tables is $\T=\underline{\ \ \ \ \ \ \ \ \ \ \ \ }$.
\end{itemize}
\item Calculate the standard error.

$\displaystyle\sserrmean=\frac{\sdev}{\sqrt{\ns}}=$
\item Compute the precision (maximum sampling error).

$\displaystyle \serr=\T\cdot\sserrmean=$
\item Make the confidence interval statement.
\begin{eqnarray*} P\left(\left[\smean-\serr\right]\right.\ < & \pmean & <\ \left.\left[\smean+\serr\right]\right) = P\% \\ & & \\
P\left(\left[\ \underline{\ \ \ \ \ \ \ \ } - \underline{\ \ \ \ \ \ \ \ }\ \right]\ \right.\ < & \pmean & <\ \left.\left[\ \underline{\ \ \ \ \ \ \ \ } + \underline{\ \ \ \ \ \ \ \ }\ \right]\ \right) =\ \underline{\ \ \ \ \ \ \ \ }\ \% \\ & & \\
P(\ \underline{\ \ \ \ \ \ \ \ }\ < & \pmean & <\ \underline{\ \ \ \ \ \ \ \ }\ ) =\ \underline{\ \ \ \ \ \ \ \ }\ \%
\end{eqnarray*}
\end{enumerate}
}\footnotetext{The perceptive student should note that in drawing
  this distribution the two curves are different since \smean\ has a
  normal distribution while the statistic we are manipulating
  $\T=(\smean-\pmean)/\sserrmean$ has a \T\ distribution.  For our
  purposes we are only sketching a lump-shaped distribution in either
  case.  The point of the diagram is to indicate important areas and
  the fact that \smean\ values and the dimensionless \T\ values are
  interrelated.}

%Make a comment about the fact we don't use t for proportion.
\reading{Read the textbook pages 268 to 271}
\newcommand{\smallsampleanswers}{\begin{enumerate}
  \item\begin{enumerate}
  \item $\T=2.624$
  \item $\T=1.703$
  \item $\T=4.032$
  \item $\Z=3.291$ (This is effectively normal as \ns=560>30.  Use $\df=\infty$ on \T\ table.)
  \end{enumerate}
  \item\begin{enumerate}
    \item $P(156.3-78.0\ \frac{\mbox{\tiny m}^3}{\mbox{\tiny s}}<\pmean<156.3+78.0\ \frac{\mbox{\tiny m}^3}{\mbox{\tiny s}})$\newline
      $=P(78.3\ \frac{\mbox{\tiny m}^3}{\mbox{\tiny s}}<\pmean<234.3\ \frac{\mbox{\tiny m}^3}{\mbox{\tiny s}})=95\%$
    \item Use 30 or more years of data so the \CLT\ applies and
      the underlying distribution does not matter.
    \end{enumerate}
  \item \begin{enumerate}
    \item  $P(\$2.03-\$.66<\pmean<\$2.03+\$.66)$\newline
      $=P(\$1.37<\pmean<\$2.69)=90\%$
    \item $\$1096<\mbox{total}<\$2152$
    \end{enumerate}
  \end{enumerate}
} \assignment{\answer{\protect\smallsampleanswers}**Note in the
  confidence interval problems below that the ``fun'' part of using
  small samples is that the instructor can ask the student to
  calculate the descriptive statistics required (\smean~and~\sdev)
  since there are few enough data elements (less than 30) that you can
  do this yourself on a calculator.  After that step is taken,
  however, these problems are no more complicated that the large sample
  ones except use of the \T\ distribution is required.**
\begin{enumerate}
\item Find \T-values required to solve:
  \begin{enumerate}
  \item a 98\% confidence interval with sample size 15.
  \item a 90\% confidence interval with sample size 28.
  \item a 99\% confidence interval with sample size 6.
  \item a 99.9\% confidence interval with sample size 560.
  \end{enumerate}
\item According to Environment Canada, the average water discharge for
  the month of May of the South Saskatchewan River at Medicine Hat for
  the years 2000-2009 was measured to be ($\mbox{m}^3/\mbox{s}$):
% Data taken from 
% http://www.wsc.ec.gc.ca/applications/H2O/report-eng.cfm?yearb=&yeare=&station=05AJ001&report=monthly&year=2009
% Rounded to the 1st digit.
\begin{center}
\begin{tabular}{ccccc}
~~~69~~ & ~~~51~~ & ~~~64~~ & ~~272~~ & ~~~87~~ \\
~82 & 238 & 294 & 317 & ~89 
\end{tabular}
\end{center}
\begin{enumerate}
\item If we could assume that the discharges are normally
  distributed, what would be the 95\% confidence interval for the mean
  average water discharge for the month of May of the South
  Saskatchewan River at Medicine Hat.
\item If the underlying distribution is not approximately normally
  distributed, what could we do to construct the confidence interval?
\end{enumerate}
\item The distributions of purchases at a snack food outlet is thought to
be normal.  A random sample of 12 purchases shows the following
amounts (\$):
\begin{center}
\begin{tabular}{cccccc}
~~0.75~~ &  ~~1.78~~ &  ~~4.25~~ & ~~0.50~~ & ~~2.34~~ &  ~~3.25~~\\
0.98 &  2.22 &  1.75 &  1.50 &  0.88 &  4.15
\end{tabular}
\end{center}
\begin{enumerate}
\item Construct a 90\% confidence interval for the average value of a
purchase at the outlet.
\item A taxation officer observes the outlet over the course of a week
and notices that 800 customers have entered the cash register line of
the outlet.  He seizes the tapes from the cash register and adds the
total value of all purchases over this time.  If purchases have been
correctly accounted for, between what two values should the total of
all purchases lie?
\end{enumerate}
\end{enumerate}
}
\reading{Exercises in the textbook pages 273 - 274} 
\clearpage
\newcommand{\confidenceanswers}{%
\begin{enumerate}
\item \begin{enumerate}
  \item $P(18\ \mbox{wks}<\X) = P(1.50<\Z) = 0.0668$
  \item  $P(18\ \mbox{wks}<\smean) = P(15.00 < \Z) \approx 0$
  \item \begin{enumerate}
    \item $\serr=0.31\ \mbox{wks}$
    \item $P(11.80-.31\,\mbox{\tiny wks}<\pmean<11.80+.31\,\mbox{\tiny wks})$\newline
      $=P(11.49\ \mbox{\tiny wks}<\pmean<12.11\ \mbox{\tiny wks})\!=\!99\%$
    \end{enumerate}
  \item \begin{enumerate}
    \item $\serr=2.39\ \mbox{wks}$
    \item $P(11.80\!-\!2.39\mbox{\tiny wks}\!<\!\pmean\!<\!11.80\!+\!2.39\mbox{\tiny wks})$\newline
      $=P(9.41\ \mbox{\tiny wks}<\pmean<14.19\ \mbox{\tiny wks})=99\%$
    \end{enumerate}
  \item \begin{enumerate}
    \item $\serr=0.02\ \mbox{wks}$
    \item $P(11.80-.02\,\mbox{\tiny wks}<\pmean<11.80+.02\,\mbox{\tiny wks})$\newline
      $=P(11.78\ \mbox{\tiny wks}<\pmean<11.82\ \mbox{\tiny wks})\!=\!99\%$
    \end{enumerate}
  \item $\ns=217$ unemployed people
  \end{enumerate}
\item $P(35,000-412\ \mbox{km}<\pmean<35,000+412\ \mbox{km})$\newline
  $=P(34,588\ \mbox{km}<\pmean<35,412\ \mbox{km})=98\%$
\item $P\left(7.2-.7\ \frac{\mbox{\tiny \it l}}{\mbox{\tiny 100 km}} <
    \pmean < 7.2+.7\ \frac{\mbox{\tiny \it l}}{\mbox{\tiny 100
        km}}\right)$\newline
  $=P\left(6.5\ \frac{\mbox{\tiny \it l}}{\mbox{\tiny 100 km}} < \pmean <
    7.9\ \frac{\mbox{\tiny \it l}}{\mbox{\tiny 100 km}}\right)=90\%$
\item \begin{enumerate}
  \item $\serr=2.7\%$ for \pprop\ in favour.  The maximum sampling
    error depends upon the proportion asked.  For the proportion
    against changing to DST for instance $\serr=2.9\%$ while for the
    proportion with no opinion it is $\serr=1.5\%$.  The largest
    sampling error for any possible proportion will occur when
    $\sprop=.5$ is used and this results in $\serr=3.1\%$ which is
    larger than all of them and quoted.
  \item $P(.270-.052<\pprop<.270+.052)$\newline
    $=P(.218<\pprop<.322)=99.9\%$\newline ``The percentage in favour
    of switching to DST was 27\%.  The result is accurate to within
    5.2\%, 999 times out of 1000.''  In some sense this is more useful
    because the 50\% needed for a successful plebiscite is still not
    in the interval thereby demonstrating the unlikelihood of it
    succeeding. There is only a .1\% chance of the population value
    lying outside of this interval versus 5\% in the one quoted.
  \end{enumerate}
\item $P(.20-.04<\pprop<.20+.04)$\newline
$=P(0.16<\pprop<0.24)=99\%$
\item $P(140,840-16,080 <\pmean<140,840+16,080)$\newline
$=P(124,760\ \mbox{veh.}<\pmean<156,920\ \mbox{veh.})=95\%$
\item $\ns=2401$ voters
\item $\ns=2653$ entries
\end{enumerate}}
\subsection{Sampling and Confidence Interval Summary Exercise}
\answer{\protect\confidenceanswers}
\begin{enumerate}
\item
Suppose that there are currently 1,200,000 unemployed members of
Canada's labour force.  The mean length of time that a
person is unemployed is 12 weeks with a standard deviation of 4 weeks. 
The distribution of time-spent unemployed is approximately normal.
\begin{enumerate}
\item A person is randomly chosen from among those unemployed in the
labour force.  What is the probability that the person has been
unemployed in excess of 18 weeks?  
\item Suppose that a simple random sample of 100 people is selected
from those unemployed in the labour force.  What is the probability
that the mean length of time unemployed for the people in the sample
exceeds 18 weeks?
\item Suppose we do not know what the mean or standard
deviation in the labour force is but we do know that a simple random
sample of 1000 unemployed workers yields an average of 11.80 weeks with
a standard deviation of 3.75 weeks.
\begin{enumerate}
\item Based on the 99\% confidence coefficient, what is the maximum
possible sampling error?
\item What is the confidence interval for the mean length of time
spent unemployed by a person in the labour force?
\end{enumerate}
\item Recalculate your answers to part (c) based upon a sample size of
20 rather than a sample size of 1000 using the same point estimates.
\item Recalculate the answers to part (c) based upon a sample size of
150,000 rather than a sample size of 1000 using the same point
estimates. ** Check!  What is n/N ? **
\item A small pilot survey was selected from the 1,200,000 unemployed. 
It was found that the standard deviation in the population was 4.2
weeks.  How large should the random sample be in order to estimate the
population mean based upon a 92\% level of confidence if we wish to be
within 0.5 weeks in our estimate?
\end{enumerate}
\item A company has over 5000 salespeople spread across Canada.  A
random survey of business travel for these people showed that on the
basis of 200 of these salespeople, the average distance traveled was
35,000 km with a standard deviation of 2,500 km.  Construct a 98\%
confidence interval for the average travel of the 5000 salespeople.
\item A company wishes to purchase a compact vehicle to obtain the best
fuel economy for urban deliveries.  They chose 10 compact vehicles from
sales lots and drove them under similar conditions.  The average fuel
economy achieved was 7.2 1/100 km with a standard deviation of 1.2
1/100 km.  On the basis of the sample results, construct a 90\%
confidence interval for the average fuel economy one can expect from
compact cars driven under these conditions.
\item In 2011 the Saskatchewan government decided not to hold a
  province-wide vote on whether to introduce daylight savings time
  (DST) arguing that in a recent government poll, 66 per cent of
  Saskatchewan residents opposed switching to DST, while only 27 per
  cent were in favour.  Seven per cent had no opinion.  Further
  details of the poll were as follows:
\begin{quote}\raggedright
``The province-wide poll of 1,012 Saskatchewan residents was conducted
by Fast Consulting between Jan. 10 and Jan. 24. It has a margin of error
of 3.1\%, 19 times out of 20.''
\end{quote}
\begin{enumerate}
\item Calculate the maximum sampling error for the proportion of the
  population in favour of switching to DST at the 95\% level of
  confidence.  Why is there a discrepancy between your answer and the
  3.1\% reported?
\item Find the confidence interval for the proportion in favour of
  switching to the DST at a 99.9\% level of confidence. (You can find
  the appropriate \Z-value on the bottom of the \T\ table with
  $\df=\infty$.)  State your conclusion using the same statistical
  language of the quotation.  Would the 99.9\% confidence interval
  have been more useful to report than the 95\%?
\end{enumerate}
\item A shaker box contains 10,000 beads of which some are white and
some are coloured.  A random sample of 500 of these beads are chosen. 
100 are found to be coloured.  Construct a 99\% confidence interval for
the proportion of beads in the box that are coloured.  ** Caution, watch the sample size. **
\item To test the durability of a new paint for white center lines, a
  highway department painted test strips across heavily traveled roads
  in eight different locations, and electronic counters showed that
  they deteriorated after having been crossed by (to the nearest
  hundred):
\begin{center}
\begin{tabular}{cccccccc}
142,600 & 167,800 & 136,500 & 108,300 & 126,400 & 133,700 & 162,000 & 149,400
\end{tabular}
\end{center}
Construct a 95\% confidence interval for the average amount of traffic
(vehicles) the new white paint can withstand before it deteriorates.
Assume that the data are approximately normally distributed.
\item A political party is interested in its current status among the
electorate.  A random sample of voters is to be polled regarding their
current political preference.  How many voters should be included in
the poll so that the party will be off in its estimate from the true
proportion by no more than 2\% with a 95\% degree of confidence.
\item An auditor is checking the accounts receivable journal of a firm. 
There are 10,000 entries in the journal.  The auditor wishes to know
the average value of an entry to the journal to within \$40.  How many
entries should be included in the sample to have a 99\% degree of
confidence in the answer if he estimates the standard deviation of
entries to be about \$800?
\end{enumerate}
\addtocontents{toc}{\protect\columnbreak}

\section{Hypothesis Testing}
\subsection{The Logic Of Hypotheses Testing}
\label{subsec:logichypothesis}
\subsubsection{The Null and Alternative Hypotheses}
Statisticians use a very precise definition of the word
``hypothesis''.  From a statistical point of view a hypothesis is an
assumption made about a population parameter.

Grammatically, a hypothesis is always phrased as a declarative sentence.
A declarative sentence is one, which has a truth-value.  Hypotheses are
either true or false but not both.

\example{The following are examples of \textbf{Declarative Sentences}:
\begin{itemize}
\item It is sunny outside.
\item The Passenger Pigeon is extinct.
\end{itemize}
The following are examples of sentences which are \textbf{Not Declarative}:
\begin{itemize}
\item Hi, how are you?
\item Have a nice day!
\end{itemize}
From the above examples, we can see that a declarative sentence is
either true or false but other types of sentences have no truth-value.
}

\textbf{Hypothesis testing} is a decision-making procedure that uses
sample evidence to test the truthfulness of a statement about a
population parameter.
\example{The following are examples of some hypotheses we may
    want to test:
\begin{enumerate}
\item The net contents of a can of tuna fish coming off of the production
line averages 225 g.
\item Historically, the average mark scored by applicants on a personnel
test is 75\%.
%The following percent is from 
%http://www.statcan.gc.ca/pub/82-620-m/2005001/article/child-enfant/8061-eng.htm
%which states that overweight or obese children (they have two categories) in
%Canada in 2004 was 26\%.
\item The proportion of overweight children in Canada is 26\%\ .
\item Most widgets produced in Canadian factories are within 5 grams of the
average weight.
\end{enumerate}}

Sampling theory is used in hypothesis testing for the purpose of
avoiding bias in making the decision. It is an important part of the
process that the decision be arrived at based upon an initial impartial
point of view. It has been said that statistics can be used to prove
any position that you wish to take in a discussion. That can be the
case if statistics procedures are used incorrectly.

The decision to be tested is called the \textbf{null hypothesis},
$\bm\Ho$\ .  In the null hypothesis, the parameter to be tested is
always set equal to some assumed value. This assumed value is the
centre of the sampling distribution curve on which we will base our
decision.  The word \emph{null} means \emph{no difference} in
statistics. It is another way of saying, \emph{equal to}.
\example{The null hypotheses from examples 1 and 2 above would imply
  the following sampling distributions:
\begin{center}
\includegraphics[width=4.5in]{image3-28.png}
\end{center}
}

The \textbf{alternative hypothesis}, $\bm\Ha$, is a hypothesis that
will be accepted if the statistical evidence leads to the conclusion
that the null hypothesis is probably false. There are three different
arguments that can be put up in opposition to the statement that a
parameter is equal to a certain value. We could conclude that it is
\emph{less than}, \emph{greater than} or simply \emph{not equal to}
that value depending on the circumstances. The alternative hypothesis
will always have one of these three mathematical relation symbols:
$<$, $>$, or $\neq$ .  \example{Possible alternative hypotheses for
  the previous example 1 are:
\begin{center}
$\Ha: \pmean<225\ \mbox{g}$\hfil$\Ha:\pmean>225\ \mbox{g}$\hfil$\Ha:\pmean\neq 225\ \mbox{g}$
\end{center}}

The first step in decision-making is to formulate these two hypotheses
so that we can gather some sample evidence and use it to examine how
the sample observations compare to the assumed population parameter
value. When we make our decision, it will either be \emph{the evidence
suggests that we reject \Ho\ and accept \Ha} or it will be \emph{there is
no evidence to reject \Ho}.

\subsubsection{Type I and Type II Errors}

The Risk of Making A Wrong Decision Based On Incomplete Information

 One of the objectives of decision-making is to minimize the risk of
making the wrong decision.  Here is a diagram that illustrates the
pitfalls that can occur when making a decision based on sample
evidence.
\begin{center}
\includegraphics[width=4.5in]{image3-29.png}
\end{center}

Sample evidence drawn from the population is used to decide the
truthfulness of the null hypothesis about the population parameter. If
the sample statistic deviates too far from the assumed population
parameter, we say the difference is \textbf{statistically significant}
and we reject \Ho\ . The probability of \textbf{rejecting $\bm\Ho$ when it
  is true} is called the $\bm\alpha$ \textbf{risk}. This risk, also
called the \textbf{level of significance}, is set arbitrarily
low. Common values of ${\alpha}$ are 0.01, 0.05, and 0.10. These
numbers represent the probability of making a \textbf{Type I error} in
decision-making.
\example{Use the previous example 1 situation and a sample of 50 cans
  of tuna fish.  Suppose the average weight in the sample is 180
  grams.  We might reject the null hypothesis that the average weight
  of all cans of tuna fish is 225 grams because there is such a large
  difference between the values. It is possible just due to the random
  nature of sampling that we picked the 50 cans that had the lightest
  weight among all cans packaged and the true average is in fact 225
  grams for all cans but that would be very unlikely.
\begin{center}
\includegraphics[width=2.5in]{image3-30.png}
\end{center}
}

The $\bm\beta$ \textbf{risk} is the probability of \textbf{accepting a
  false null hypothesis} on the basis of sample evidence. This type of
error is called a \textbf{Type II error} in hypothesis testing.
\example{Use the previous example 1 situation and a sample of 50 cans
  of tuna fish.  Suppose the average weight in the sample is 224
  grams.  We might accept the null hypothesis that the average weight
  of all cans of tuna fish is 225 grams because there is such a small
  difference between the values. The average weight of all cans might
  in fact be 216 grams and through random selection we just happened
  to pick 50 cans that were very heavy relative to the distribution.
\begin{center}
\includegraphics[width=2.5in]{image3-31.png}
\end{center}
}

The interrelationship between the errors may be understood with a law
metaphor.  Suppose we are wishing to the evaluate the guilt of an
accused person standing trial.  In an English court of law the
defendant is innocent until proven guilty.  Let the null hypothesis
\Ho\ be the hypothesis that the defendant is innocent.  The alternative
hypothesis \Ha\ is that the defendant is guilty.  In this case a
Type I error ($\alpha$), rejecting the null hypothesis when it is
true, corresponds to finding the defendant guilty when he is innocent.
This is considered a more serious error legally than a Type II error
($\beta$), accepting the null hypothesis when it is false, which
corresponds to finding the defendant innocent when he is guilty. For
purposes of this course, we need to be able to describe what a Type II
error is. We will not deal with calculating the probability of making
this type of error.

\subsubsection{Evaluating the Evidence}
Evaluation of the evidence is always the last consideration in making
a statistical decision. The strategy for how a decision is to be made
is set forth and then the sample evidence is gathered from the
population based on random sampling techniques. The evidence is always
weighed against the theoretical assumptions in order to judge the
probability of observing these sample results using the theoretical
statistical model.
\example{In the previous example, the null hypothesis is that the
  average weight of all cans of tuna fish is 225~grams. We may decide
  to reject this only if the sample observation is in the bottom 1\%
  of possible observations for the sample mean. The risk of rejecting
  a true null hypothesis would then be 1\%, a very small risk.  Having
  established this process, we would then go and examine a random
  selection of 50 cans of tuna fish.}
\reading{Read pages 287 to 297 in the textbook}

\newcommand{\hypothesisanswers}{\begin{enumerate}
\item $\Ho:\pmean=\$52.00/\mbox{wk}$, $\Ha:\pmean<\$52.00/\mbox{wk}$
\item $\Ho:\pmean=\$52.00/\mbox{wk}$, $\Ha:\pmean>\$52.00/\mbox{wk}$
\item $\Ho:\pprop=0.18$, $\Ha:\pprop>0.18$
\item $\Ho:\pmean=10\ \mbox{cm}$, $\Ha:\pmean\neq10\ \mbox{cm}$
\end{enumerate}}
\assignment{\answer{\protect\hypothesisanswers}Formulate the
  null and alternative hypotheses for the following situations.  (This
  is the first step of any hypothesis test.)
\begin{enumerate}
\item \label{item:ambulance} An ambulance service is considering
  replacing its ambulances with new equipment.  If \$52.00 is the
  average weekly maintenance cost of one of the old ambulances and
  \pmean\ is the average weekly maintenance cost it can expect for one
  of the new ones, what hypotheses should be used if the service wants
  to buy the ambulances only if it can be shown that this will
  significantly reduce the average weekly maintenance cost?
\begin{itemize}
\item \Ho:
\item \Ha:
\end{itemize}
\item What hypotheses should the ambulance service use in problem
  \ref{item:ambulance} if the ambulance service is anxious to buy the
  new ambulances (which have some other nice features) unless it can
  be shown that they will significantly increase the average weekly
  maintenance cost?
\begin{itemize}
\item \Ho:
\item \Ha:
\end{itemize}
\item A major Canadian brewery has held an 18\% share of the market.
  However, because of an increased marketing effort, company officials
  believe the brewery's market share is now greater than 18\%.  What
  hypotheses should the company officials use if they want to prove
  that their market share has significantly increased?
\begin{itemize}
\item \Ho:
\item \Ha:
\end{itemize}
\item What hypotheses should a quality improvement team use if it
  wants to make sure that wire leads are meeting a specification of 10
  cm in length?
\begin{itemize}
\item \Ho:
\item \Ha:
\end{itemize}
\end{enumerate}}
\clearpage
\subsection[Single Mean]{Testing Hypotheses About a Single Mean}
Our first type of hypothesis testing involves a single parameter,
We begin by testing a population mean, \pmean.

The theory that was presented in Section~\ref{subsec:logichypothesis}
is formulated into a formal six step procedure. All tests of
hypothesis follow this process.

\example{A promotional agency markets chocolate almonds through
  service clubs and charities. The agency claims that the packages
  contain 350 g.  Evaluate this claim at the 1\% level of significance
  if in a random sample of 49 boxes a mean of 338 grams with a
  standard deviation of 28 grams was measured.}{%
\begin{enumerate}[Step 1)]
\item Formulate the null and alternative hypotheses.
\begin{itemize}
\item $\bm{\Ho:\pmean = 350\ \mbox{g}}$ \ \ $\Leftarrow$ Remember the
  null hypothesis must always have an ``='' sign.
\item $\bm{\Ha:\pmean < 350\ \mbox{g}}$ \ \ $\Leftarrow$ The only
  point of contention is when the consumer is short changed.
\end{itemize}
\item State the level of significance.

$\bm{\alpha=0.01}$ \ \ $\Leftarrow$ This is some low value, here given as 1\%.

\item Determine the test statistic.

  We will examine a large sample of boxes and determine their average
  weight so a $\bm\Z$\textbf{-test} applies because the distribution
  of the mean for large samples is a normal curve. If we were
  confident that the population of weights of all boxes was itself
  normally distributed and we examined a small sample of boxes, then a
  \T\ test would apply.

\item Establish a decision rule.

  Draw a \textbf{sampling distribution curve} and determine the
  \textbf{critical Z value} which identifies the region in which the
  null hypothesis is rejected.
\begin{center}
\includegraphics[width=2.5in]{image3-32.png}
\end{center}
Here since $\alpha=.01$\ is the tail area on the left side of a normal
curve we find $\Zcrit=-2.33$\ .

This is called a \textbf{one-tail test} because the region of
rejection falls in one tail. If the alternative hypothesis has a
``$\neq$'' sign, there will be two tails of rejection and the
probability of rejection (the significance) would be split equally
between them.

**A useful trick to identify the region of rejection is to look at the
alternative hypothesis and consider the inequality as pointing to the
region.  (So $<$ means left, $>$ means right, and $\neq$ means
left and right.)**

\item Evaluate the evidence.

Given the above data the estimated standard error in the mean is
\[\sserrmean=\frac{\sdev}{\sqrt\ns}=\frac{28\ \mbox{g}}{\sqrt{49}}=4\ \mbox{g}\]
(No \FCF\ is required in calculating \sserrmean\ since the population size \np\ of all boxes produced
by the factory is much larger than the sample so
$\ns/\np=49/\mbox{Large}\approx 0<.05$\ .)

The calculated \Z-score for our measured sample mean is:
\[\Z=\frac{\smean-\pmean}{\sserrmean}=\frac{338-350}{4}=-3.00\]

\item State your decision.

  Since the \Z-value lies in the region of rejection, the evidence
  suggests, at a 1\% level of significance, that we reject \Ho\ and
  accept \Ha.  In words, the mean weight is less than 350 grams.
\end{enumerate}
}
\reading{Read pages 300 to 306 in the textbook}
\clearpage
\newcommand{\singlemeananswers}{\begin{enumerate}
\item $\Zcrit=\pm 1.645$, $\Zcalc=3.54$, therefore reject \Ho\ at
  $\alpha=.10$\ .  Evidence suggests the population mean differs from \$560\ .
\item $\Tcrit=\pm 1.729$, $\Tcalc=1.57$, therefore fail to reject \Ho\ at $\alpha=.10$\ Evidence does not suggest the population mean differs from \$560~.  Assume population normality.
\item $\Zcrit=-1.645$, $\Zcalc=-5.42$, therefore reject \Ho\ at $\alpha=.05$.  Evidence suggests the population mean is less than 454 g. 
\item $\alpha=0.05$ 
\item The butter weighs less than 454 grams on average and the sample
average we randomly chose led us to believe that the it does weigh 454
grams on average. That is, we accepted the null hypothesis when it was
false.
\item $\Tcrit=\pm 2.947$, $\Tcalc=8.639$, therefore reject \Ho\ at
  $\alpha=.01$.  Evidence suggests the cluster mean metallicity
  differs from the general surrounding stellar population.  The -0.50
  star is an outlier (its \Z\ value in the cluster data is -3.19)
  which may not be a member of the cluster but happens to lie along
  the line of sight or perhaps migrated into the region of the cluster
  at some time.
\item $\Tcrit=1.833$, $\Tcalc=0.94$, therefore fail to reject \Ho\ at
  $\alpha=.05$\ .  The evidence does not support the conclusion that
  the Regina rent is greater than \$881\ .
\end{enumerate}}
\assignment{\answer{\protect\singlemeananswers}**The objective
  of this exercise is to gain familiarity with the formal testing
  procedure for hypothesis testing. Make sure to follow the process as
  outlined in the example.**
\begin{enumerate}
\item An accountant reads a summary about a large journal which
  states that the average value of a journal entry is \$560. If she
  takes a sample of 50 entries and finds a mean of \$600 with a
  standard deviation of \$80, evaluate the claim at a 10\% level of
  significance.
\item Repeat the previous question, but now the accountant takes a
  sample size of only 20 and finds a mean of \$595 with a standard
  deviation of \$100. What assumption do we have to make about the
  population of entries before we can test the hypothesis?
\item\label{item:butter} A merchant sells butter which is advertised
  as weighing 454 grams.  Establish a testing procedure to test the
  merchant's claim based on large samples and a level of significance
  of 5\%.  Evaluate his claim using sample evidence which shows that a
  random sample of 60 bricks averaged 447 grams with a standard
  deviation of 10 grams.
\item What is the probability of committing a Type I error in
  problem~\ref{item:butter}?
\item What would it mean to commit a Type II error in
  problem~\ref{item:butter} in terms of the words of the problem?
%The following problem uses data roughly taken from the plot on page
%40 of the following article where the solid dots are for the open
%cluster NGC 7160.
%METALLICITIES OF YOUNG OPEN CLUSTERS. I. NGC 7160 AND NGC 2232
%TalaWanda R. Monroe and Catherine A. Pilachowski
%I have added the spurious -.50 value for fun.  The mean metallicity
%is also a fabrication but the conclusion is plausible.
%Note that the article also mentions the radial velocity of stars as
%being a useful indicator of group membership.  Some tables are present
%comparing the stars to non-members.
\item An astronomer observes a group of over one thousand stars
  that appear to be clustered together in a small area of the sky.
  She believes that rather than being due to the random chance of
  stars being lined up along her line of sight, the stars appear
  clustered because they are actually near each other and likely have
  a common formation history.  To test her theory she measures the
  \emph{metallicity}\footnotemark of several stars in the group with
  the following results (dex):
\begin{center}
\begin{tabular}{cccccccc}
~-0.50~ & ~0.00~ & ~0.02~ & ~0.06~ & ~0.08~ & ~0.09~ & ~0.11~ & ~0.12~ \\ 
~0.14 & 0.19 & 0.19 & 0.20 & 0.22 & 0.25 & 0.30 & 0.38 \\
\end{tabular}
\end{center}
The astronomer consults a journal article that shows that stars in a
larger region of the sky in which the cluster lies have a metallicity
that is normally distributed with a mean of -.301\ . Test the the
claim, at a level of significance of 1\%, that the cluster stars have
this mean metallicity.  What is the likely explanation of the star with
metallicity~-0.50?

% The following problem is based on this statistic:
% The average rent for a two-bedroom apartment in Regina was $881 in October,
% according to Canada Mortgage and Housing Corp found in this article.
%  http://saskatoon.ctv.ca/servlet/an/local/CTVNews/20110310/sask-housing-feature-110310/20110310/?hub=Saskatoon
\item According to the Canadian Mortgage and Housing Corporation the
  average rent for a two-bedroom apartment in October, 2010 in Regina was \$881.
  Suspecting that the average rent for such dwellings has increased, a
  renter surveys 10 two-bedroom apartments and finds the following
  monthly rents (\$):
\begin{center}
\begin{tabular}{ccccc}
~750 & ~800 & ~810 & ~880 & ~910 \\
~925 & ~990 & 1000 & 1010 & 1030 
\end{tabular}
\end{center}
Evaluate the claim, at the 5\% level of significance using this data
that the rent is still~\$881.
\end{enumerate}
} \footnotetext{Astronomers consider \emph{metals} to be any element
  other than hydrogen and helium!  After the Big Bang, the universe
  was primarily hydrogen and helium, metals only forming later in
  stars, such as in supernova events.  A high metallicity therefore
  suggests a later generation star, such as our sun, which has formed
  out of such metal-enriched matter.  Metallicity is written as
  [Fe/H], which represents the logarithm of the ratio of a star's iron
  abundance, easily identified in the star's light spectrum, compared
  to that of the Sun.  A star with metallicity 0 has the same iron
  abundance as our sun, while metallicity of 1 would be 10 times
  solar, and -1 would be $1/10^{\mbox{th}}$ solar.}

\reading{Additional exercises
  pp 298 -- 300 \& 306 - 307.  Ignore all references to the p-value
  discussed in the textbook.}

\clearpage
\subsection[Single Proportion]{Testing Hypotheses About a Single Proportion}
We next consider tests involving a single population proportion,
\pprop.  For our purposes sample sizes must be large, as discussed in
Section~\ref{subsec:samplingproportions}, so that we may assume that
sample proportions are normally distributed.  The six step hypothesis
testing procedure applies here as well.

\example{%
  A government has a policy to provide funding to political parties
  with more than 4\% support.  A new political party emerges claiming
  that they have the required popular support.  Assuming the
  government will evaluate such a claim with a poll, devise a
  statistical test at the 5\% level of significance to determine
  whether the new party has the required support.}{%
\begin{enumerate}[Step 1)]
\item Formulate the null and alternative hypotheses.
\begin{itemize}
\item $\Ho:\pprop=0.04$\ \ $\Leftarrow$ The new party support is 4\%.
\item $\Ha:\pprop< 0.04$\ \ $\Leftarrow$ The government official doubts they have achieved this level of support.
\end{itemize}

\item State the level of significance.

$\alpha=0.05$\ \ $\Leftarrow$ As directed in the problem.

\item Determine the test statistic.

The official plans on using a sample of size $\ns=500$ for the
hypothesis test so, assuming the null hypothesis is true,
$\ns\pprop=(500)(.04)=20$ and $\ns(1-\pprop)=(500)(.96)=480$ which are
both greater than 5. We can therefore assume that \sprop\ will be
approximately normal normally distributed and thus a \Z\ test applies.
(For this course in tests about proportions this will always be the
case because large size samples will always be used.)

\item Establish a decision rule.

Draw a sampling distribution curve and determine the critical \Z\ value
which identifies the region in which the null hypothesis is rejected.
\begin{center}
\includegraphics[width=4in]{image3-41.png}
\end{center}
Here for the given area, $\Zcrit=-1.645$\ .

\item Evaluate the evidence.

  To evaluate the claim, a government official does a poll of 500 individuals
  and find the new party has the support of 15 individuals.

  The observed sample proportion is: $\displaystyle\sprop=\frac{\X}{\ns}=\frac{15}{500}=0.03$

  The standard error of proportion is:
  $\displaystyle\pserrprop=\sqrt{\frac{\pprop\cdot\left(1-\pprop\right)}{\ns}}=\sqrt{\frac{\left(0.04\right)\cdot\left(0.96\right)}{500}}=0.008764$

  (No \FCF\ was required to calculate \pserrprop\ as the population of
  eligible voters is assumed much larger than 500.)

  The calculated \Z\ value is: $\displaystyle
  \boxed{\Z=\frac{\sprop-\pprop}{\pserrprop}}=\frac{0.03-0.04}{0.008764}=-1.141$

  **Note that we have used the population parameter \pprop\ of the
  null hypothesis in the calculation of the standard error since we
  are assuming the null hypothesis is true and knowing \pprop\ is
  sufficient to calculate \pserrprop\ .**
\item State your decision.

  Since the \Z\ value does not lie in the region of rejection we fail
  to reject the null hypothesis~\Ho. At a level of significance of
  5\% there is no evidence to suggest the new party does not have the
  required 4\% support.
\end{enumerate}
}
A critic of the official who analyzed the support of the new party
questions how it is that the official is concluding the new party has
the required 4\% support when the poll only indicated 3\%. What could
the official have done to make a more convincing evaluation of the support?

\reading{Read pp 326 -- 329, Exercises in the textbook pp 332 - 333}
\newcommand{\singleprophypothesisanswers}{\begin{enumerate}
  \item $\Zcrit=-1.28$, $\Zcalc=-2.04$, therefore reject \Ho\ at
    $\alpha=.1$\ .  Evidence suggests that less than 40\% of
    households watched the program.
  \item $\Zcrit=-2.05$, $\Zcalc=-698.30$, therefore reject \Ho\ at
    $\alpha=.02$\ .  Evidence suggests a (very) significant decrease
    in the percent of women unaware occurred since 2008.
  \item $\Zcrit=-1.645$, $\Zcalc=-1.89$, therefore reject \Ho\ at
    $\alpha=.05$\ .  The counselor is incorrect; evidence suggests
    that less than 30\% of students hold a part-time job.
  \item $\Zcrit=\pm 2.326$, $\Zcalc=0.554$, therefore fail to reject
    \Ho\ at $\alpha=.02$\ .  The evidence does not support a change in
    the failure rate.
  \item No, this is not a proportion hypothesis test since the
    underlying variable is not a binomial (yes/no) qualitative
    variable.  Here the underlying variable \X\ itself is the fraction
    of a litre of gas that is ethanol which is quantitative.  The
    regulator could take a random sample of \ns\ measurements (buying
    one litre of gasoline at \ns\ different outlets and/or times) and
    measure the fraction of ethanol in each one and take its average
    \smean\ and then test the alternative hypothesis regarding the
    population mean that $\pmean<.06$\ .
\end{enumerate}
}
\clearpage
\assignment{\answer{\protect\singleprophypothesisanswers}\begin{enumerate}
  \item A television network sells advertising based on the proportion
    of the large metropolitan area it reaches that will watch a given
    program.  A company buys advertising during a particular show with
    the expectation that 40\% of households will be watching the
    program.  After the program airs the company samples 100
    households and finds that only 30 watched the show.  If the 10\%
    level of significance is used, can the null hypothesis that 40\%
    of the households would watch the program be rejected?
  % The following are actual stats taken from http://www.heartandstroke.sk.ca/
  \item In 2008, 68\% of Canadian women were unable to identify that
    the leading cause of death among women was stroke and heart
    disease. From 2008 onward the Heart and Stroke Foundation ran
    \emph{The Heart Truth} campaign to raise awareness of the severity
    of the issue and the warning signs associated with stroke and
    heart disease.  In 2011 if a Harris-Decima poll of 1,013 Canadian
    women found 53\% of Canadian women unable to identify their
    leading cause of death, can we conclude the proportion of women
    unable to identify their leading cause of death decreased over the
    three year interim period at the 2\% level of significance?
  \item A counselor claims that at least 30 percent of the students
    attending a local college hold a part-time job.  Doubting the
    claim, a college official does a random sample of 75 students
    finds that 15 have part-time jobs.  Is there adequate evidence to
    suggest that the counselor is incorrect in her claim at the
    5\% level of significance.  The college has approximately 2000
    students.
  \item In an effort to cut costs a computer chip manufacturer
    replaces a semiconducting material in an existing component with a
    cheaper material.  The manufacturer wishes to test the effect, if
    any, of such a change.  With the old material the failure rate of
    the component was 7\%.  If in a batch of 200 of the new components
    there are 16 failures, test the claim that the new failure rate is
    still 7\% at the 2\% level of significance.
  \item To meet a government regulation a gasoline retailer claims to
    contain at least 6\% ethanol by volume in its gasoline. A
    government regulator wishes to test this claim at the 5\% level of
    significance.  Would she use a proportion hypothesis test?
    Explain your answer.
  \end{enumerate}}
\clearpage
\newcommand{\reviewhypothesisanswersonep}{\begin{enumerate}
  \item $\Zcrit=1.645$, $\Zcalc=6.60$, therefore reject \Ho\ at $\alpha=.05$~. The evidence suggests an increase.
  \item $\Zcrit=2.33$, $\Zcalc=10.00$, therefore reject \Ho\ at $\alpha=.01$~. Evidence suggests the trucks weigh more than 25,000 kg.
  \item $\Zcrit=-1.28$, $\Zcalc=-2.00$, therefore reject \Ho\ at $\alpha=.10$~.  Evidence suggests less than 50\% are male. 
  \item $\Tcrit=\pm 3.499$, $\Tcalc=0.007$, therefore fail to reject
    \Ho\ at $\alpha=.01$~. Evidence does not support an adjustment be made.
  \item $\Zcrit=1.645$, $\Zcalc=1.267$, therefore fail to reject
    \Ho\ at $\alpha=.05$\ .  Evidence does not support an increase.
\end{enumerate}}
\subsection[One Parameter Review]{Review Exercises On One Parameter Hypothesis Testing}
\answer{\protect\reviewhypothesisanswersonep}
\begin{center}
  ** Use the formal six step procedure for hypothesis testing to do the
  following problems. **
\end{center}
\begin{enumerate}
\item A building products association sets standards for building
  sizes of products used in building construction. To set the standard
  for door heights, the association is interested in knowing if the
  average height of adult males in North America has increased from
  its previous value of 178~cm. A sample of 121 males shows an average
  height of 181~cm with a standard deviation of 5cm. Can an increase
  in the average height be supported at the 5\% level of significance?
\item A trucking firm claims that the weights of trucks it sends over
  a municipal road is 25,000 kg. Test the claim at the 1\% level of
  significance if a sample of 100 random weighings of the
  trucks shows a mean weight of 28,000 kg with a standard deviation of
  3000 kg.
\item It is thought that half of all winners of major prizes in
  raffles held at summer fairs are males. A random sample of 100 prize
  winners shows that 40 are male. At the 10\% level of significance
  can we conclude that less than half of all prize winners are male?
\item A drink dispenser is supposed to be set to fill an average of
  300 ml of beverage in a cup. Using a 1\% level of significance,
  should the drink dispenser be adjusted if a random sample of 8 cups
  filled showed the following volumes (ml):
\begin{center}
280\ \ 290\ \ 321\ \ 315\ \ 302\ \ 275\ \ 318\ \ 302
\end{center}
(Assume drink dispensations are approximately normally distributed.)
\item A large manufacturing company investigated the service it
  received from suppliers and discovered that, in the past, 68\% of
  all materials shipments were received on time.  However, the company
  recently installed a just-in-time system in which suppliers are
  linked more closely to the manufacturing process.  A random sample
  of 110 deliveries since the just-in-time system was installed
  reveals that 81 deliveries were on time.  Use this sample
  information to test whether the proportion of on time deliveries has
  significantly increased at the 5\% level.
\end{enumerate}
\reading{Chapters 11, 12, 13, \& 14  review exercises in the textbook
pages 351 to 356}
\clearpage
\subsection[Difference Between Means]{Testing Hypotheses About the Difference Between Means}
\label{subsec:meandiff}
Sometimes we are interested in testing whether two means are
different.  For instance, imagine that a breakfast cereal manufacturer
produces the same boxes of cereal at two different plants.  Suppose
the manufacturer suspects that the mean weight of a box coming from
plant $A$ actually differs from the mean weight of a box at plant $B$.
Obviously one cannot test every box of cereal produced by each plant
to calculate their respective mean weights to see if they are the
same, so a sample would be taken at each and its mean value
calculated.  These sample means would have some error from their true
means, so a difference in their values would not necessarily imply a
difference in the population means of the different plants.  How can
we resolve this?  We start by making our null hypothesis that the two
populations really are the same, with same mean and standard
deviation.  If that were the case our two samples would be just two of
many possible samples from the one large population and we can ask how
the difference of two such means will be distributed.  If our measured
difference in that scenario appears extraordinary then we will reject
the null hypothesis.

In order to test a hypotheses about the difference in population
means, it is therefore necessary to analyze the distribution of the
difference between sample means drawn from the same population.

\example{Suppose that two different samplers each select a random sample of 64
boxes of a popular breakfast cereal. The stated net contents on the box
is 500g. 
\begin{center}
\includegraphics[width=5in]{image3-33.png}
\end{center}
Each sampler has the possibility of observing \com{\np}{64} different sample
means. The \CLT\  describes the behaviour of each of these distributions.
If we were able to list the joint possibilities for the samplers and
calculate the difference in their results we might see a table such as
this:
\begin{center}
\includegraphics[width=4in]{image3-34.png}
\end{center}
%The distribution of the difference between sample means\end{minipage}
%X1 &
%X2 &
%X1 -- X2\\\hline
%512 &
%502 &
%+10\\\hline
%490 &
%504 &
%{}-14\\\hline
%497 &
%492 &
%+5\\\hline
There will be the same number of observable possible differences as
there are individual possible paired samples.  The difference of
sample means $\smean_1-\smean_2$ is itself a variable over the
population comprised of paired samples.}

\subsubsection{Large Independent Samples}
\label{subsubsec:largeinddiffmeans}
As just demonstrated, the difference of sample means is itself a
variable over the population comprised of paired samples.  The
distribution of the difference between sample means
$\smean_1-\smean_2$ from the same population has these three
characteristics:\footnote{The sum (difference) of two normal variables
  \X\ and \Y\ is itself normally distributed with a mean which is the
  sum (difference) of the means,
  $\pmean_{\s\X\pm\Y}=\pmean_{\s\X}\pm\pmean_{\s\Y}$, and a variance
  satisfying $\pvar_{\s\X\pm\Y}=\pvar_{\s\X}+\pvar_{\s{\Y}}$.  In our
  case the two variables are $\smean_1$ and $\smean_2$.  Since our
  samples are of large size, these are, by the \CLT\,, normally
  distributed with means both equalling \pmean\ and standard
  deviations approximated by the sample standard errors in the mean,
  $\sdev_1/\sqrt{\ns_1}$ and $\sdev_2/\sqrt{\ns_2}$, from which our
  results above follow.  It is to be noted that the general property,
  namely that the variance of the sum or difference of two normal
  variables is added in quadrature, is also useful in combining error
  estimates in calculations.}
\begin{enumerate}
\item If the sample size is large and the samples are drawn independently,
the shape of the distribution will be very close to normal.
\item The mean difference will be zero.
\[\pmean_{\s\smean_1-\smean_2}=0\]
\item The standard error of the difference between means \textbf{in
    theory} is found by this formula:
\[\pdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\pvar}{\ns_{\s1}}+\frac{\pvar}{\ns_{\s2}}}\]
\textbf{In practice}, the standard deviation of the population, \pdev,
is unknown. In the case of large samples each sample standard
deviation is used as an estimate of the population value. In practice
the standard error formula therefore is:
\[\boxed{\sdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\svar_{\s1}}{\ns_{\s1}}+\frac{\svar_{\s2}}{\ns_{\s2}}}}\]
\end{enumerate}
\example{Management at a large company wishes to know if there is a
  significant increase in the average sales performance between
  salespeople who receive a certain type of training over sales people
  who do not receive the training. We wish to test this at the 5\%
  level of significance based on large independent samples.}{%
\begin{enumerate}[Step 1)]
\item Formulate the null and alternative hypotheses.

  The null hypothesis would take the view that the populations of
  sales people were the same. That is that there should be no
  difference between the means in the populations. The hypotheses
  statements must be formulated as differences so that we can use the
  sampling distribution for the test.  Let the subscript $T$ refer to
  trained and $NT$ to not trained.
\begin{itemize}
\item $\Ho:\pmean_{\s T}-\pmean_{\s NT}=0$
\item $\Ha:\pmean_{\s T}-\pmean_{\s NT}>0$\ \ $\Leftarrow$ We suspect $\pmean_{\s T}>\pmean_{\s NT}$ which implies this.
\end{itemize}
\item State the level of significance.

Use an  $\alpha= 0.05$ as directed in the problem.

\item Determine the test statistic.

A \Z\ test applies because the decision will be based on large,
independent samples.

\item Establish a decision rule.
\begin{center}
\includegraphics[width=3in]{image3-35.png}
\end{center}
For the given tail area we have $\Zcrit=1.645$\ .

\item Evaluate the evidence.

  Suppose 60 salespeople were trained and compared to 80 salespeople
  who were not trained. The sample results are summarized in the
  following table:
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
& Mean Weekly Sales  (\$) & Standard Deviation (\$) & Number In Group\\\hline
Trained Group & 5000 & ~800 & 60 \\\hline
Untrained Group & 4700 & 1100 & 80\\\hline
\end{tabular}
\end{center}
The observed difference in means is: 
\[\smean_{\s T}-\smean_{\s NT}=\$5000-\$4700=\$300\]
To test the significance of this difference we must see where it lies on
the sampling distribution curve.
\[\sdev_{\s\smean_T-\smean_{NT}} =\sqrt{\frac{\smean_{\s T}^2}{\ns_{\s T}}+\frac{\smean_{\s NT}^2}{\ns_{\s NT}}}=\sqrt{\frac{800^2}{60}+\frac{1100^2}{80}}=\$160.60
\]
The \Z\ value for this sampling distribution is calculated by:
\[\boxed{\Z=\frac{\left(\smean_{\s T}-\smean_{\s NT}\right)-0}{s_{\s\smean_T-\smean_{NT}}}}=\frac{300-0}{160.60}=+1.87\]
\item State your decision.

  Because the observed \Z\ value lies in the region of rejection the
  decision would be to reject~\Ho: Based on the evidence, at a 5\%
  level of significance, the average weekly sales for trained salespeople is higher than the average weekly sales for untrained salespeople.

  (If we had a calculated \Z\ of a value like +0.87, the decision
  would be: There is no evidence to suggest a difference in the
  average weekly sales between trained and untrained salespeople.)
\end{enumerate}}
\reading{Read the textbook pages 307 to 313}
\reading{Exercises pages 314 - 315}

\subsubsection{Small Independent Samples}
In certain cases it is too costly or time consuming to draw large
samples in order to test assertions about the difference between
population means. If smaller sample sizes are used, there is another
sampling distribution used in the decision rule.

\example{Take the case of the two samplers of cereal boxes from the
  Section~\ref{subsec:meandiff} and let us suppose that they drew
  samples less than 30 in size.
\begin{center}
\includegraphics[width=4in]{image3-37.png}
\end{center}
In this case the difference of sample means will not have a normal
distribution because the sample sizes are not large enough.  However,
we do know from Section~\ref{subsec:smallmean} that if the underlying
distribution of the weights, \X, is normal then the sample means will
each have a \T\ distribution.  It turns out that this will also be the case
for the difference of the sample means.}

If we were able to draw the distribution curve of the net contents of
all the boxes manufactured and it resulted in a bell curve, the
distribution of the difference between sample means from the same
population has these three characteristics:
\begin{enumerate}
\item When the sample size is small and the samples are drawn
independently, the shape of the distribution will be a \T\ curve with
\[\boxed{\df=\ns_{\s1}+\ns_{\s2}-2}\]
degrees of freedom.
\item The mean difference will be zero.
\[\pmean_{\s\smean_1-\smean_2}=0\]
\item The standard error of the difference between means \textbf{in theory} is found
by this formula:
\[\pdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\pvar}{\ns_{\s1}}+\frac{\pvar}{\ns_{\s2}}}\]
\end{enumerate}
\textbf{In practice}, the standard deviation of the population, \pdev, is
unknown. In the case of small samples, the variability in each sample
is pooled into one large sample to obtain an estimate of the population
standard deviation. The pooled estimate of \pdev\ is \spool.
\begin{center}
\includegraphics[width=4in]{image3-38.png}
\end{center}
Recall from page~\pageref{subsec:smallmean} that the variance of a sample can be defined as:
\[\svar=\frac{\sum\left(\X-\smean\right)^2}{\df}\]
The pooled estimate of variance,  $\spool^2$ is defined using the
above definition:
\[\spool^2=\frac{\sum\left(\X-\smean_{\s1}\right)^2
+\sum\left(\X-\smean_{\s2}\right)^2}{\left(\ns_{\s1}-1\right)+\left(\ns_{\s2}-1\right)}
=\frac{\left(\ns_{\s1}-1\right)\cdot\sdev_{\s1}^2+\left(\ns_{\s2}-1\right)\cdot\sdev_{\s2}^2}{\ns_{\s1}+\ns_{\s2}-2}\]
Substitute the pooled estimate into the theoretical standard error
formula estimate
\[\sdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\spool^2}{\ns_{\s1}}+\frac{\spool^2}{\ns_{\s2}}}=\sqrt{\spool^2\cdot\left[\frac{1}{\ns_{\s1}}+\frac{1}{\ns_{\s2}}\right]}\ ,\]
to obtain
\[\boxed{\sdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\left(\ns_{\s1}-1\right)\cdot\sdev_{\s1}^2+\left(\ns_{\s2}-1\right)\cdot\sdev_{\s2}^2}{\ns_{\s1}+\ns_{\s2}-2}\cdot\left[\frac{1}{\ns_{\s1}}+\frac{1}{\ns_{\s2}}\right]}}\]
\reading{Read your textbook pages 311 to 313}

\example{Platinum is a very expensive metal. A purchaser wishes to know if there
is any significant difference in the mean weight of a platinum item
supplied by Supplier $A$ versus those supplied by supplier $B$.  It is
assumed that the weight of platinum parts supplied by all suppliers is
distributed normally.  Because of the expense involved, a small random
sample of parts will be tested from each supplier. Test the assumption
that there is no difference in the weights of parts supplied by these
two suppliers at the 10\% level of significance if 12 items are tested
from each supplier.}{%
\begin{enumerate}[Step 1)]
\item Formulate the null and alternative hypotheses.
\begin{itemize}
\item $\Ho:\pmean_{\s A}-\pmean_{\s B}=0$
\item $\Ha:\pmean_{\s A}-\pmean_{\s B}\neq0$\ \ $\Leftarrow$ We suspect $\pmean_{\s A}\neq\pmean_{\s B}$ which implies this.
\end{itemize}
\item State the level of significance.

Use an $\alpha=0.10$ as directed in the problem.
\item Determine the test statistic.

A \T\ test applies because the decision will be based on small,
independent samples drawn from a normal population.

\item Establish a decision rule.
\begin{center}
\includegraphics[width=4in]{image3-39.png}
\end{center}
For our given tail area and using a \T\ distribution we have
$\Tcrit=\pm 1.717$\ .

\item Evaluate the evidence.

The sample results are summarized in the following table:
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
Supplier & Mean Weight (g) & Standard Deviation (g) & Number\\\hline
$A$ & 17 & 2 & 12\\
$B$ & 20 & 4 & 12\\\hline
\end{tabular}
\end{center}
The observed difference in means is:
\[\smean_{\s A}-\smean_{\s B}=17\ \mbox{g}-20\ \mbox{g}=-3\ \mbox{g}\]
To test the significance of this difference we must see where it lies on
the sampling distribution curve.

Calculate the standard error of the sampling distribution.
\begin{eqnarray*}
\sdev_{\s\smean_A-\smean_B} & = & \sqrt{\frac{\left(\ns_{\s A}-1\right)\cdot\sdev_{\s A}^2+\left(\ns_{\s B}-1\right)\cdot\sdev_{\s B}^2}{\ns_{\s A}+\ns_{\s B}-2}\cdot\left[\frac{1}{\ns_{\s A}}+\frac{1}{\ns_{\s B}}\right]} \\
& = & \sqrt{\frac{\left(12-1\right)\cdot2^2+\left(12-1\right)\cdot4^2}{12+12-2}\cdot\left[\frac{1}{12}+\frac{1}{12}\right]} \\
& & \\
& = & 1.29\ \mbox{g}
\end{eqnarray*}
Calculate the \T\ value for the observed sample difference.
\[\boxed{\T=\frac{\left(\smean_{\s A}-\smean_{\s B}\right)-0}{s_{\s\smean_A-\smean_{B}}}}=\frac{-3-0}{1.29}=-2.32\]
\item State your decision.

  Because the observed \T\ value lies in the region of rejection the
  decision would be to reject~\Ho: Based on the evidence, at a 10\%
  level of significance, there is a difference in the mean weight of
  the platinum parts supplied by these two suppliers.
\end{enumerate}
}
\reading{Exercises in the textbook pages 313 - 315}
\clearpage
\newcommand{\diffmeananswers}{\begin{enumerate}
  \item $\Zcrit=\pm 1.96$, $\Zcalc=2.61$, therefore reject \Ho\ at
    $\alpha=.05$\ .  The evidence suggests that there is a difference
    between the average monthly household incomes in the two
    communities.
  \item $\Tcrit=2.681$, $\Tcalc=0.45$, therefore fail to reject
    \Ho\ at $\alpha=.01$\ .  The evidence does not support an increase
    in sales..
  \item No.  $\Zcrit=-1.28$, $\Zcalc=-1.06$, therefore fail to reject
    \Ho\ at $\alpha=.10$\ .  The evidence does not support the
    hypothesis that a person with enhanced sleep performed the task in
    less time with statistical significance.
\end{enumerate}}
\assignment{\answer{\protect\diffmeananswers}\begin{enumerate}
  \item A researcher wishes to test if there is a difference between
    the average monthly household income in two large communities.  A
    random sample of 40 households in the first community has a mean
    of \$1,900 with a standard deviation of \$540.  For the second
    community a sample of 30 households has a mean of \$1,600 with a
    standard deviation of \$420.  Using the five percent level of
    significance, test the hypothesis that there is no difference
    between the average monthly household income in the two
    communities.
  \item The Moose Jaw Sporting Goods Company wishes to evaluate the
    use of advertising to increase sales.  To do so they placed an
    advertisement on television that was shown three times during the
    live broadcast of the Saskatchewan Roughriders' first away game.
    The sales for each of the seven days after the ad was placed to be
    compared with the sales for the seven days immediately before
    running the ad.  The following data representing the total dollar
    sales each day were collected:
    \begin{center}
      \begin{tabular}{|c|c|}\hline
        Sales Before Ad (\$) & Sales After Ad (\$) \\ \hline
        1,765 & 2,045 \\
        1,543 & 2,456 \\
        2,867 & 2,590 \\
        1,490 & 1,510 \\
        2,800 & 2,850 \\
        1,379 & 1,255 \\
        2,097 & 2,255 \\ \hline
      \end{tabular}
    \end{center}
    Based on the sample data, would you conclude that there was a
    significant increase in sales after the advertising?  Test using
    an alpha level of 0.01.  Assume the population of sales is
    normally distributed.
\item In an attempt to evaluate the hypothesis that a ``good night's
  sleep'' gives better performance, a researcher created two groups of
  subjects.  Those with regular sleep (group~R) were allowed to sleep
  up to 7 hours maximum at night, while the second group with enhanced
  sleep (group~E) were allowed up to 9 hours of sleep.  After 1 week
  all individuals in the study were timed to see how long it took each
  of them to accomplish the same task involving motor skills and
  coordination.  The 40 individuals in the regular sleep group had a
  mean time of 53.1 seconds with a standard deviation of 8.0 seconds,
  while the 50 in the enhanced sleep group took an average time of
  51.2 seconds with a standard deviation of 9.0 seconds to accomplish
  the task.  Can we concluded that the average time required by a
  person with enhanced sleep (E) is significantly less than that of a
  person with regular sleep (R) at the 10\% level of significance?
\end{enumerate}}
\clearpage

\subsection[Difference Between Proportions]{Testing Hypotheses About the Difference Between Proportions (Large Samples)}
As with the comparison of two means, we may also be interested in
comparing to proportions.  For instance, we might be interested in
knowing if two different groups have a different incidence of
diabetes.  If we could test each member of the two groups to see if
they had diabetes we could work out the proportions to see if they are
equal or not.  However this is too costly so we want, instead, to
sample each group and get an estimate of the proportions and compare
these.  However, due to the sampling error, each such proportion
differs from its true group's proportion and thus a difference in
sample proportions does not imply a difference in the two actual
proportions.  Once again we proceed by assuming a null hypothesis that
there is no difference between the actual proportions of the two
groups.  The two samples would then just belong to one larger
population with the same proportion.  We can then consider how
differences between such sample proportions are distributed.  If we
find that our measured difference is exceptional, we will reject the
null hypothesis.  We thus need to know how the difference between to
sample proportions drawn from the same population is distributed.

\example{Take the case of two market analysts who sample a population of
households to determine the proportion of households that consume more
than 2 packages of potato chips per week. 
\begin{center}
\includegraphics[width=4in]{image3-42.png}
\end{center}
Sampler 1 could find any of \com{\np}{\ns_{\s1}}\ possible sample
proportions while Sampler 2 could find any of \com{\np}{\ns_{\s2}}\
possible sample proportions.  Assuming the sample sizes are large
enough these sample proportions will each be normally distributed.  If
we were able to list the joint possibilities from the samplers and
calculate the difference in their results we could see a table like
this:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
~~$\sprop_{\s1}$~~ & ~~$\sprop_{\s2}$~~ & $\sprop_{\s1}-\sprop_{\s2}$ \\ \hline
~.32 & ~.29 & ~.03 \\
~.22 & ~.26 & -.04 \\
~.31 & ~.30 & ~.01 \\
-\ -\ - & -\ -\ - & -\ -\ - \\
-\ -\ - & -\ -\ - & -\ -\ - \\ \hline
\end{tabular}
\end{center}
The difference between proportions $\sprop_{\s1}-\sprop_{\s2}$ is
itself a variable over the population of paired samples.}

If two samples are drawn from the same population and the sample sizes
are sufficiently large so that $\ns\sprop>5$ and $\ns(1-\sprop)>5$ the
distribution of the difference between the sample proportions
$\sprop_{\s1}-\sprop_{\s2}$ has these three
characteristics:\footnote{These results follow from the properties of
  combining normal variables outlined in the footnote on
  page~\pageref{subsubsec:largeinddiffmeans} and the known standard
  deviation and mean of the proportion sampling distributions.}
\begin{enumerate}
\item The difference will be normally distributed.
\item The mean difference will be zero:
\[\pmean_{\s\sprop_1-\sprop_2}=0\]
\item The standard error of the difference between proportions
  \textbf{in theory} is found by this formula:
\[\pdev_{\s\sprop_{1}-\sprop_2}=\sqrt{\frac{\pprop\cdot\left(1-\pprop\right)}{\ns_{\s1}}+\frac{\pprop\cdot\left(1-\pprop\right)}{\ns_{\s2}}}\]
\textbf{In practice}, the proportion of the population, \pprop, is unknown. In the case of small samples, the variability in
each sample is pooled into one large sample to obtain an estimate of
the population proportion.
\begin{center}
\includegraphics[width=4in]{image3-43.png}
\end{center}
The pooled estimate of \pprop\ is \proppool\ given by
\[\boxed{\proppool=\frac{\X_{\s{1}}+\X_{\s{2}}}{\ns_{\s{1}}+\ns_{\s{2}}}}\]
Substitute the pooled estimate into the standard error formula to
obtain:
\[\sdev_{\s\sprop_1-\sprop_2}=\sqrt{\frac{\proppool\cdot\left(1-\proppool\right)}{\ns_{\s1}}+\frac{\proppool\cdot\left(1-\proppool\right)}{\ns_{\s2}}}\ ,\]
or, as found on the formula sheet,
\[\boxed{\sdev_{\s\sprop_1-\sprop_2}=\sqrt{\proppool\cdot\left(1-\proppool\right)\cdot\left[\frac{1}{\ns_{\s1}}+\frac{1}{\ns_{\s2}}\right]}}\ .\]
\end{enumerate}
%The next example uses completely fabricated data.
\example{A biologist believes that during afternoon hours a greater
  proportion of elk that are active are female than in the
  evening. Test this claim at the 1\% level of significance.}{%
\begin{enumerate}[Step 1)]
\item Formulate the null and alternative hypotheses.
\begin{itemize}
\item $\Ho:\pprop_{\s A}-\pprop_{\s E}=0$\ \ $\Leftarrow$ There is no difference in the proportions (equivalent to $\pprop_{\s A}=\pprop_{\s E}$) 
\item $\Ha:\pprop_{\s A}-\pprop_{\s E}>0$\ \ $\Leftarrow$ The biologist suspects $\pprop_{\s A}>\pprop_{\s E}$ which implies this.
\end{itemize}
\item State the level of significance.

Use an $\alpha=0.01$ as directed in the problem.
\item Determine the test statistic.

A \Z\ test applies because the decision will be based on large sample
observations of proportion.  Specifically we check (see evidence
below) that $\ns_{\s A}\sprop_{\s A}=(350)(.643)=225$, $\ns_{\s
  A}(1-\sprop_{\s A})=(350)(.357)=125$, $\ns_{\s E}\sprop_{\s
  E}=(200)(.500)=225$, and $\ns_{\s E}(1-\sprop_{\s E})=(200)(.500)=100$
are all greater than 5.

\item Establish a decision rule.
\begin{center}
\includegraphics[width=4in]{image3-44.png}
\end{center}
For our given tail area and using the normal distribution we have
$\Zcrit=2.33$\ .

\item Evaluate the evidence.

  The biologist observes elk that are active in the afternoon and in the evening.  The two sample
  results are summarized in the following table:
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
Time & Number of Females & Number of  Males & Total Number\\\hline
Afternoon & 225 & 125 & 350\\
Evening~~ & 100 & 100 & 200\\\hline
Total~~~~ & 325 & 225 & 550\\\hline
\end{tabular}
\end{center}
The observed difference in proportions is: $\displaystyle\sprop_{\s A}-\sprop_{\s E}=\frac{225}{350}-\frac{100}{200}=0.643-.500=0.143$

To test the significance of this difference we must see where it lies on
the sampling distribution curve.

Calculate the pooled estimate of the population proportion.
\[\proppool=\frac{\X_{\s A}+\X_{\s E}}{\ns_{\s A}+\ns_{\s E}}=\frac{225+100}{350+200}=0.591\]
Calculate the standard error of the sampling distribution.
\[\sdev_{\s\sprop_A-\sprop_E}=\sqrt{\proppool\cdot\left(1-\proppool\right)\cdot\left[\frac{1}{\ns_{\s A}}+\frac{1}{\ns_{\s E}}\right]}=\sqrt{0.591\cdot\left(1-0.591\right)\cdot\left[\frac{1}{350}+\frac{1}{200}\right]}=0.04358\]
Calculate the \Z-value for the observed sample difference.
\[\boxed{\Z=\frac{\left(\sprop_{\s A}-\sprop_{\s E}\right)-0}{\sdev_{\s \sprop_A-\sprop_E}}}=\frac{0.143-0}{0.04358}=3.28\]
\item State your decision.

  Because the observed \Z\ value lies in the region of rejection the
  decision would be to reject~\Ho: Based on the evidence, at a 1\%
  level of significance, the proportion of active elk which are female
  is greater in the afternoon than in the evening.
\end{enumerate}
}
\reading{Read your textbook pages 329 to 331}
\reading{Exercises in the textbook pages 332 - 333}
\clearpage
\newcommand{\twoproportionhypothesisanswers}{\begin{enumerate}
  \item $\Zcrit=1.645$, $\Zcalc=1.05$, therefore fail to reject
    \Ho\ at $\alpha=.05$\ .  There is no evidence to suggest that a
    higher proportion of business students have part-time jobs than
    science students.
\item\begin{enumerate}
  \item $\Zcrit=\pm1.28$, $\Zcalc=1.82$, therefore reject \Ho\ at
    $\alpha=.20$\ .  The evidence supports a difference in the ability
    of the two swallow types to carry coconuts.
  \item It becomes a right-tailed test ($\Ha:
    \pprop_{\s A}-\pprop_{\s E}>0$) with $\Zcrit=0.84$~.  Still reject
    $\Ho$ and accept $\Ha$ but now evidence supports that African
    swallows are better carriers than European ones.
\end{enumerate}
  \end{enumerate}}
\assignment{\answer{\protect\twoproportionhypothesisanswers}\begin{enumerate}
  \item A counselor at a college suspects that a higher proportion of
    business students holds part-time jobs than do science students.
    To test the hypothesis, a random sample of 100 business students
    was taken and 30 had part-time jobs, while a sample of 150 science
    students found 36 with part-time jobs.  The two programs have
    large enrolments (so use of an \FCF\ is not required.)  Can the
    counselor confirm his suspicion at the~5\% level of significance?
  \item In the 1975 comedy ``Monty Python and the Holy Grail'', it is
    suggested that there would be a difference between the ability of
    an African swallow and a European swallow to carry a coconut over
    a large distance.  To test the claim, an ornithologist (with too
    many financial resources and no ethics) attaches coconuts to 40
    African swallows and 36 European swallows and releases them from a
    common location.  Using transmitters he has inserted in the
    coconuts the researcher is able to determine that 18 of the
    African and 9 of the European swallows were able to travel a
    distance of over 100 km with coconuts intact.
%No animals were harmed in the creation of this statistics problem.
\begin{enumerate}
\item Can the researcher conclude at the 20\% level of significance
  that there is a difference in the ability of African and European
  swallows to travel laden with coconuts?
\item How would the problem change if one had hypothesized that
  African swallows were better coconut carriers than European ones (at
  the 20\% level of significance)?
\end{enumerate}
\end{enumerate}}
 \clearpage
 \newcommand{\reviewhypothesisanswerstwop}{\begin{enumerate}
   \item $\Zcrit=\pm2.575$, $\Zcalc=2.89$, therefore reject \Ho\ at
     $\alpha=.01$~.  Evidence suggests that the proportions preferring
     an accountant differ.
   \item $\Tcrit=-2.457$, $\Tcalc=-1.88$, therefore fail to reject
     \Ho\ at $\alpha=.01$~.  The evidence does not support that the
     firm's professionals earn less.
   \item $\Zcrit=1.645$, $\Zcalc=3.06$, therefore reject \Ho\ at
     $\alpha=.05$.  Evidence suggests foreign cars are more expensive
     to repair on average.
 \end{enumerate}}
 \subsection[Two Parameter Review]{Review Exercises on Two Parameter Hypothesis Testing}
 \answer{\protect\reviewhypothesisanswerstwop}
 \begin{center}
   ** Use the formal six step procedure for hypothesis testing to do the
   following problems. **
 \end{center}
\begin{enumerate}
\item  A study of financial planning services showed that 380 of 1160
people who were over 45 years of age preferred an accountant for
assistance in their financial planning. Of those 45  years of age and
less, 120 of 470 surveyed preferred an accountant for assistance in
their financial planning. Using an alpha risk of 1\%,  is there a
difference between the two groups in the proportion who prefer an
accountant for financial planning. 
\item A firm hires a large number of professional people to carry out
the services it offers. At salary negotiation time, the question is
always raised as to whether the professionals at this firm earn similar
wages on average to professionals in other firms who do similar duties.
Can the firm conclude at the 1\% level that its professionals earn less
based on the following sample results?
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
Professionals & Average Wage(\$/yr) & Std Dev(\$/yr) & Number\\\hline
Internal & 45000 & 5000 & 15\\
External & 48000 & 4000 & 17\\\hline
\end{tabular}
\end{center}
\item An insurance company wishes to know whether foreign cars are more
expensive to repair than domestic cars on average. Can their claim be
supported at the 5\% level if the following sample results are
observed?
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
 & Average Repair (\$) & Std Dev (\$) & Number\\\hline
Domestic & 8000 & 2000 & 50\\
Foreign & 9500 & 3100 & 60\\\hline
\end{tabular}
\end{center}
\end{enumerate}
\reading{Chapters 11, 12, 13, \& 14  review exercises in the textbook
pages 351 to 356}

\section{Paired Data Analysis}
\subsection[Introduction]{Introduction To Paired Data Analysis}

\textbf{Paired data analysis} refers to those situations where two data sets are
analyzed to see if there are any trends or relationships between the
variables.

\example{Consider the following questions:
\begin{enumerate}
\item Is there any relationship between the variation in time spent on
training an employee and the performance of salespeople on the job?
\item Is there any relationship between the variation in money a
  government spends on the military (per capita) and the number of
  times the government goes to war over the same time period?
\item Is there any relationship between the variation in the amounts
  of money spent on advertising in an area and the sales volume in
  that area?
\item Is there any relationship between the variation in the frequency
  of numbers that are played in a lottery and the relative frequency
  of numbers that win in the lottery?
\item Is there any relationship between the period of oscillation of a
  Cepheid variable star and its intrinsic brightness (absolute
  magnitude)?
\end{enumerate}}

Each of the above examples contains two quantities which vary. The
variability in these quantities is pictured by way of a mathematical
graph. In paired data analysis a theoretical mathematical curve is
assumed to occur between variables.  When a set of paired data is
analyzed by the technique of \textbf{linear regression}, the
assumption is made that there is a straight line which best describes
the relationship between the data sets.  We will restrict ourselves to
this type of curve fitting.

\example{A municipal parks department is interested in knowing the
  relationship between the price of a lawnmower in their fleet of
  small lawnmowers and the number of breakdowns it has over a five
  year period.  A random sample of 10 lawnmowers are studied.  The
  observations are summarized as follows:
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}\hline
Price(\$) & 600 & 300 & 200 & 500 & 100 & 700 & 100 & 400 & 100 & 200\\\hline
\# of Breakdowns & 1 & 2 & 2 & 1 & 4 & 0 & 3 & 2 & 1 & 4\\\hline
\end{tabular}
\end{center}} The attributes of each lawnmower are identified by two
numbers which combine to make an \textbf{ordered pair}.  In
statistical analysis, as in other disciplines, the ordered pairs are
plotted on a \textbf{coordinate plane}. The variable plotted on the
horizontal axis is called the \textbf{independent variable} while the
variable that is plotted on the vertical axis is called the
\textbf{dependent variable}. For purposes of later calculations, the
independent variable is always identified by the symbol \X\ while the
dependent variable is always identified by the symbol \Y. The ordered
pairs formed by the paired data are plotted in the form of a
\textbf{scatter diagram} on the coordinate axes. It is important that
the dependent variable be plotted on the vertical axis.

In regression analysis the objective is to predict the value of \Y\
given a value of \X. The dependent variable can always be identified
because it is the quantity that is to be predicted in the
relationship.  The predicted value of \Y\ will be designated by \Yp\
to distinguish from the \Y\ coordinate of a potential data point or
points with the same \X\ coordinate.  \example{In the previous example
  the variable \X\ is the price while \Y\ is the number of breakdowns.
  This is because the purchaser is in control of how much he wishes to
  spend on the lawnmower which is the nonrandom input, while the
  number of breakdowns is that which is uncertain or random, perhaps
  dependent upon the input price, and what we wish to predict.  The
  ordered pair corresponding to the third lawnmower is
  $(\X,\Y)=(\$200, 2\ \mbox{breakdowns})$.  A scatter diagram of the
  data is
\begin{center}
\includegraphics[width=4in]{image3-52.png}
\end{center}}

The statistical population in paired data analysis is the collection
of all possible ordered pairs that could be observed.  The
characteristics of this population are described by its
\textbf{parameters}, just as before we found parameters for describing data
belonging to a single variable \X\ such as the mean, \pmean.

For data with a linear trend, such as the lawnmower data above, it is
possible to characterize the population by a best fit straight line
which runs through the data.  Since the data consists of more than two
points, any line can only approximate the points.  Note, however, that
our goal is not to reconstruct the random scatter of the data with our
line, but rather to give an indication of what we expect for a given
input value \X.

A straight line can be described
completely by two parameters; the \textbf{slope} and the
\textbf{vertical axis intercept}.

The vertical axis intercept can be determined by inspection of the
graph or by calculating the value of \Y\ when $\X=0$. The intercept
parameter is designated by the symbol \pyint\ in statistics. Recall
parameters are designated by Greek letters to show their theoretical
nature.

The definition of the slope of a line is the ratio of the rise to the
run between any two points along the line. The slope parameter is
designated by the symbol \pslope\ in statistics, and satisfies the
relation:
\[\pslope=\frac{\Delta\Y}{\Delta\X}\]
The equation, in terms of its parameters,  which governs the
relationship between variable \X\ and variable \Y\ along a straight line
always takes the form:
\[\Yp=\pyint+\pslope\X\]

When analyzing single variables we saw how a sample from the
population produced an estimate, such as \smean\ of the true, and
usually unknown, population parameter \pmean.  In the same way a
sample data set, such as for our lawnmowers, will only produce an
estimate of the best-fit line that would theoretically exist through
the entire population of lawnmower data.  As such a best fit line to
the sample data will be written
\[\boxed{\Yp=\syint+\sslope\X}\]
where \syint\ estimates \pyint, and \sslope\ estimates
\pslope.\footnote{The student should note that our statistical
  notation deviates from that commonly used for the slope-intercept
  form of the line, namely $y=mx+b$.  Our $b$ in statistics is the
  slope not the $y$-intercept of the line.}

\example{For the lawnmower scatter diagram, use a ruler to draw a best
  fit straight line through the data.  Approximate~\syint\ by
  examining the intersection with the vertical axis and~\sslope\ by
  drawing a triangle of appropriate size and calculating its rise and
  the run.  Fill in your equation for \Yp\ and use it to predict the
  number of breakdowns that the municipality would expect if it pays
  \$400 for a lawnmower.}{%
\raisebox{-.75in}{\includegraphics[width=3in]{image3-52.png}}~\vline%
\begin{minipage}{2.5in}
\begin{itemize}
\item $\displaystyle \syint\approx\rule[-.8em]{0em}{2em}$
\item $\displaystyle \sslope\approx\frac{\Delta\Y}{\Delta\X}=\rule[-.8em]{0em}{2em}$
\item $\displaystyle \Yp\approx\left(\rule[-.8em]{0em}{2em}~~~~~\right)+\left(\rule[-.8em]{0em}{2em}~~~~~\right)\X$
\item $\displaystyle \Yp\approx\left(\rule[-.8em]{0em}{2em}~~~~~\right)+\left(\rule[-.8em]{0em}{2em}~~~~~\right)(\$400)=$
\end{itemize}
\end{minipage}

Note that your predicted value for the number of breakdowns, \Yp, at
$\X=\$400$ likely is not the same as the data \Y-value, $\Y=2$
breakdowns, found at that same \X.}
%Draw the sketch of the straight line which is given by the equation: Y =
%6 + 5X.
%Exercises On Sketching Straight Lines
%\begin{enumerate}
%\item Sketch the graph of Y = 2X + 7.
%\item Sketch the graph of Y = -4X + 10
%\item Sketch the graph of 2X + 5Y = 8
%\item What is the X value of the ordered pair where Y = 7 if the
%parameters of the straight line are ${\alpha}$ = 4 and ${\beta}$ = 12?
%\item What is the Y value of the ordered pair where X = 4 if the
%parameters of the straight line are ${\alpha}$ = 14 and ${\beta}$ = -6?
%\end{enumerate}
\subsection{The Least Squares Criteria}
Cases where data points do not line up along a straight line are said
to be random in nature. Through the random scatter in our lawnmower
example we can discern a downward linear trend. The regression
equation
\[\boxed{\Yp=\syint+\sslope\X}\]
provides us with a model for the underlying straight-line trend
through the random scatter.  We have seen how we could by eye estimate
a linear relationship for our data.  Statisticians draw this straight
line using what is called \textbf{the least squares criteria}.  The
least squares line is that straight line through the data that
minimizes the sum of the squared deviations from the observed points
to the line.\footnote{This is a mathematical criteria whose solution
  can be found using mathematics beyond the scope of this course.  For
  our purposes it is enough to know that a unique solution to the
  problem always exists and is given by the formulae provided.} This
criteria will be met if we use the statistics \syint\ and \sslope\ to
estimate \pyint\ and \pslope, where \syint\ and \sslope\ are
calculated as follows:
\[\boxed{\syint=\frac{\left(\sum\X^2\right)\cdot\left(\sum\Y\right)-\left(\sum\X\right)\cdot\left(\sum\X\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}}\]
\[\boxed{\sslope=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}}\]
Here \ns\ is the number of pairs in our sample.  These two
calculations may be done tabularly.
\example{For the lawnmower
  example find the linear regression line.  Plot the line on the
  scatter diagram.  Use the regression line to find the predicted
  number of breakdowns for \X=\$400.}{Noting the required summations
  of our intercept and slope formulae, the following table will
  provide us with the information to do the two calculations.
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
 \X(\$) & \Y(\mbox{breakdowns}) & $\X\Y(\$\cdot\mbox{breakdowns})$ & $\X^2\ (\$^2)$\\\hline
 600 & 1 & 600 & 360000\\
 300 & 2 & 600 & ~90000\\
 200 & 2 & 400 & ~40000\\
 500 & 1 & 500 & ~25000\\
 100 & 4 & 400 & ~10000\\
 700 & 0 & ~~0 & 490000\\
 100 & 3 & 300 & ~10000\\
 400 & 2 & 800 & 160000\\
 100 & 1 & 100 & ~10000\\
 200 & 4 & 800 & ~40000\\\hline
 $\sum\X = 3200$ & $\sum\Y = 20$ & $\sum\X\Y=4500$ & $\sum\X^2 = 1460000 $\\\hline
\end{tabular}
\end{center}
Substitute the totals into the two statistics formulae to find estimates
of the regression line parameters.
\[\syint=\frac{\left(\sum\X^2\right)\cdot\left(\sum\Y\right)-\left(\sum\X\right)\cdot\left(\sum\X\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}=\frac{(1460000)\cdot(20)-(3200)\cdot(4500)}{10\cdot(1460000)-(3200)^2}=3.3945\ \mbox{breakdowns}\]
\[\sslope=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}=\frac{10\cdot(4500)-(3200)\cdot(20)}{10\cdot(1460000)-(3200)^2}=-0.0044\ \mbox{breakdowns}/\$\]
The least squares line is then:
\[\Yp=3.3945-0.0044\X\]
To show the underlying linear trend, one can plot this equation on the scatter
diagram by identifying the \Y-intercept and calculating a second \Y\ value
near the end of the range of \X\ values:

By examining the equation, the Y-intercept$=\syint=3.3945$ breakdowns.

An \X\ value at the far end of the range is $\X=\$600$, where
\[\Yp=3.3945-0.0044(600)=0.75\ \mbox{breakdowns}\]
Connecting these points on our diagram gives the regression line.
\begin{center}
\includegraphics[width=4in]{image3-54.png}
\end{center}
Notice that the points are scattered approximately evenly on either side
of this line. If the predictability had been perfect the points would
all lie exactly on the line.

We can predict the number of breakdowns at \$400 using our regression
line to get:
\[\Yp=3.3945-0.0044(400)=1.63\ \mbox{breakdowns}\ .\] 
Note that this value, as well as \syint\ and \sslope\ should all
compare favourably to your rough estimates done by eye. }

A property of the regression line is that it predicts the mean \Y\
value perfectly on the basis of the mean \X\ value.  To see this, note
that for the above example:
\[\smean=\frac{\sum\X}{\ns}=\frac{3200}{10}=\$320\ ,\ \mbox{and}\]
\[\smeany=\frac{\sum\Y}{\ns}=\frac{20}{10}=2\ \mbox{breakdowns}\ ,\]
while placing $\smean=\$320$ in the regression line formula gives:
\[\Yp=3.3945-0.0044(320)=1.99\ \mbox{breakdowns}\ .\]
\reading{Read pp 396--406 text, Exercises in the textbook page 406 to 409}

\subsection{Correlation Analysis} 
A situation in which there is perfect predictability is said to be a
\textbf{deterministic model}. In a deterministic model all ordered
pairs fall exactly along a straight line.  For example, suppose our
data for the lawnmowers had looked as follows:
\begin{center}
\includegraphics[width=4in]{image3-51.png}
\end{center}
In this case after finding the regression line parameters, predictions about
frequency of repair could be made perfectly with the regression line equation.

In this case we would say that all of the variability observed in number
of breakdowns is explainable by the variability in price paid. Nothing
is left to chance. In practice it would be very rare to see a perfect
situation like this as was shown in our actual data. 

\textbf{Correlation analysis} measures the strength of the
relationship between variables. It is useful for assessing how much of
the variation in the \Y\ values is explainable by variation in the \X\
values. If a scatter diagram is analyzed it is possible to analyze
strong and weak correlation by the location of the plotted points.
\begin{center}
\includegraphics[width=2in]{image3-55.png}
\includegraphics[width=2in]{image3-56.png}
\raisebox{-.1in}{\includegraphics[width=2in]{image3-57.png}}
\end{center}
The \textbf{Pearson Product Moment Correlation Coefficient} gives a
quantifiable measure of the degree to which the points fit a straight
line and the direction of movement of the variables. It is designated
by the symbol $\bm\corrcoeff$.  The correlation coefficient,
\corrcoeff, is found in this range of values:
\begin{center}
\includegraphics[width=4in]{image3-58.png}
\end{center}
The \textbf{sign} of \corrcoeff\ indicates whether the data are
positively or negatively correlated, while the \textbf{magnitude} of
\corrcoeff\ indicates the extent of the correlation.  If \corrcoeff\
is either +1 or -1, predictability is perfect and all ordered pairs
will lie exactly on a straight line of either positive or negative
slope respectively. If \corrcoeff\ is close to 0 there is no
discernible association between the variables and the points will lie
very far from a straight line.  In general we will interpret the
magnitude of $|\corrcoeff|$ as follows:
\begin{itemize}
\item 0.00 to 0.40: insignificant (negligible) correlation
\item 0.40 to 0.70: substantial correlation
\item 0.70 to 0.80: high correlation
\item 0.80 to 0.90: very high correlation
\item 0.90 to 1.00: extremely high correlation
\end{itemize}
These guidelines are somewhat subjective and will vary depending on
the field of study.  In practice a value of $|\corrcoeff|$ that is very
high (0.80 to 0.90) is useful for predicting the behaviour of a group
of items or individuals, but a larger value is required to predict the
behaviour of a single individual.

Look at the three data sets above and
qualitatively estimate \corrcoeff\ on the given number line.

The calculation of \corrcoeff\ involves finding the square root of the
complement of the percentage of the total variability among \Y\ values
that is made up of the variability from the least squares
line. Without getting into the mathematics of this, the calculation
is:
\[\boxed{\corrcoeff=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\sqrt{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}\cdot\sqrt{\ns\cdot\left(\sum\Y^2\right)-\left(\sum\Y\right)^2}}}\]
\example{Using the data for the lawnmower example calculate the
  correlation coefficient and interpret the result.}{%
Looking at the formula, there is one additional column required from our
regression calculation, the $\Y^2$ column: 
\begin{center}
\begin{tabular}{|c|c|c|c|c|}\hline
 \X(\$) & \Y(\mbox{breakdowns}) & $\X\Y(\$\cdot\mbox{breakdowns})$ & $\X^2\ (\$^2)$ & $\Y^2\ (\mbox{breakdowns}^2)$\\ \hline
 600 & 1 & 600 & 360000 & ~1\\
 300 & 2 & 600 & ~90000 & ~4\\
 200 & 2 & 400 & ~40000 & ~4\\
 500 & 1 & 500 & ~25000 & ~1\\
 100 & 4 & 400 & ~10000 & 16\\
 700 & 0 & ~~0 & 490000 & ~0\\
 100 & 3 & 300 & ~10000 & ~9\\
 400 & 2 & 800 & 160000 & ~4\\
 100 & 1 & 100 & ~10000 & ~1\\
 200 & 4 & 800 & ~40000 & 16\\\hline
 $\sum\X = 3200$ & $\sum\Y = 20$ & $\sum\X\Y=4500$ & $\sum\X^2 = 1460000$ & $\sum\Y^2=56$ \\\hline
\end{tabular}
\end{center}
Substitute:
\[\corrcoeff=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\sqrt{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}\cdot\sqrt{\ns\cdot\left(\sum\Y^2\right)-\left(\sum\Y\right)^2}}=\frac{10\cdot(4500)-(3200)\cdot(20)}{\sqrt{10\cdot(1460000)-(3200)^2}\cdot\sqrt{10\cdot(56)-20^2}}=-0.72\]
Interpretation:
\begin{itemize}
\item The negative sign indicates a negative correlation; as the
  price of a lawnmower increases the number of breakdowns tends to
  decrease.
\item The magnitude 0.72 means that the correlation is high.
\end{itemize}
\textbf{This should not be interpreted as cause and effect.} A low
price does not cause a high frequency of repair. The two variables
simple move together.}

The \textbf{Coefficient of Determination}, calculated as
$\corrcoeff^2$, measures the proportion of variation in \Y\ that is
explainable by variation in \X.

The \textbf{Coefficient of Nondetermination}, calculated as
$(1-\corrcoeff^2)$, measures the proportion of variation in \Y that is
explainable by factors other than the variation in \X.
\example{Find and interpret the coefficient of determination and non-determination for the lawnmower example.}{%
Since $\corrcoeff=-0.72$ the coefficient of determination is:
\[\corrcoeff^2 =(-0.72)^2 = 0.52\ .\]
This mean that 52\% of the variation in number of breakdowns is
explainable by the variation in the price paid for a lawnmower.
The coefficient of nondetermination is:
\[(1-\corrcoeff^2)=1-0.52=0.48\ .\]
This means that 48\% of the variation in the number of breakdowns is
explainable by factors other than the variation in the price paid for
a lawnmower.
}

\subsection*{Calculator Keys and Software}

The statistical calculator used in this course is capable of
processing data as ordered pairs in the statistical mode. Identify
this process.  Typically it requires going into the statistical mode
for linear regression and entering ordered pairs separated by a comma.

Once the data is keyed in, the three statistics \syint, \sslope, and
\corrcoeff\ can be retrieved from the storage registers with the
appropriate label. The coefficient of determination can be found by
squaring the \corrcoeff\ value once it is in the display.  Also note
that the intermediate sums required in the formula can also be
retrieved by appropriate keystrokes.

On the computer, spreadsheet programs can plot scatter diagrams,
produce the least squares equation and also calculate the correlation
coefficient.  For more sophisticated statistical work there are
statistical programs available, many of them free.  Google
``statistics open source''.
\reading{Read pp 431 -- 439 text, Exercises in the textbook page 440 to
443}
\reading{Chapters 16 \& 17, Review exercises textbook pp 486 - 492}
\clearpage
\newcommand{\linearregressionanswers}{\begin{enumerate}
  \item \begin{enumerate}
    \item $\syint=40.08\ \%$, $\sslope=1.497\ \%/\mbox{hr}$, $\Yp=a+b\X=40.1+1.5\X$
    \item $\Yp=85\%$
    \item $\corrcoeff=0.8621$, very high positive correlation;
      $\corrcoeff^2=.7432=74.32\%$ of the variation in the exam grade is due
      to the hours of study; $(1-\corrcoeff^2)=.2568=25.68\%$ of the
      variation in the exam grade is due to other factors than study
      (such as ability, interest, experience, etc.)
    \end{enumerate}
  \item \begin{enumerate}
    \item $\Yp=-419.8+6.7\X$ (MW)
    \item $\Yp=151.1$ MW
    \item $\corrcoeff=.9441$; magnitude $|r|=.9441$ implies extremely
      high correlation; sign of r positive implies positive
      correlation (As temperature (\X) increases, peak load (\Y)
      increases.
    \item $\corrcoeff^2=89.13\%$; 89.13\% of the variation in peak
      load (\Y) is related to the variation in temperature (\X).
  \end{enumerate}
  \item \begin{enumerate}
    \item $\corrcoeff=-0.9722$, an extremely high negative correlation.
    \item $\Yp=15.58-0.8966\X$;\newline For $\X=\ln(60.2)=4.10$, $\Yp=11.9$\ .
    \end{enumerate}
Note: Cepheid variable stars are of critical importance to astronomers
precisely because one can measure their period to determine their
intrinsic brightness (absolute magnitude).  Then measuring their apparent
brightness allows an exact measurement of their distance from us.
They are one of the \emph{standard candles} for measuring distances
far beyond our galaxy.
  \end{enumerate}}
\assignment{\answer{\protect\linearregressionanswers}\begin{enumerate}
  \item The table below presents data for a random sample of eight
    students showing the amount of outside class study time spent and
    the grade earned at the end of a one month statistics course.
\begin{center}
\begin{tabular}{|c|c|c|c|c|}\hline
Study Time (hr) & Grade (\%) & \hspace{.9in} & \hspace{.9in} & \hspace{.9in} \\ \hline
20 & 64 & & & \\
16 & 61 & & & \\
34 & 84 & & & \\
23 & 70 & & & \\
27 & 88 & & & \\
32 & 92 & & & \\
18 & 72 & & & \\
22 & 77 & & & \\ \hline
\rule{0em}{2em} & & & & \\ \hline
\end{tabular}
\end{center}
Answer the following questions by completing the table and check your
work on your calculator.
\begin{enumerate}
\item Determine the regression equation for estimating the examination
  grade given the hours of study.  Carry your calculations to one
  place beyond the decimal place.
\item Use the regression equation to estimate the examination grade
  for a student who devotes 30 hours to study.
\item Compute and interpret the values of the coefficients of
  correlation, determination, and nondetermination.
\end{enumerate}
\item The following gives the peak power load in megawatts for a power
  plant and the daily high temperature for a random sample of 10 days:
\begin{center}
\begin{tabular}{|l|rrrrrrrrrr|}\hline
Day & 1~ & 2~ & 3~ & 4~ & 5~ & 6~ & 7~ & 8~ & 9~ & 10 \\ \hline
Daily High Temp (${}^\circ$F)  & 95 & 82 & 90 & 81 & 99 & 100 & 93 & 95 & 93 & 87 \\
Peak Load (MW) & 214 & 152 & 156 & 129 & 254 & 266 & 210 & 204 & 213 & 150 \\ \hline
\end{tabular}
\end{center}
Do the following in a tabular format.
\begin{enumerate}
\item Determine the best-fitting straight line (linear regression
  equation) to predict peak load, \Y, based on the daily high
  temperature, \X.
\item Using the prediction equation determined in (a), find the peak
  load for a daily high temperature of $85^\circ$F.
\item What is the coefficient of correlation? What two things does the
  coefficient of correlation tell us about the relationship between
  daily high temperature, \X, and the peak load, \Y?
\item Calculate the coefficient of determination and interpret your result.
\end{enumerate}
\clearpage
%The following data is taken from:
%1777 variables in the Magellanic Clouds
%Authors: Leavitt, Henrietta S.
%Publication: Annals of Harvard College Observatory, vol. 60, pp.87-108.3
%Publication Date: 00/1908
%Her later 1912 article, Periods of 25 Variable Stars in the Small
%Magellanic Cloud has more stars and shows the relationship.
%The photo is taken from the Wikipedia entry on the SMC
%The two-color image shows an overview of the full Small Magellanic
% Cloud (SMC) and was composed from two images from the Digitized Sky
% Survey 2. The field of view is slightly larger than 3.5 3.6
% degrees. N66 with the open star cluster NGC 346 is the largest of
% the star-forming regions seen below the center of the SMC.
% It is licensed under the Creative Commons Attribution 3.0 Unported license.
% According to the license one is free:
% * to share, to copy, distribute and transmit the work
% * to remix, to adapt the work
% Under the following conditions:
% * attribution: You must attribute the work in the manner specified
% by the author or licensor (but not in any way that suggests that
% they endorse you or your use of the work).
% Attribution: ESA/Hubble
% I converted the original colour photo as I did the Andromeda Galaxy photo.
\item \begin{minipage}[t]{5in}\vspace{-1em}\begin{window}[0,r,%
      \fbox{\includegraphics[width=1.2in]{smc_256_invert.png}},{\centering\textbf{The SMC\newline {\small(photo courtesy ESA/Hubble)}}}] Cepheid variable stars have
      the interesting property that their brightness changes in a
      periodic (regular) way over time.  Measuring the time between
      when a star is at its brightest gives its period. In~1908,
      Henrietta S. Leavitt published the following data concerning
      sixteen Cepheid variable stars in a nearby dwarf galaxy called
      the Small Magellanic Cloud (SMC). The following
      data gives the (natural logarithm of) the period in days, \X, of each
      variable star along with its apparent magnitude, \Y, when it is
      at its maximum brightness.
\end{window}
\end{minipage}

\begin{tabular}{|c|c||c|c|}\hline
\X & \Y & \X & \Y \\ \hline
2.34 & 13.6 & 1.51 & 14.3 \\
4.84 & 11.2 & 0.51 & 14.8 \\
3.46 & 12.2 & 0.57 & 14.8 \\
4.19 & 11.4 & 0.23 & 14.8 \\
2.60 & 13.4 & 0.63 & 15.1 \\
1.46 & 14.6 & 1.67 & 14.4 \\
2.13 & 13.9 & 1.67 & 14.3 \\
1.89 & 14.1 & 1.61 & 14.3 \\ \hline
\end{tabular}
\begin{minipage}[c]{3.5in}\raggedright
\begin{enumerate}
\item Using your calculator, determine the correlation coefficient for the data and interpret your result.
\item Using your calculator, determine the linear regression line and use it to determine the expected maximum apparent magnitude of a variable star in the SMC of period 60.2~days.  (Remember \X\ is the natural logarithm of this time.)
\end{enumerate}
\end{minipage}
\end{enumerate}
}
\clearpage
\customlistofanswer
\clearpage
% Print the t-table
\input{t_table.tex}
% Make the formula sheet.   Make it an empty page and start a new one so
% student can take it out.
% The rowrule commands provide extra height and are defined in lectures.sty
\cleardoublepage
\thispagestyle{empty}
\section*{Sampling Distribution Formulae}
\textbf{Standard Error Formulae for Single Means and Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{4}{>{\centering$\displaystyle\rowrule}m{.25\textwidth}<{$}}|}\hline
\rowrule\pserrmean=\frac{\pdev}{\sqrt{\ns}} & \sserrmean=\frac{\sdev}{\sqrt{\ns}} & \pserrprop=\sqrt{\frac{\pprop\cdot\left(1-\pprop\right)}{n}} & \sserrprop=\sqrt{\frac{\sprop\cdot\left(1-\sprop\right)}{\ns}}\tabularnewline
\multicolumn{2}{|r}{\mbox{\bf Finite Correction Factor}\ \ \ $\Huge\Rightarrow$} & \FCF=\sqrt{\frac{\np-\ns}{\np-1}} & \tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Sampling Error (Precision) Formulae for Single Means And Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{3}{>{\centering$\displaystyle\rowrule}m{.333\textwidth}<{$}}|}\hline
\serr=\Z\cdot\pserrmean & & \serr=\Z\cdot\pserrprop\tabularnewline
\serr=\Z\cdot\sserrmean & \serr=\T\cdot\sserrmean & \serr=\Z\cdot\sserrprop\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Confidence Intervals for Population Means and Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{2}{>{\centering$\displaystyle\rowrule}m{.5\textwidth}<{$}}|}\hline
P\left(\left[\smean-\serr\right]<\pmean<\left[\smean+\serr\right]\right)=P\% &
P\left(\left[\sprop-\serr\right]\right. < \pprop < \left.\left[\sprop+\serr\right]\right) = P\%\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Sample Sizes for Estimating Means And Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{2}{>{\centering$\displaystyle\rowrule}m{.5\textwidth}<{$}}|}\hline
\ns=\left[\frac{\Z\cdot\pdev}{\serr}\right]^2 & \ns=\pprop\cdot(1-\pprop)\cdot\left[\frac{\Z}{\serr}\right]^2\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Standard Scores for Single Means and Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{3}{>{\centering$\displaystyle\rowrule}m{.333\textwidth}<{$}}|}\hline
\Z=\frac{\smean-\pmean}{\pserrmean} & & \Z=\frac{\sprop-\pprop}{\pserrprop}\tabularnewline
\Z=\frac{\smean-\pmean}{\sserrmean} & \T=\frac{\smean-\pmean}{\sserrmean} & \Z=\frac{\sprop-\pprop}{\sserrprop}\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Other Formulae}\vspace{.2em}\newline
\begin{tabular}{|*{2}{>{\centering$\displaystyle\rowrule}m{.5\textwidth}<{$}}|}\hline
\com{\np}{\ns}\ \ \OR\ \ \np^\ns  & \df=\ns-1\tabularnewline\hline
\end{tabular}
\clearpage
\thispagestyle{empty}
\textbf{Standard Error Formulae for Differences of Means and Proportions}\vspace{.2em}\newline
\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{.4\textwidth}<{$}>{\centering$\displaystyle\rowrule}m{.6\textwidth}<{$}|}\hline
\sdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\svar_{\s1}}{\ns_{\s1}}+\frac{\svar_{\s2}}{\ns_{\s2}}} & \sdev_{\s\smean_1-\smean_2}=\sqrt{\frac{\left(\ns_{\s1}-1\right)\cdot\sdev_{\s1}^2+\left(\ns_{\s2}-1\right)\cdot\sdev_{\s2}^2}{\ns_{\s1}+\ns_{\s2}-2}\cdot\left[\frac{1}{\ns_{\s1}}+\frac{1}{\ns_{\s2}}\right]}\tabularnewline
\proppool=\frac{\X_{\s{1}}+\X_{\s{2}}}{\ns_{\s{1}}+\ns_{\s{2}}} & \sdev_{\s\sprop_1-\sprop_2}=\sqrt{\proppool\cdot\left(1-\proppool\right)\cdot\left[\frac{1}{\ns_{\s1}}+\frac{1}{\ns_{\s2}}\right]}\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Standard Scores For Differences Between Means And Proportions}\vspace{.2em}\newline
\begin{tabular}{|*{3}{>{\centering$\displaystyle\rowrule}m{.333\textwidth}<{$}}|}\hline
\Z=\frac{\left(\smean_{\s 1}-\smean_{\s 2}\right)-0}{s_{\s\smean_1-\smean_2}} & \T=\frac{\left(\smean_{\s 1}-\smean_{\s 2}\right)-0}{s_{\s\smean_1-\smean_2}} & \Z=\frac{\left(\sprop_{\s 1}-\sprop_{\s 2}\right)-0}{\sdev_{\s \sprop_1-\sprop_2}}\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Other Formulae}\vspace{.2em}\newline
\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{1\textwidth}<{$}|}\hline
\df=\ns_{\s1}+\ns_{\s2}-2\tabularnewline\hline
\end{tabular}\vspace{1.0em}
\textbf{Linear  Regression/Correlation Analysis}\vspace{.2em}\newline
\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{1\textwidth}<{$}|}\hline
\Yp=\syint+\sslope\X\tabularnewline
\syint=\frac{\left(\sum\X^2\right)\cdot\left(\sum\Y\right)-\left(\sum\X\right)\cdot\left(\sum\X\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}\vspace{.5em}\tabularnewline
\sslope=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}\vspace{.5em}\tabularnewline
\corrcoeff=\frac{\ns\cdot\left(\sum\X\Y\right)-\left(\sum\X\right)\cdot\left(\sum\Y\right)}
{\sqrt{\ns\cdot\left(\sum\X^2\right)-\left(\sum\X\right)^2}\cdot\sqrt{\ns\cdot\left(\sum\Y^2\right)-\left(\sum\Y\right)^2}}\vspace{.5em}\tabularnewline\hline
\end{tabular}
\clearpage
% Print the license
\gfdlsinglenewpage
\end{document}
%TODO:
%On Sampling error and confidence interval stuff:
%Add mu+Z\sigma_xbar to the diagram where we first show sampling error so
%it is clear why E is as it is.
%Make mean confidence interval diagrams have \mu+\Z\pserrmean on it.
%Add diagrams to solution set where they are asked for (currently I just
%skip the answer.
%Do we ever use FCF in hypothesis testing, i.e. in our examples/exams.
%Use Z-test, Z-score, t-test, etc consistently with or without hyphens.
%Add a problem modifying the cluster metallicity where she actually uses
%the region surrounding the cluster and compares the two population means.
%Fix blocks on formula sheet - uneven rectangles.
