%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}
%The following imports symbols needed for chess figures.  It requires
%installation of texlive-games package on ubuntu.
\usepackage[skaknew]{chessboard,skak}
%Define a name for your course here.  At the end, set the course counter to
%the one to compile.
% 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}
%Create a boolean for the light course
%Note the boolean switch "heavy" used in this unit refers to the
%full course notes when "true";  when "false" it refers to the lighter
%descriptive stats unit.
\newboolean{heavy}
%Define your course info here
\institution{SIAST Palliser Campus}
\department{Mathematics}
\switch[\value{coursecounter}=]
\case{\eddt}\course{MAT 201}\unitnumber{4}\setboolean{heavy}{false}
\case{\cew}\course{STAT 201}\unitnumber{1}\setboolean{heavy}{true}
\case{\geo}\course{STAT 220}\unitnumber{1}\setboolean{heavy}{true}
\endswitch
\unittitle{Descriptive Statistics}
\date{January 2011}
\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}
\ifthenelse{\boolean{heavy}}{
\section{Introduction to Statistics}
\label{sec:introtostat}
\subsection*{What is statistics?}
Depending upon one's background, the word statistics has
many usages within our language. 

\begin{enumerate}
\item Some people use the word statistics to mean \emph{numerical facts}
presented in  forms such as in tables or graphs.  Here are some examples of
some economic statistics which fit this usage:

% The following is a bit of a hack.  I put the threeparttable inside
% the table environment because the former wasn't putting the caption
% at the top of the table.
\begin{table}[h]
\caption{Mineral Production in Saskatchewan}
\label{tab:minerals} 
\begin{center}
\begin{threeparttable}
\begin{tabular}{lcc}\toprule
& \multicolumn{2}{c}{Production  ('000 Tonnes)}\\\cmidrule{2-3}
Mineral & 1996 & 1997\\\midrule
Coal & 10854 & 11648\\
Salt & 813 & 875\\
Sodium Sulphate & 326 & 292\\
Potash & 6969 & 8346\\
Uranium\tnote{1} & 13.35 & 14.173\\
Gold\tnote{1} & 3.432 & 4.366\\\bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] Based on reported sales.
\item \small{Source: ``Mineral
Production'', Monthly Statistical Review, 
Volume 24, no. 3, Government of Saskatchewan,  Bureau of Statistics, p
12.}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{center}
\includegraphics[width=4in]{sales_performance.png}
\end{center}
\clearpage
\item To some people the word statistics means a \emph{calculation on
    a collection of numerical values}.
%http://en.wikipedia.org/wiki/Crime_in_Canada.
%Note that these include all types of crime
  General crime rates per 100,000 people for each
  province and territory for 2006 are given in the following
  table. (Source: Statistics Canada)
\begin{center}
\begin{tabular}{|c|r||c|r|}\hline
Locale & Rate & Locale & Rate \\ \hline
Canada & 8,269 & Man. & 12,325\\
N.L. & 6,571 & Sask. & 15,276\\
P.E.I. & 7,486 & Alta. & 10,336\\
N.S. & 8,698 & B.C. & 12,564\\
N.B. & 6,781 & Y.T. & 22,197\\
Que. & 6,626 & N.W.T. & 44,074\\
Ont. & 6,251 & Nvt. & 32,831\\ \hline
\end{tabular}
\end{center}
Why is it appropriate to report the rate per 100,000 people?

\item To some people statistics means a \emph{methodology for
    arranging data in a format useful for decision making}.
  The following statistics on the growth of income disparity in Canada
  might be useful for informing government social or taxation
  policy. (Source: Statistics Canada)

% From statistics canada.  Found at 
%http://www.conferenceboard.ca/hcp/details/society/income-inequality.aspx#evidence
\begin{tabular}{|l|cccc|cc|}\hline
 & \multicolumn{4}{c|}{Median Earnings}& \multicolumn{2}{c|}{Percentage} \\
 & \multicolumn{4}{c|}{(2005\ \$; full-time, full-year earners)}& \multicolumn{2}{c|}{change}\\
 Population Segment & ~~~1980~~~ & ~~~1990~~~ & ~~~2000~~~ & ~~~2005~~~ & 1980 to 2005 & 2000 to 2005 \\ \hline
Bottom 20 percent & 19,367 & 16,345 & 15,861 & 15,375 & -20.6 & -3.1 \\
Middle 20 percent & 41,348 & 40,778 & 40,433 & 41,101 & ~~0.1 & ~2.4 \\
Top 20 percent    & 74,084 & 76,616 & 81,224 & 86,253 & ~16.4 & ~6.2 \\ \hline
\end{tabular}

\item Statistical procedures can be very analytical and use \emph{theoretical
information from probability functions to make decisions where
randomness plays a part in observed outcomes}.  The following
description of a statistical study illustrates this.

\boxedtext{A large hotel derives income from its room rental service
  and its dining lounge. Management is interested in determining the
  contribution to sales at the dining lounge that are associated with
  room rentals. Data are selected from a random sample of 100 days of
  business at the hotel.  A statistical plot of sales at the dining
  lounge against rooms occupied is made. It is determined that the
  plot closely follows a linear trend given by the equation $Y = 38X +
  650$. This is loosely interpreted as follows:

  Based on these observations, on average for each room rented, \$38
  of new revenue per day are produced in the dining lounge and \$650
  in revenue per day come from clients who do not rent rooms. The \$38
  marginal contribution to daily revenue from room rentals is precise
  to ${\pm}$ \$3 in 95 cases out of 100.}

Similar examples of statistics can be found in trade journals,
professional magazines, daily newspapers, periodicals, business
reports, statistical journals, etc. Look for statistical examples in
your daily reading material. It will make the examples and
calculations done in the lectures more relevant to you.

No matter what the usage, the sole need for statistics in data
presentation is to handle fluctuations or variation in some quantity
which is being analyzed for the purpose of decision making. Statistical
analysis has no application in situations where quantities under
consideration never vary.
\end{enumerate}

\subsection*{Where is statistics used in technology and business?}

In a technology/business setting, situations which give rise to
analysis of quantities which vary, and as a result involve statistical
methods, are activities such as:
\begin{itemize}
\item quality control

\item forecasting for the purpose of planning

\item statistical reports of business activities

\item estimating

\item testing

\item validation of assumptions in planning business

\item any procedure which relies on sampling

\item simulation
\end{itemize}

In particular some of the sectors of technology and business who rely on
statistical procedures are:

\begin{enumerate}
\item Risk taking organizations like the insurance business who analyze
risks and found their business on the basis of these risks.  Persons
called actuaries analyze and provide strategies to manage  the risks
involved in the insurance business.  Some other businesses which are
founded on risk taking are gambling, investment management, and health
plan carriers.

\item Retail businesses rely on statistics to conduct marketing
analysis.  Market areas can be analyzed to target potential sales,
assess marketing strategies, evaluate customer preferences, etc.

\item Accountants use statistical methods to evaluate the accuracy of
journal entries using sampling techniques.

\item Human resource workers use statistics in various ways. Personnel
administrators use statistical procedures to interpret achievement and
aptitude tests.  Labour negotiators use published statistical
information to discuss labour variables such as hours of work, pay
rates, salary benefits.

\item Large organizations use statistics to determine efficient means of
traffic control of inventory between branch locations.

\item Statistical methods are employed by companies to display the
activities of the  firm to the shareholders through annual reports.

\item In the manufacturing industry where engineers and technologists
are concerned with quality control of the production, experimentation
and testing of their products.

\item Scientists and engineers apply statistical analysis to study vast
amounts of data from their numerous experiments and tests they must
conduct.
\end{enumerate}

\subsection*{As a technology/business student, how will statistics be useful?}

\begin{enumerate}
\item It will be useful in order to understand many of the strategies
used in marketing, designing  and manufacturing.

\item It will be useful in order to understand the technology/ business
techniques based on sampling which are used by people like engineers
and accountants to make decisions.

\item The statistical data presentation techniques are useful in
report writing.

\item To be technically literate in a complex technical world, a person
should understand the meaning of the statistical measures on which
decisions are based.
\end{enumerate}

\reading{Read pages 1 through 6 in the textbook.}
}{}

\section[Statistical Definitions]{Some Introductory Statistical Definitions}

Most professionals develop a collection of specialized terms and
definitions which are necessary in order to discuss the concepts that
are peculiar to their field of study.  This is also the case in
statistics. Before statistical concepts can be applied to problem
solving it is necessary to have an operational knowledge about their
meaning. Here are some terms and definitions with which a person using
statistical analysis must be able to apply correctly. The emphasis in
this course will be on the application rather than the memorization of
these terms.

\begin{description}
\item[Statistics] \ifthenelse{\boolean{heavy}}{(Recall from Section~\ref{sec:introtostat} the term has many uses.)}{~}
\begin{enumerate}
\item A collection of numbers or a number. (e.g. an accident statistic)
\item A calculated value from a collection. (e.g. an average grade)
\item The science of data analysis for the purpose of decision making. 
(e.g. statistical analysis of an opinion survey.)
\end{enumerate}
\reading{Read pages 1, 7-10 in the text.}
\boxedtext{Statistics, as an area of study, is a body of knowledge
  concerned with collection, summarizing, analyzing and interpreting
  of data for the purpose of making accurate decisions in the face of
  uncertainty.}


\item[Population] (It doesn't necessarily mean people.)

A collection of all possible individuals, objects, or measurements of
interest.
\example{\begin{itemize}
\item The population of claims receipts at an insurance claims
centre.
\item The population of items produced on an assembly line
process.
\item The population of drivers over 65 in Saskatchewan.
\end{itemize}}

We will use many diagrams for illustration purposes in this course for
the purpose of helping us to visualize abstract concepts. The diagram
used to illustrate a population in statistics is a rectangle.

\begin{center}
\framebox{\rule{12em}{0em}\rule{0em}{6em}}
\end{center}

Note that statisticians do not use the word population to mean the
size of a population, as in ``What is the population of Regina?''

\item[Sample] (The everyday definition meaning \emph{to take a portion~of} is similar to the statistical one.)

A selection of some of the objects from the population.  There are many
different ways of making the selection of which one is random
selection.

\example{\begin{itemize}
\item To ensure quality, a child takes a sample of five cookies from
  a recently baked batch of thirty chocolate chip cookies.
\end{itemize}

For illustrative purposes, a sample is designated by a circle drawn
within the population rectangle.
\begin{center}
\begin{picture}(250,100)
\put(0,0){\framebox(250,100){
\begin{tabular}{cc}
~~~\begin{minipage}{22ex}
\raggedright Cookies evaluated.
\begin{center}
$\ns=5$
\end{center}
\end{minipage}~~&~~
\begin{minipage}{22ex}
\raggedright All the baked cookies.
\begin{center}
$\np=30$
\end{center}
\end{minipage}~~~
\end{tabular}
}}
\put(60,50){\circle{95}}
\end{picture}
\end{center}}
We will use \ns\ to refer to the size of a sample and \np\ to refer to
the size of a population.  

\item[Statistical Variable] (The quantity designated by the symbol \X)

  The quantity under study whose value fluctuates with chance.
  Because it fluctuates with chance it is often called a
  \textbf{random variable}.  It is because this fluctuation exists
  that statistical analysis is useful.
\example{\begin{itemize}
\item In the above example the child could test quality by observing
  the number of chocolate chips found in each cookie (\X=\# of
  chocolate chips).
\item The value of a used car on a sales lot in Moose Jaw is a
statistical variable because upon inspection it would be observed that
the price varies from car to car on a sales lot.
\end{itemize}
\begin{center}
\fbox{
\rule[-4em]{0em}{8em}\begin{tabular}{c}
\X = price of a car\\ \\
N = \# of used cars on lots in Moose Jaw
\end{tabular}
}
\end{center}}

\item[Data] (It most often means a collection of numbers.)

Whereas numbers are often referred to as statistics, a statistician
would call these numbers data. To a statistician, a data set is  the
collection of observed values of the statistical variable.
\example{
\begin{itemize}
\item An inspection (sample) of 8 cars picked randomly revealed the
following observations:~(\$)

\begin{center}
\begin{tabular}{rrrrrrrr}
7800 & 4500 & 5600 & 560 & 780 & 2300 & 999 & 1200
\end{tabular}
\end{center}

Note: Usually the data is given as a listing as above, called an
\textbf{array}, or it is rank ordered into a \textbf{ranked array}: (\$)
\begin{center}
\begin{tabular}{rrrrrrrr}
560 & 780 & 999 & 1200 & 2300 & 4500 & 5600 & 7800
\end{tabular}
\end{center}
The variable symbol \X\ designates the price of a car. Individual
observations within the array are identified by means of a subscripted
variable.  $\X_5$ means the fifth observation in the array, \$2300.
The individual observations in the above array can be referred to by
symbol as $\X_1$, $\X_2$, $\X_3$, $\ldots$, $\X_8$.  This is helpful for
calculations with statistical formulae.
\end{itemize}}
Returning to our definition of population given above one could
consider the population in this example to be all the objects of
interest, in this case the set of all used cars on sales lots in Moose
Jaw.  Alternatively if one considers the population to be all the
measurements, then this would refer to the set of all of their actual
prices, that is the data.  A similar ambiguity exists in the use of
the word sample, either as the eight used cars or their eight prices.
To clearly specify the objects upon which the measurements are taken
(the former definitions) they may be called the \textbf{experimental
  units} by an experimenter while a statistician doing a survey would
call them the \textbf{elements of the sample}.  To refer clearly to
the measurements themselves one may say \textbf{population data} or
\textbf{sample data}.  When the words population and sample are used
on their own the statistical meaning intended is often apparent from
the context.

\item[Qualitative Data](Usually non-numerical labels or categories called
attributes)

Data are referred to as being qualitative when the observations made are
arrived at by classifying according to category or description.
\example{
\begin{itemize}
\item The religious denomination of community members is to be
  recorded and analyzed.
\item The ranks of military personnel at an armed forces base are
  recorded.
\end{itemize}}

\item[Quantitative Data](Numerical observations)

Data are called quantitative when the observations are arrived at by
either measuring or counting.
\example{\begin{itemize}
\item The volume of fuel purchased by customers at a self serve gas bar
was to be analyzed.  The volume was measured and displayed by a device
on the the gas pump.
\item The number of phone calls received per month per household for
charity solicitation in a certain neighbourhood was analyzed. A random
sample of households were asked to record a log of their charity phone
calls.
\end{itemize}}

\item[Discrete Data](Counts)

  Data is called discrete when it results from a counting process.  In
  this case the variable's value is known exactly.  Assuming the
  counting is done accurately, a count should have no error attached
  to it.
\example{
\begin{itemize}
\item The number of children per household.
\item The number of magazine subscribed to by a household.
\item The number of birds visiting a bird feeder in an hour.
\end{itemize}}

\item[Continuous Data](Measurements)

  Data is called continuous when it results from a measuring process.
  Because of the limitations of the measuring process, the value of an
  observation can only be determined to the precision of the device
  used to record the measurement. All measurements contain some error.
\example{\begin{itemize}
\item A store keeps a shelf of a freezer stocked with bricks of butter. 
The bricks have a labeled weight of 454 g.  The weights of the bricks
are to be analyzed. Government regulatory agencies allow for some
deviation from the stated weight as long as it is not significantly
different.
\item A vehicle used for deliveries is refueled at the end of each day.
The volume of gas filled is entered into a log book.
\end{itemize}}

The terms associated with statistical data can be remembered
easily with the following diagram:

\[
\mbox{Statistical Data}\left\{
\begin{array}{l}
\mbox{Qualitative Data (categories)} \\
\mbox{Quantitative Data (numbers)}\left\{
\begin{array}{l}
\mbox{Discrete (counts)} \\
\mbox{Continuous (measurements)}
\end{array}\right.
\end{array}
\right.
\]

\item[Levels of Measurement] (The precision of the data)
  A large part of statistical analysis involves recording the value of
  the statistical variable.  If the data is not recorded with enough
  precision, certain types of calculations cannot be done on the
  observations. Precision refers to the degree of refinement of the
  observation. To measure the mass of an atom we require a more
  precise method of measuring than is required to rate customer
  satisfaction with a product. Four levels of measurement are
  identified in statistical calculations.

\begin{description}
\item[Nominal level] is the most crude form of data for analysis.  In
  this form, data can only be categorized such as by colour, religious
  denomination, political affiliation, and etc. Outside of counting
  the number of observations in each category, there are very few
  arithmetic calculations that can be done on this data.

\item[Ordinal level] is a level above nominal level with the added
  feature that the data can be rank ordered as well as counted. An
  example is rating form information with the options of good,
  average, poor.  Note: The observations cannot be placed on a number
  line or added.

\item[Interval level] is a level above ordinal level in that the data
  can be quantified to the extent that it can be placed on a number
  scale.  The number scale has the limitation of not having a
  meaningful zero point for comparison purposes.  A meaningful zero
  indicates the absence of a quantity. The Celsius or Fahrenheit
  temperature scale is a an example of this.  Zero degrees on these
  temperature scales does not represent an absence of temperature. A
  rating scale for things like consumer preference is another
  example. Note: Data values cannot be compared as ratios when there
  is no meaningful zero.

\item[Ratio level] is the most precise level of measurement.  Data in
  this form can be placed on a number line with a meaningful zero
  point.  The weight of the net contents of a packaged consumer
  product is an example. There is no limitation to the arithmetic that
  can be done with this data. All the legitimate operations of
  arithmetic can be done on data measured at this level.
\end{description}
\example{An eccentric census form requires you to provide the
  following information.  Classify the data produced by the following
  variables as qualitative/quantitative and for a quantitative variable
  decide on whether it is discrete or continuous. Identify the level
  of measurement (nominal/ordinal/interval/ratio) of each variable.
  Hint: It may help to think about how you would answer the question
  to imagine the type of data produced.
\begin{enumerate}
\newcommand{\classifyoptions}{\\*Circle:~qualitative/quantitative(discrete/continuous), nominal/ordinal/interval/ratio\ .}
\item Your nationality. \classifyoptions
\item Your social insurance number. \classifyoptions
\item The longitude of your community. \classifyoptions
\item The hottest temperature recorded in your community last summer in degrees Kelvin. \classifyoptions
\item Your yearly household income. \classifyoptions
\item The softness of your pillow (firm, medium, oh so soft). \classifyoptions
\end{enumerate}}


\item[Descriptive Statistics] (Describing a data collection)

A branch of statistics concerned with describing collections of data for
the purpose of placing some order among a collection of unorganized
observations. The data collections that are being described can be
either samples or populations.
\example{\begin{itemize}
\item Categorizing the collection in a table or constructing a
pictorial chart.
\item Calculating the average
or the amount of spread in the data values.
\end{itemize}}

\item[Inferential Statistics] (Drawing conclusions from a sample.)

A branch of statistics concerned with making general conclusions about a
population on the basis of a data sample.  Probability concepts are
involved.
\example{\begin{itemize}
\item A random sample of 1200 Canadian adults was polled regarding
their opinion about the quality of health care received by hospital
patients in Canada. On the basis of the sample results, it is projected
that 75\% of all Canadian adults believe that patients receive good
care while in hospital in Canada. The poll has an error of  ${\pm}$ 3\%
in 95 samples out of 100.
\end{itemize}}
\end{description}
*The breakdown of statistics into its types can be pictured more
easily by the following diagram.*

\[
\mbox{Types of Statistical Analysis}\left\{
\begin{array}{l}
\mbox{Descriptive}\left\{
\mbox{\begin{minipage}{15em}\raggedright Describes what was actually observed.\end{minipage}}
\right. \\ \\
\mbox{Inferential}\left\{
\mbox{\begin{minipage}{15em}\raggedright Infers to a population based on sample values. (i.e. Statements are made based on incomplete information.)\end{minipage}}
\right.
\end{array}
\right.
\]

\subsection*{Statistical Categorization Of Observations}

One of the methods of bringing order to a set of observations is by
constructing a table of categories into which the data fit. These
categories should be \textbf{mutually exclusive} and
\textbf{exhaustive}.

Categories are mutually exclusive when each observation can go into
one and only one category. This means the categories should not
overlap. A table of categories is exhaustive if all of the raw data
observations fit into the categories chosen.

\example{A table giving political preference that only listed the
three political parties Conservative, Liberal, and N.D.P. and the
Undecided category would be mutually exclusive since someone who
preferred one of the parties the most could also not simultaneously
prefer a different party as much nor be undecided.  However the table
would not be exhaustive because someone could be decided but not
prefer one of the three parties listed.  For instance a respondent who
supported the Green Party would not fit into any category on the
table.}

\ifthenelse{\boolean{heavy}}{\example{In table~\ref{tab:minerals} on
      page~\pageref{tab:minerals} are the mineral categories mutually
      exclusive? (Yes/No)\\* Is the list exhaustive for mineral
      production for Saskatchewan? (Yes/No)}}{}

\reading{Read the text pages 1 to 10.}

\assignment{For this unit the exercises will focus upon
  several case studies to be found in the unit supplement which we
  will analyze with increasing sophistication.  To begin with, read
  the case studies.  For each case study:
\begin{enumerate}
\item Identify the population (i.e. experimental unit) under
  consideration.
\item Identify whether the data encompasses the whole
  population (population data) or is for a sample of it (sample data).
\item Identify the statistical variable and label the column with the
  appropriate symbol.
\item Determine whether the variable is qualitative
  or quantitative.
\item For a quantitative variable identify if it is
  continuous or discrete.
\item Identify the level of measurement (precision) of each variable.
\end{enumerate}
}

\section[Organizing Data for Analysis]{Organizing Numerical Data for Analysis}

The objective of statistical data presentation is to bring order to
the array of observations of the statistical variable.  The most
common method of doing this is by table construction.

Here are some examples of the methods by which quantitative data are
presented. Data presented in these three ways will be the starting
point for our calculations of descriptive statistical measures.

\subsection{Raw Data}
This is data listed in an array in the order it was observed.  This
format is used when there are a very few observations to consider in
the presentation or when the data is to be keyed into a computer for
analysis.
\example{A courier takes 10 trips from office A to office B. 
The time taken was observed to be:  (min.) 
\begin{center}
15, 23, 30, 18, 26, 27, 19, 25, 31, 23
\end{center}

Note: Before this data is of much use to anyone, it must be rank
ordered or perhaps treated mathematically by computing an average.
The listing of the data values only show that there is variation in
the times taken.

If \X\ equals the time taken for a trip, here is a ranked array of the
($n=10$) observations of variable~\X.

\begin{center}
\begin{tabular}{|c|}\hline
Trip Time (min)\\\hline
15\\ 18\\ 19\\ 23\\ 23\\ 25\\ 26\\ 27\\ 30\\ 31\\\hline
\end{tabular}
\end{center}}

\reading{Textbook page 13}

\subsection{Ungrouped Frequency Distribution}
\label{subsec:ungrouped}
This method is used to present data when the raw data array contains
many observations but only a few distinct data values are observed.
\example{The manager of a store examines the number of items purchased
per customer passing through the express checkout lane.  Here is what
was observed:
\vspace{-1em}
\begin{center}
\begin{tabular}{ccccc}
~1~~& ~5~~& ~7~~& ~4~~& ~3~~\\
2& 2& 3& 2& 4\\
3& 2& 3& 1& 1\\
4& 3& 2& 3& 1\\
1& 2& 3& 7& 3
\end{tabular}
\end{center}}

This quantitative data may be presented by means of a table called a
\textbf{frequency distribution}.  The word \textbf{frequency}, in
statistics, means the number of times a data value is observed to
occur.  The idea is to replace all of the same values in a raw data
array with a single identification of the value and the number of
times it occurs in the raw data, \f, its frequency.
\example{The above information could be summarized in an ungrouped frequency
table that looks like this:
\begin{center}
\begin{tabular}{|c|c|}\hline
\# of items & \f\\\hline
1 & 5\\
2 & 6\\
3 & 8\\
4 & 3\\
5 & 1\\
7 & 2\\\hline  
  & $\sum \f = 25$\\\hline
\end{tabular}
\end{center}
Here the value 1 occurred 5 times, in the original data, etc.
}
Note:\vspace{-1em}
\begin{enumerate}
\item The statistical variable \X = \emph{\# of
  items} appears in the column %stub
heading.
\item There are 6 distinct data values but there are 25 observations
in total.
\item The sum of the frequency column always equals the number of
observations made.
\item The frequency column is always totaled to show
that the table is exhaustive.
\item The mathematical symbol for the sum of the frequency column
is $\sum \f$ where
\[\sum \f = \f_1 + \f_2 + \f_3 + \ldots + \f_m\,.\]
Here $m$ is the number of distinct values taken by the variable \X\ and
$\f_i$ is the frequency of the $i^{\mbox{\scriptsize th}}$ distinct value.
\item Only the distinct values observed are listed. For example, there
  is no data value 6 observed so none is listed.  If one were listed,
  it would have a frequency of 0.
\item The table puts the observations in rank order.
\item The \X\ column is never totaled because that is meaningless
  information for a frequency distribution.
\item In this example \X\ is a discrete variable.  Ungrouped frequency
distributions are often used to organize discrete data.
\end{enumerate}

\subsection{Grouped Frequency Distribution}

This method is used to summarize data when the raw data array of
observations is large and many of the data values listed are distinct.
\example{Suppose an insurance company examines its claims record over
the past 5 years.  It discovers upon observation of the records that
it has had many claims of various values.  The claims' values were
summarized as follows:
\vspace{-1.5em}
\begin{center}
\begin{tabular}{|r|c|}\hline
Value (\$)~~~~ & \f\\\hline
  0.00 - 1000.00 & 900 \\

 1000.00 - 2000.00 & 700 \\

 2000.00 - 3000.00 & 313 \\

 3000.00 - 4000.00 & 240 \\

 4000.00 - 5000.00 & 127 \\

 5000.00 - 6000.00 & ~20 \\ \hline
 & $\sum \f = 2300$\\\hline
\end{tabular}
\end{center}

Note: There are 2300 claim values summarized in this table.  There are
so many distinct data values observed that a listing of the raw data
array of observations would be difficult to interpret for analysis
purposes.

Unlike an ungrouped frequency distribution, the individual
observations are lost when the data is grouped.  The specific values
observed cannot be determined from the table.  This type of summary
is useful to establish trends among data values such as the range,
areas of concentration, averages, dispersion, and to draw graphs.

Each grouping is called a \textbf{class}.
In the first class there are 900 claims.  The values $\$0.00$ and
$\$1000.00$ are the \textbf{lower class limit} and \textbf{upper class
  limit} respectively of the first class.  When class limits overlap
only the lower class limit belongs to the class.  A value of
$\$1000.00$ would belong to the second class.

The \textbf{class width} \cwidth\ is the difference between the upper
and lower class limits.  Here
\[\cwidth=\$1000.00-\$0.00=\$1000.00\]
for the first class.  All other classes in this example may be
verified to have the same class width which is typical and preferable.

As in the previous example, \X\ here is also technically a discrete
variable since a claim cannot be in fractions of a penny.  Still the
diversity in the claims requires a grouped frequency distribution for
its organization.  Continuous random variables also typically appear
in grouped frequency distributions because most of their data values
will be unique. (e.g. 1.31 cm, 1.35 cm, 2.29 cm, etc. for a
measurement.)}

\assignment{For each case study:
\begin{enumerate}
\item Identify the type of data
  presentation (raw data, ungrouped frequency distribution or grouped
  frequency distribution).
\item For frequency distributions, identify the
  frequency column with the appropriate symbol.
\item Find the number of
  data elements in each case by direct counting (raw data) or by
  summing the frequency column (frequency distributions).  Use
  appropriate symbols.
\end{enumerate}}

\ifthenelse{\boolean{heavy}}{
\section[Frequency Distribution Construction]{Frequency Distribution Table Construction}
Recall frequency distribution tables are appropriate when there is a
large number of data elements.  When data are summarized by means of a
frequency table, the data should be analyzed to determine whether a
grouped or an ungrouped distribution summary table is the appropriate
format.

\subsection{Ungrouped Frequency Table Construction}
An ungrouped frequency table is suitable when the number of values
taken on by the data is small.  Once it is decided that this format
suits the data best for summary purposes, ungrouped tables are
straightforward to construct. For instance in the example from
Section~\ref{subsec:ungrouped} one would go through the data and
construct the following tally.
\begin{center}
\begin{tabular}{ccccc}
~1~~& ~5~~& ~7~~& ~4~~& ~3~~\\
2& 2& 3& 2& 4\\
3& 2& 3& 1& 1\\
4& 3& 2& 3& 1\\
1& 2& 3& 7& 3
\end{tabular}~~~~~~~~~
\begin{tabular}{|c|l|c|}\hline
\# of items & Tally & \f\\\hline
1 & \StrokeFive & 5 \\
2 & \StrokeFive~~\StrokeOne & 6\\
3 & \StrokeFive~~\StrokeThree & 8\\
4 & \StrokeThree & 3\\
5 & \StrokeOne & 1\\
7 & \StrokeTwo & 2\\\hline  
  & & $\sum \f = 25$\\\hline
\end{tabular}
\end{center}

\subsection{Grouped Frequency Table Construction}

Grouped frequency distributions are useful when the data value assumes
a large number of distinct values.  The construction of these tables
is more complicated because one has choices to make regarding the
number of classes, their width and where they should start. One
desires that the trends in the data be preserved after the data are
grouped.  The following example outlines a commonly used systematic
procedure for creating a grouped frequency distribution from a data
array.

\example{Weights of the contents of boxes of cereal were:  (in g)

~~~~~~~~~~~~~\begin{minipage}{6in}
228.3\ \ \ \ 223.4\ \ \ \ 223.7\ \ \ \ 225.6\ \ \ \ 223.6\ \ \ \ 221.9\ \ \ \ 229.4\ \ \ \ 221.4\ \ \ \ 221.8\ \ \ \fbox{240.8}

224.9\ \ \ \ 224.7\ \ \ \ 224.1\ \ \ \ 227.8\ \ \ \ 222.4\ \ \ \ 225.9\ \ \ \ 220.9\ \ \ \ 221.8\ \ \ \ 222.5\ \ \ \fbox{219.9}

221.4\ \ \ \ 224.6\ \ \ \ 223.9\ \ \ \ 223.1\ \ \ \ 227.3\ \ \ \ 220.9\ \ \ \ 224.1\ \ \ \ 224.1\ \ \ \ 223.4\ \ \ \ 226.4

224.8\ \ \ \ 224.6\ \ \ \ 223.3\ \ \ \ 220.4\ \ \ \ 229.5\ \ \ \ 224.8\ \ \ \ 227.7\ \ \ \ 230.3\ \ \ \ 222.8\ \ \ \ 220.4

230.8\ \ \ \ 229.1\ \ \ \ 221.8\ \ \ \ 223.2\ \ \ \ 221.9\ \ \ \ 228.2\ \ \ \ 223.9\ \ \ \ 226.5\ \ \ \ 224.4\ \ \ \ 223.9
\end{minipage}

Construct a grouped frequency distribution suitable for the data.
\begin{enumerate}[Step 1)]
\item Find the smallest ($\X_1$) and largest ($\X_n$) values in the (ranked)
  data array.  Establish the observed \textbf{range} of the variable
  using the formula
\[\boxed{R= \X_n - \X_1} = 240.8\ \mbox{g} - 219.9\ \mbox{g} = 20.9\ \mbox{g}\]
There is a spread of 20.9 g between the least and greatest
observation.

\clearpage
\item Determine the \textbf{approximate number of classes} to
  use.  This is done by \emph{Sturge's formula} which says that there
  should be a doubling relation between the number of classes ($N$) and the
  number of observations ($n$) to be grouped.  Mathematically this means:
\[\boxed{N = 1 + \log(n)/\log(2)} = 1 + \log(50)/\log(2) = 6.64\ \mbox{classes}\]
This number means that between 6 and 7 classes should be used. Round
the answer to two places after the decimal for purposes of the next
calculation.

\item Determine the \textbf{approximate class width} \cwidth\ by the formula:
\[\boxed{\cwidth = \frac{R}{N}} = \frac{20.9\ \mbox{g}}{6.64\ \mbox{classes}} = 3.15\ \mbox{g/class}\]

\item Determine the \textbf{actual class width} and \textbf{class
    limits} of the \textbf{first class}.  The values calculated by these
  formulae should be used as guidelines rather than absolutes.  The
  chosen class size and class limits should be values that are close
  to those calculated but easily interpreted.  Multiples of 2, 5, or
  10 should be used for the class limits and also for the class
  interval for ease in interpreting the data. The first class should
  be chosen so that it includes the first data value.  The first class
  need not start at the first data value.

  In our case choose $\cwidth = 4.0\ \mbox{g/class}$ for ease in
  interpretation.  Although the least observation is 219.9 g, the
  lower limit for the first class will be chosen to be 218.0 g for
  clarity. The \textbf{precision} of the stated limits is to the
  nearest tenth of a gram because the original data array had this
  precision.  The first class is therefore $[218.0\ \mbox{g} - 222.0\
  \mbox{g}]$\ .

\item Determine the \textbf{remaining class limits} by continuing
  until the maximum value $\X_n$ is included.
\begin{center}
\begin{minipage}{3in}The class
  limits at right will result for our data.
The final class will be able to include \mbox{$\X_n=240.8\ \mbox{g}$}. This
will result in 6 classes.  This is within the guidelines of the number
of classes determined by formula in Step 2.  The classes must be
mutually exclusive. The first class reads 218.0~g up to but not
including 222.0~g. An observation of 222.0~g would fall into the second
class.\end{minipage}~~~~~
\begin{tabular}{|c|}\hline
Weight (g) \\ \hline
218.0 - 222.0 \\
222.0 - 226.0 \\
226.0 - 230.0 \\
230.0 - 234.0 \\
234.0 - 238.0 \\
238.0 - 242.0 \\ \hline
\end{tabular}
\end{center}
\item Complete the grouped frequency table using a tally (or
  otherwise) of the data as before.
\begin{center}
\begin{tabular}{|c|l|c|}\hline
Weight (g) & ~~~~~~~~Tally & \f\\ \hline
218.0 - 222.0 & \StrokeFive~~\StrokeFive~~\StrokeTwo &12\\
222.0 - 226.0 & \StrokeFive~~\StrokeFive~~\StrokeFive~~\StrokeFive~~\StrokeFive &25\\
226.0 - 230.0 & \StrokeFive~~\StrokeFive~~ &10\\
230.0 - 234.0 & \StrokeTwo &~2\\
234.0 - 238.0 & &~0\\
238.0 - 242.0 & \StrokeOne &~1\\ \hline
& & $\sum\f=50$ \\ \hline
\end{tabular}
\end{center}
\end{enumerate}}
\clearpage
Note:\vspace{-1em}
\begin{enumerate}
\item This six step process for summary table construction is only used
  for grouped frequency tables. Don't use this process for
  constructing an ungrouped frequency table.
\item The classes chosen by this method are closed and of equal
  width.  This is desirable for graphical and computational
  considerations. Sometimes open classes and unequal class widths
  are found in frequency tables that are used for purely descriptive
  purposes.  Age distributions and income distributions are such
  examples because they often have several values that are outliers
  with respect to the other numbers in the distribution.
\item Sometimes grouped frequency tables are created which have class
  limits chosen so that they do not overlap.  For example, why not make
  the first class $[218.0\ \mbox{g} - 221.9\ \mbox{g}]$\ ? At first
  glance this seems reasonable to prevent confusion.  Can you see any
  problem with this?
\end{enumerate}

\reading{See table examples on page 21, 22, 23, 24, 26 in the
text.}
\reading{Read the textbook pages 21 through to page 27}
\newcommand{\constructfreqanswers}{%
Frequency Distribution Construction:
\begin{enumerate}[1.]
\item needs ungrouped: tally and check case study 4
\item needs grouped:
\begin{enumerate}[Step 1)]
\item $R=99\ \mbox{km/h}-3\ \mbox{km/h}=96\ \mbox{km/h}$
\item $N=1+\log(30)/\log(2)=5.91\ \mbox{classes}$
\item $\cwidth=16.75\ \mbox{(km/h)/class}$
\item Choose $\cwidth=20\ \mbox{(km/h)/class}$, first class: $[0\ \mbox{km/h}, 20\ \mbox{km/h}]$
\item See case study 6 for remaining classes
\item Tally data and check case study 6
\end{enumerate}
\end{enumerate}
}
\assignment{\begin{enumerate}
    \answer{\protect\constructfreqanswers}
  \item Reconstruct the frequency distribution found in case study 4
    using the following raw data from which it is derived. (years)

\begin{center}
3,\ \ 2,\ \ 6,\ \ 4,\ \ 3,

2,\ \ 2,\ \ 4,\ \ 2,\ \ 4,

2,\ \ 3,\ \ 3,\ \ 1,\ \ 2,

4,\ \ 1,\ \ 2,\ \ 2,\ \ 6~
\end{center}
\item Reconstruct the frequency distribution found in case study 6 using the following raw data from which it is derived. (km/h)

\begin{center}
20,\ \ 29,\ \ 18,\ \ 30,\ \ 60,\ \ 10,\ \ 49,\ \ ~6,\ \ ~5,\ \ 31,

12,\ \ 21,\ \ 25,\ \ 19,\ \ 36,\ \ ~3,\ \ 88,\ \ 67,\ \ 71,\ \ 39,

21,\ \ 55,\ \ 42,\ \ 62,\ \ ~9,\ \ 24,\ \ 48,\ \ 99,\ \ 38,\ \ 31~
\end{center}
\end{enumerate}
}
}{}

\section{Summing Data Values}
\label{sec:summing}
When calculating statistical measures (such as an average value), one
of the quantities which will have to be computed is the \textbf{sum of
  all observations}.  The method used to find this sum depends on
which of the three methods is used to present the data.

\subsection{Raw Data}

The sum of all data values is given by: 

\[\sum \X = \X_1 + \X_2 + \X_3 + ... + \X_n\,.\]

When this is done by paper and pencil, the calculation should be done
tabularly (i.e. in a table).  List the data values in a column,
preferably rank ordered, and place the symbol \X\ with appropriate units at
the top and the symbol $\sum \X$ at the bottom.

\example{Three lengths are measured (in mm):

\begin{center}
\begin{tabular}{|c|}\hline
\X(mm) \\\hline
52\\
65\\
73\\\hline
$\sum \X = 190$\\\hline
\end{tabular}
\end{center}
}

\subsection{Ungrouped Frequency Distribution}
In this case the sum of all observations is:
\[\sum \f\X = \f_1\X_1 + \f_2\X_2 + \f_3\X_3 + ... + \f_m\X_m\,.\]
Here we must multiply each of the $m$ distinct data values $\X_i$ by
its frequency $\f_i$ because the equivalent raw data would have had the
value $\X_i$ occurring $\f_i$ times.
\example{Tickets are sold in three denominations \$5, \$10, and \$15:

\begin{center}
\begin{tabular}{|c|c|c|}\hline
\X(\$) & \f & \f\X(\$)\\\hline
~5& 10 & ~50 \\
10& 20 & 200 \\
15& 20 & 300 \\\hline
& $\sum \f = 50$ &  $\sum \f\X = 550$ \\\hline 
\end{tabular}
\end{center}

There are 50 observations (tickets sold) and the sum of these 50
observations is \$550 (the net sales).

Note the \f\X\ column will have the same units as the \X\ column since the
variable is multiplied by the (dimensionless) frequency.
}

\subsection{Grouped Frequency Distributions}
It is impossible to find the exact total of all observations when the
data is presented like this.  An approximation can be found if it is
assumed that the observations in a class are concentrated at the
midpoint of the class.  The sum of the observations is approximately
$\sum$\f\X\ where \X\ is the midpoint of the class.
\example{An exam has the following grade results:

\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
 Score (\%) & \f & \X (\%)& \f\X(\%)\\\hline
 35 - 45& ~5& 40& ~200 \\
 45 - 55& 10& 50& ~500 \\
 55 - 65& 20& 60& 1200 \\
 65 - 75& 10& 70& ~700 \\
 75 - 85& ~5& 80& ~400 \\\hline
 & $\sum\f = 50$ & & $\sum\f\X = 3000$\\\hline
\end{tabular}
\end{center}

Note: There are 50 scores summarized in the table and the approximate
sum of all scores is 3000\%.}

\subsection*{Using the Calculator}
On modern calculators with statistical functions it is possible to
enter data and have the calculator derive values of interest such as
the sum of observations.  Entering data is typically done by placing
the calculator in a statistical mode.\footnote{If you have lost the
  manual for your calculator try Googling the model number to find a
  pdf version of it for the necessary statistical instructions.}  One
then keys in each raw data value followed by a data entry key.  When
all data is entered one may select to calculate the sum of
observations ($\sum \X$), or any other value of interest, and the
result will be presented for the stored data.

The calculator can also calculate the result for frequency
distributions.  When entering data values, one enters each distinct
value.  Following each value one usually presses a comma or semi-colon
key followed by the frequency (\# of times) the value occurred in the
data.  Then the data entry key is pressed and further data may be
entered.  To retrieve the sum of observations in this case one still
would select the ($\sum \X$) key. For a grouped frequency
distribution, enter the midpoint of each class for~\X.\footnote{On a
  calculator without statistical functions one may calculate such sums
  by entering the first observation into the memory M with the
  X$\rightarrow$M key, and the rest of the list with the M+ key. The
  sum is retrieved by the RM key. For frequency distributions the sum
  can be obtained on the calculator using the same keys as for raw
  data.  Before summing with the M+ key, however, multiply the data
  value by its frequency of occurrence.}  The student should verify
the above sums on her calculator.


\assignment{For each case study find the sum of observations
  using a tabular method.  In which cases are the sums only
  approximate?  Verify the sums using the statistical data keys of
  your calculator.}

\section[Frequency Distributions Extended]{Frequency Distribution Tables Extended}

Frequency distribution tables can be extended with additional columns to
provide further information about the data.

\subsection{Relative Frequency (\rel)}

The \textbf{relative frequency} column lists the proportion, as a
decimal fraction, of observations found in a given class or at a
specific value.  We will use the symbol \rel\ for the column
caption. In symbols
\[\boxed{\rel=\frac{\f}{\sum\f}}\]
\example{The number of occupants in apartments was surveyed with the
following results:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
 \# of Occupants & \f & \rel \\\hline
 1& 23& .383\\
 2& 25& .417\\
 3& 5& .083\\
 4& 5& .083\\
 5& 1& .017\\
 6& 1& .017\\\hline
  &$\sum\f = 60$ & $\sum \rel = 1.000$ \\\hline
\end{tabular}
\end{center}}

In theory the sum of the relative frequency column will always be 1
because the sum of all proportional parts of the total equals 1. Round
these values to two or more places after the decimal for this column.
The total may not sum precisely to 1 in practice because of round off. 

Relative frequency distributions are useful for comparing
distributions where the number of observations in each array is
different.  In those cases, frequencies cannot be compared directly
but proportions can be.

\example{The following age distributions were found for two towns:

\begin{center}
\begin{tabular}{|c|c|c|}\hline
\multicolumn{3}{|c|}{Age Distribution in Smallville} \\\hline\hline
 Age (yr)& \f & \rel \\\hline
~0 - ~20 & 200& .125\\
20 - ~40 & 600& .375\\
40 - ~60 & 400& .250\\
60 - ~80 & 300& .188\\
80 - 100 & 100& .063\\\hline
 & $\sum\f = 1600$ & $\sum\rel = 1.001$ \\\hline
\end{tabular}
~~~~\begin{tabular}{|c|c|c|}\hline
\multicolumn{3}{|c|}{Age Distribution in Bigtown}\\\hline\hline
 Age (yr)& \f   & \rel \\\hline
~0 - ~20 & ~1500& .025\\
20 - ~40 & 12000& .200\\
40 - ~60 & 22000& .367\\
60 - ~80 & 16000& .267\\
80 - 100 & ~8500& .142\\\hline
 & $\sum\f = 60000$ & $\sum\rel = 1.001$ \\\hline
\end{tabular}
\end{center}
While the frequency \f\ indicates that Bigtown has more young people,
this is only due to its overall larger population.  Smallville has a
proportionately younger population as indicated by the relative
frequency \rel.}

Relative frequency columns are also useful in the presentation of data
because they are largely insensitive to the number of observations
that happen to have been taken.

\example{Rather than taking a census of Smallville and collecting the
  ages of all N=1600 inhabitants, a statistician randomly sampled
  half the people ($n=800$) and compiled the following frequency
  distribution:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
\multicolumn{3}{|c|}{Age Distribution in Smallville} \\\hline\hline
 Age (yr)& \f & \rel \\\hline
~0 - ~20 & 103& .129\\
20 - ~40 & 296& .370\\
40 - ~60 & 200& .250\\
60 - ~80 & 152& .190\\
80 - 100 & ~49& .061\\\hline
 & $\sum\f = 800$ & $\sum\rel = 1.000$ \\\hline
\end{tabular}
\end{center}
Compared to the results for the complete population, the frequency \f\
of each class drops roughly in half.  The relative frequency \rel,
however, is approximately the same as the population results.}

Many people are more familiar with interpreting percentages than
decimal fractions.  A \textbf{relative \% frequency} (symbol
\%\f) may be introduced and a conversion to \rel\ from \%\f\ made by
multiplying \rel\ by 100.  In this course, however, we will restrict
ourselves to relative frequency \rel\ and use the decimal and percent
notation interchangeably.

\subsection{Relative Frequency Density (\p)}
\label{subsec:relfreqdensity}
While the relative frequency \rel\ is largely insensitive to the
number of observations of a statistical variable it has a shortcoming
for \emph{grouped} frequency distributions because it still depends on
the class size, \cwidth.

\example{Two statisticians are given the \textbf{same} raw data for
the heights of a sample of male high school basketball players in
western Canada.  They produce the following grouped frequency
distributions, the first with class size $\cwidth=2.0$ cm, and the
second with $\cwidth=4.0$ cm:

\begin{center}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|c|}
\multicolumn{4}{c}{$\cwidth=2.0$ cm}\\\hline
Height(cm) & \X(cm) & \f & \rel \\\hline
169.0-171.0 & 170.0 &~4 & .020 \\
171.0-173.0 & \fbox{172.0} &10 & \fbox{.050} \\
173.0-175.0 & 174.0 &14 & .070 \\
175.0-177.0 & \fbox{176.0} &73 & \fbox{.365} \\
177.0-179.0 & 178.0 &70 & .350 \\
179.0-181.0 & \fbox{180.0} &17 & \fbox{.085} \\
181.0-183.0 & 182.0 &10 & .050 \\
183.0-185.0 & \fbox{184.0} &~2 & \fbox{.010} \\\hline
& & $\sum\f=200$ & $\sum\rel=1.000$\\\hline
\end{tabular}
 ~~~~
\begin{tabular}{|c|c|c|c|}
\multicolumn{4}{c}{$\cwidth=4.0$ cm}\\\hline
Height(cm) & \X(cm) & \f & \rel \\\hline
170.0-174.0 & 172.0 &~20 & .100 \\
174.0-178.0 & 176.0 &128 & .640 \\
178.0-182.0 & 180.0 &~46 & .230 \\
182.0-186.0 & 184.0 &~~6 & .030 \\\hline
& & $\sum\f=200$ & $\sum\rel=1.000$\\\hline
\end{tabular}}
\end{center}

The left frequency distribution has four classes whose centres (boxed)
line up with those of the right distribution.  Despite this fact their
relative frequencies differ considerably.  This is because the classes
on the right distribution are twice as wide as those on the left and
hence the corresponding class will typically have about twice as much
data as the ones on the left distribution.}

To remove the arbitrariness of the choice of class width, one defines
the \textbf{relative frequency density}\footnote{The term
  \emph{density} is appropriate here because, just like a mass density
  where we divide mass by volume to get mass per unit volume, here we
  are interested in getting proportion per unit of $\X$.} (symbol \p)
to be the relative frequency divided by the class size.  In symbols,
\[\boxed{\p=\frac{\rel}{\cwidth}}=\frac{\f}{(\cwidth\cdot\sum\f)}\ \ .\]
\example{Using a $\p$ column in the previous example yields:
\begin{center}
\resizebox{\textwidth}{!}{\begin{tabular}{|c|c|c|c|}
\multicolumn{4}{c}{$\cwidth=2.0$ cm}\\\hline
Height(cm) & \X(cm) & \f & \p($\mbox{cm}^{-1}$) \\\hline
169.0-171.0 & 170.0 &~4 & .010 \\
171.0-173.0 & \fbox{172.0} &10 & \fbox{.025} \\
173.0-175.0 & 174.0 &14 & .035 \\
175.0-177.0 & \fbox{176.0} &73 & \fbox{.183} \\
177.0-179.0 & 178.0 &70 & .175 \\
179.0-181.0 & \fbox{180.0} &17 & \fbox{.043} \\
181.0-183.0 & 182.0 &10 & .025 \\
183.0-185.0 & \fbox{184.0} &~2 & \fbox{.005} \\\hline
& & $\sum\f=200$ & \\\hline
\end{tabular}
~~~~
\begin{tabular}{|c|c|c|c|}
\multicolumn{4}{c}{$\cwidth=4.0$ cm}\\\hline
Height(cm) & \X(cm) & \f & \p($\mbox{cm}^{-1}$) \\\hline
170.0-174.0 & 172.0 &~20 & .025 \\
174.0-178.0 & 176.0 &128 & .160 \\
178.0-182.0 & 180.0 &~46 & .058 \\
182.0-186.0 & 184.0 &~~6 & .008 \\\hline
& & $\sum\f=200$ & \\\hline
\end{tabular}}
\end{center}
Even with the coarse class widths, one sees that the relative
frequency density \p\ at the same values of \X\ are now roughly equal.
Note that summing the relative frequency density \p\ column is meaningless.}

The odd units for \p\ (in the last example reciprocal centimetres,
$\mbox{cm}^{-1}$), reminds us that to return to a proportion we must
multiply by some interval of the variable \X, namely \cwidth.

\example{What proportion of basketball players had a height of 178 cm
to the nearest cm?  In this case the heights would have to lie between
177.5 cm and 178.5 cm, so
$\cwidth=178.5\ \mbox{cm}-177.5\ \mbox{cm}=1.0\ \mbox{cm}$ centred on
$\X=178.0$ cm.  At $\X=178.0\ \mbox{cm}$, \p\ is
$.175\ \mbox{cm}^{-1}$ so
\[P=\p\cdot\cwidth=(.175\ \mbox{cm}^{-1})(1.0\ \mbox{cm}) = .175\]
Approximately 17.5\% were 178 cm high to the nearest cm.

In this example our approximation is only valid because \cwidth\ was
narrow enough that we could expect \p\ to be relatively constant over
the interval.  Determining the proportion over wide intervals can be
done through the introduction of cumulative frequency.}

\subsection{Cumulative Frequency (\lcf)}

The \textbf{(less than) cumulative frequency column} lists the number of
observations below the real upper limit of the class in a grouped table
or the number of observations at or below a specific value in an
ungrouped table.  The caption at the top of the column is
\lcf.  In symbols:
\[\lcf_i=\f_1+\f_2+\ldots+\f_i\ \ .\]

\example{A convenience store recorded a sample of the groceries bought
by customers with the following results:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
Purchase Value (\$) & \f & \lcf \\\hline
 ~0 - 10& 12& ~12 \\
 10 - 20& 30& ~42 \\
 20 - 30& 35& ~77 \\
 30 - 40& 20& ~97 \\
 40 - 50& 23& \fbox{120} \\\hline
 & $\sum\f = \fbox{120}$ & \\\hline
\end{tabular}
\end{center}
Notice:\ \ The $\lcf_3$\ value, 77, in the third class means that 77
of the purchase values are less than \$30.}

This column will be useful when the proportions of observations within
a given interval of the range are calculated and for constructing
certain types of graphs.

Always sum the \f\ column as a check on the last entry in the
\lcf\ column. (Boxed in the example.)

A \textbf{greater than cumulative frequency column} could also be
constructed (symbol \gcf) which proceeds through the data starting at
the \emph{highest value} of \X\ and culminating with the total
frequency at the \emph{lowest} value.  We will not be using the
\gcf\ in our calculations.  The \lcf\ column and the \gcf\ column
provide the same information so in practice reference to a cumulative
frequency column usually means the \lcf\ column.

A total is meaningless at the bottom of the cumulative frequency columns.

The usefulness of these columns will become apparent as we interpret
their meaning graphically.

\subsection{Cumulative Relative Frequency (\lcr)}
A \textbf{(less than) cumulative relative frequency} (symbol \lcr) could also be added:
\[\lcr_i=\rel_1+\rel_2+\ldots+\rel_i\ \ .\]
\example{Egg production over one week was measured for a sample of
chickens with the following results:
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
Production (eggs/wk) & \# of Chickens & \rel & \lcr \\\hline
0 & 1 & .05 & ~.05 \\
1 & 2 & .10 & ~.15 \\
2 & 3 & .15 & ~.30\\
3 & 4 & .20 & ~.50\\
4 & 6 & .30 & ~.80\\
5 & 3 & .15 & ~.95\\
7 & 1 & .05 & \fbox{1.00}\\\hline
& $\sum\f=20$ & $\sum\rel=\fbox{1.00}$ & \\\hline
\end{tabular}
\end{center}
The fifth entry (\X=4 eggs/wk) having $\lcr=.80$ indicates that 80\%
of the chickens laid 4 eggs or less.}

As with the introduction of relative frequency, cumulative relative
frequency makes the result effectively independent of the number of
observations; the final entry will always be 1.0 (within rounding
error).

Summing cumulative relative frequency is meaningless.

As an aside, note that it is meaningless to create a cumulative
relative frequency \emph{density} column involving \p\ since we would
have to multiply by the class width \cwidth\ to get a useful
proportion before summing and this is just the same as \lcr.  Our
motive for introducing \p\ was to get a property independent of class
width and it turns out that \lcr\ is already independent of class
width.  This may be verified by adding the \lcr\ column to the first
two tables in Section~\ref{subsec:relfreqdensity}.  This said, it is
the case that for relative frequency density it is common to replace
the class values $\p_i$ with a continuous function $\p(X)$ that goes
through them.\footnote{We will see in the next section a frequency
  polygon that is just such a function.  Alternately one could try
  fitting a curve to the points.}  In that case one would be able to
define the \emph{continuous} cumulative relative frequency function
$\lcr(X)$ by the integral:
\[
\lcr(X)=\int^{X}\p\;d\X\,
\]
which would approximate our class $\lcr_i$ values at similar \X.  Here one
sees the differential relative frequency $d\rel=\p\;d\X$ showing up
which replaces our $\rel=\p\cdot\cwidth$ when one moves to the continuum
limit.  The integral replaces our discrete summation.

\assignment{For each case study that is a frequency distribution
  append a column for the relative frequency, $\rel$.  For grouped
  frequency distributions also append the relative frequency density
  $\p$.  Append columns for cumulative frequency, $\lcf$, and
  cumulative relative frequency, $\lcr$, to all frequency
  distributions.}

\section{Graphical Representation of Data}

Another method of analyzing the variation in the statistical variable is
by constructing a picture of the variation.  This can be done by
statistical chart or by statistical graph depending on the data type. 
The basis for both of these graphics is a statistical summary table.

Statistical charts are a visually appealing method of presenting data.
They are often used in connection with presenting data to a wide
audience such as is done in annual reports of companies and budgets of
municipal agencies.  Many people do not have the artistic skill to
present data this way.  Computer packages, such as many spreadsheet
programs, can perform the graphic techniques required to create
statistical charts. Charts are most often used to present qualitative
statistical information. We will not be emphasizing chart construction
in this course.

\reading{See your textbook on pages 30 through 40.}

The construction of statistical graphs is more important in an
introductory statistics class because a graph is the basis for
understanding statistical distributions.  Statistical graphs differ
from charts in that the graphs are plotted on an axis system with two
axes.  The axes are treated as being continuous in a mathematical
sense.  That is, a ratio scale can be set up on both axis.

Consider the following grouped frequency distribution representing the
payments, on satellite phone contracts, made by a group of surveyors.
Additional columns for relative frequency (\rel), relative frequency
density (\p), less than cumulative frequency (\lcf) and less than
cumulative relative frequency (\lcr) have already been appended.
\begin{center}
\begin{tabular}{|c|c|c|c|c|c|}\hline
\multicolumn{6}{|c|}{Monthly Satellite Phone Payments}\\\hline
 Payment (\$) & \f & \rel & \p\ (1/\$) & \lcf & \lcr\\\hline
 ~60 - ~75& ~7& .047 &.0031 & ~~7 &~.047\\
 ~75 - ~90& 13& .087 &.0058 & ~20 &~.134\\
 ~90 - 105& 22& .147 &.0098 & ~42 &~.281\\
 105 - 120& 35& .233 &.0156 & ~77 &~.514\\
 120 - 135& 38& .253 &.0169 & 115 &~.767\\
 135 - 150& 23& .153 &.0102 & 138 &~.920\\
 150 - 165& ~5& .033 &.0022 & 143 &~.953\\
 165 - 180& ~7& .047 &.0031 & 150 &1.000\\\hline
& $\sum\f = 150$ & $\sum\rel=1.000$ & & & \\\hline
\end{tabular}
\end{center}

We will now consider graphs involving frequency versus \X\ and
cumulative frequency versus \X\ for this example.
\clearpage
\subsection{The Histogram and Frequency Polygon}
One way of graphing frequency \f\ versus the variable \X\ is to make a
\textbf{histogram}.  The following is a histogram for the previous data.

% The zerof and invisible draw below are to make the right axis be
% properly aligned.
\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={60,75,90,105,120,135,150,165,180};
real[] mids={52.5,67.5,82.5,97.5,112.5,127.5,142.5,157.5,172.5,187.5};
real[] count={7,13,22,35,38,23,5,7};
real[] countwzeros={0,7,13,22,35,38,23,5,7,0};
real zerof(real x) {return 0.0;}
ylimits(0,40);
histogram(bins, count, bars=true);
xaxis("$\mbox{Payment}(\$)$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Ticks=bins));
yaxis("$\f$",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,40/(15*150));
    draw(pic,graph(pic,zerof,45,195),invisible);
    yaxis(pic,"$\p\ (1/\$)$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Frequency Versus Monthly Satellite Phone Payment",point(N));
\end{asy}
\end{center}

Rather than plotting points, the histogram is drawn with bars of
height given by the frequency of the class \f\ and width given by the
class width \cwidth.  On the one hand, plotting a bar rather than a
point makes sense since the frequency is associated with an entire
class.  The reason for plotting bars is also motivated by the desire
to associate not the height but rather the \textbf{area} under the
curve with the number of observations.  This is reasonable since the
area of a particular bar in the histogram is proportional to the
frequency because the area is simply $\f\cdot\cwidth$ and \cwidth\ is
constant.  If one bar represents the number of observations for the
given class it follows that the the \textbf{total area} under the
frequency histogram represents the total number of observations.

On the right vertical axis is a scale for the relative frequency
density \p.  A histogram of relative frequency density \p\ versus \X\
is especially useful since the area of a particular bar now becomes
$\p\cdot\cwidth$ which is just the relative frequency (proportion)
\rel\ associated with that class.  The total area of all the bars is
then the sum of the relative frequencies which is exactly 1.

If one is interested in the fraction of observations that fall between
two values such as \$110 and \$130, simply calculate the area under the
histogram curve between the two values.  A rough rectangular estimate
in this case would see $\p=.015 (1/\$)$ times
$\cwidth=\$130-\$110=\$20$ equalling .30 or 30\% of the observations.
A more precise method of calculating this proportion graphically will
be found when we plot cumulative frequency versus \X.

One defect of the histogram is how boxy it is.  This is an artifact of
our (arbitrary) choice of class width \cwidth\ when we made our
grouped frequency distribution.  An improvement that smooths out this
artifact is the \textbf{frequency polygon} shown in the following
graph for the same data.  The frequency polygon has been superimposed
over the original histogram for comparison.

\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={60,75,90,105,120,135,150,165,180};
real[] mids={52.5,67.5,82.5,97.5,112.5,127.5,142.5,157.5,172.5,187.5};
real[] count={7,13,22,35,38,23,5,7};
real[] countwzeros={0,7,13,22,35,38,23,5,7,0};
real zerof(real x) {return 0.0;}
ylimits(0,40);
histogram(bins, count, bars=false);
xaxis("$\mbox{Payment}(\$)$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Ticks=bins));
yaxis("$\f$",Left,RightTicks(trailingzero));
draw(graph(mids,countwzeros),black+1);
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,40/(15*150));
    draw(pic,graph(pic,zerof,45,195),invisible);
    yaxis(pic,"$\p\ (1/\$)$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Frequency Versus Monthly Satellite Phone Payment",point(N));
\end{asy}
\end{center}

The frequency polygon is plotted by plotting the frequency \f\ (or
relative frequency density \p) versus the \textbf{midpoint} of each
class.  Note one must add an empty class before the first and after
the last class so that the frequency polygon can be extended to zero.
If one compares the frequency polygon to the original histogram one
sees that it preserves the area under the curve.  Any triangle that is
under the histogram which is not under the frequency polygon is
exactly compensated by a neighbouring triangle of identical area that
is under the frequency polygon but not under the histogram.  For this
reason we do not attempt to further smooth out our line joining the
points as we would for another nonlinear graph.  When we talk about
arbitrary frequency distributions of continuous variables we will, in
future, show a perfectly smooth curve which we imagine would result
from a frequency polygon for a large amount of data with small class
width.

The frequency polygon is an attempt to replace the histogram by a
smooth mathematical curve whose equation can be analyzed.  It is said
that the mathematical curve models the distribution.

\subsection*{The Shape Of A Distribution}

The \textbf{shape} of a distribution refers to the shape
of the frequency polygon.  Some general categories are as follows.

\begin{enumerate}
\item Many distributions have the bulk of the observations in the
  middle of the range with a few observations located at the
  extremities of the range.  As a result, the distribution curve takes
  the following \textbf{symmetrical} shape:

\begin{center}
\includegraphics[width=5in]{image1.png}
\end{center}

\item Sometimes the areas of concentration are not located at the
  centre but are located more to one side or the other of the range.
  As a result the distribution curve takes the following
  \textbf{skewed} shape.  If the tail of the distribution is on the
  left side we say that it is \textbf{negatively} skewed.  If the tail
  is on the right side the distribution is \textbf{positively} skewed.

\begin{center}
\includegraphics[width=5in]{image2.png}
\end{center}

\item Sometimes there is more than one area of concentration in the
  distribution.  This is reflected in the frequency polygon by several
  peaks.  If the distribution has two peaks, it is referred to as a
  \textbf{bimodal} shape.  A bimodal shape indicates that there are
  two underlying trends within one data set.

\begin{center}
\includegraphics[width=5in]{image3.png}
\end{center}

\end{enumerate}
\clearpage
\subsection{Cumulative Frequency Polygon Curves  (Ogive Curves)}
A plot of cumulative frequency \lcf\ versus \X\ is called a
\textbf{cumulative frequency polygon} or \textbf{ogive} (pronounced
``oh jive'').  The ogive for the previous data is as follows:

\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={60,75,90,105,120,135,150,165,180};
real[] cumulative={0,7,20,42,77,115,138,143,150};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Payment}(\$)$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Ticks=bins));
yaxis("$\lcf$",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,60,180),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Cumulative Frequency Versus Monthly Satellite Phone Payment",point(N));
\end{asy}
\end{center}

For a less than cumulative frequency ogive one plots \lcf\ versus the
\textbf{upper limit} of each class. The lower limit of the first class
is given the value zero.  That this should be the case follows from
the fact that at the very lower end of the class none of the frequency
for the given class has accumulated but by the time the upper limit
occurs all the observations up to that point have to have been
included.  By the time the upper limit of the last class has arrived
all the observations have been accounted for so its vertical value is
$\sum\f$.

On the right axis has been added the scale for the less than
cumulative relative frequency \lcr.  An ogive plotting cumulative
relative frequency \lcr\ versus \X\ is useful if one is interested in
the fraction of observations occurring up to a point rather than the
actual number of observations.  In this case the upper limit of the
last class is associated with the value 1.0 since 100\% of the
observations have been accounted for by this point.  Note that when
plotting an ogive one can restrict oneself to plotting \lcf\ since one
can always add a \lcr\ axis afterward just by ensuring 1.0 (100\%) is
placed opposite to the total number of observations $\sum\f$.
(i.e. one does not need to actually calculate the \lcr\ values as we
did above.)

\subsection*{The Path Traced Out By The Ogive Curve}

If a distribution is perfectly symmetrical, the ogive curve will be
perfectly ``S'' shaped.  This is because observations build slowly in
the extremities of the range and quickly at the centre of the range.
\begin{center}
\includegraphics[width=3.1in]{image4.png}
\end{center}

If the distribution is skewed, it will build area slowly for a greater
distance at the beginning of the range and the ogive curve will have
distorted ``S'' shape.

\begin{center}
\includegraphics[width=5.5in]{image5.png}
\end{center}

The ogive curve, from a geometrical viewpoint,
finds areas under the frequency polygon curve. 

Using the ogive, the exact centre of the data can be determined.
Start at the the .5 (50\%) figure on the \lcr\ axis and extend a
horizontal line to the left until the ogive curve is intersected.  The
value of \X\ to which this corresponds is in the exact middle of the
data with half the observations below it and half above it.  We will
see that this value is called the \textbf{median}.
\begin{center}
\includegraphics[width=5in]{image6.png}
\end{center}

The proportion of observations between any two values in the range
can be found by subtracting the corresponding \lcr\ 
values on the \lcr\ axis.
For instance, in our previous example, if we were interested in knowing
the fraction of observations that lie between \$110 and \$130 we could
extend vertical lines upward from these values on the \X\ axis until
they intersect the ogive curve.  From there we can extend horizontal
lines to the right to find what the cumulative proportion of
observations are up to \$110 and \$130 respectively.  The values are
(see graph) .36 and .68 respectively.  The \textbf{difference} of
these values (.32) indicates that 32\% of the observations lie between
\$110 and \$130.  This may be compared with our rough estimate of 30\%
for the area under the histogram over this interval from before.
% Note the interpolated values are exactly .3586 and .6827 .

\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={60,75,90,105,120,135,150,165,180};
real[] cumulative={0,7,20,42,77,115,138,143,150};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Payment}(\$)$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Ticks=bins));
yaxis("$\lcf$",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,60,180),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks);
    xequals(pic,110,ymin=0,ymax=.3586,dashed);
    yequals(pic,.3586,xmin=110,xmax=180,dashed);
    xequals(pic,130,ymin=0,ymax=.6827,dashed);
    yequals(pic,.6827,xmin=130,xmax=180,dashed);
  });
add(q);
label(shift(5mm*N)*"Cumulative Frequency Versus Monthly Satellite Phone Payment",point(N));
\end{asy}
\end{center}

Finally we can invert this argument and ask between what two values of
\X\ the middle 80\% of the data lie.  This involves finding what \X\
values correspond to $\lcr=.10$ and $\lcr=.90$ respectively as shown
in the following diagram.  These \X\ values are known at the
$10^{\mbox{\scriptsize th}}$ and
$90^{\mbox{\scriptsize th}}$ percentiles ($P_{10}$ and $P_{90}$).

\begin{center}
\includegraphics[width=6in]{image7.png}
\end{center}

\assignment{Sketch a histogram and ogive for each case study
  that is a grouped frequency distribution.  Describe the shape of the
  histograms.}

\section{Measures of Central Tendency}
Consider an array of data for a statistical variable \X.  The
following is a partial list of the 105 observations:

\begin{center}
\begin{tabular}{ccc}
~~~2300~~~&~~~2000~~~&~~~2300~~~\\
2100&2300&2700\\
2300&2600&2300\\
\vdots&\vdots &\vdots\\
1900&2400&2300
\end{tabular}
\end{center}

For descriptive purposes, statisticians sometimes use a single number to
represent an entire array of observations. A statistical measure of the
centre of a distribution is a value that is representative of the
entire array of observations.  Another name for a measure of the centre
is an average value.  As the name suggests, there is a tendency for a
collection of observations to cluster around some central value.

On a perfectly symmetrical distribution, a good central value is the
midrange.
\[\boxed{\mbox{Midrange}=\frac{\X_1+\X_n}{2}}\]

\begin{center}
\includegraphics[width=4in]{image2-1.png}
\end{center}

The midrange in general is a poor central value because it is
sensitive to \textbf{outliers} (values of the variable that are a
great distance from the majority of the observations).  It also is
independent of most of the data.

When a person unfamiliar with statistical calculations uses the word
``average'', it is usually understood that the person means the
following:
\[\boxed{\mbox{``average''}=\frac{\mbox{sum of all observations}}
                          {\mbox{number of observations}}}\]

To statisticians there are a number of  types of averages used to
represent data arrays.  Three of these averages have special properties
that are related to the distribution curves of the observations.  These
are the:
\begin{center}
\fbox{\begin{minipage}{1.5in}
\begin{enumerate}
\item Mode
\item Median
\item Arithmetic Mean
\end{enumerate}
\end{minipage}}
\end{center}

Each of these averages represents the data array best depending upon
what is to be portrayed and the shape of the distribution.  This will
be more apparent when these measures are calculated.

\subsection{The Mode}

The mode is that value of the variable that occurs the most often. 
Since it occurs the most often, it is the \X\ value with the greatest
frequency on the frequency polygon. Some of the important
characteristics of the mode are:
\begin{enumerate}
\item The mode may \emph{not be unique} since a distribution may have more
  than one mode.
\item There is no calculation required to find the mode since it is
  \emph{obtained by inspection} of the data.
\item If the mode is used as a representative of individual values in
  the array, it will be in error less often than any other average
  used.  If the size of this error is important such as in sizes in
  the manufacturing business, the mode is a good representative of the
  data array.
\item In a \emph{negatively skewed distribution}, the mode is \emph{to
    the right of the midrange}. In a \emph{positively skewed}
  distribution the mode is \emph{to the left of the midrange}.  Draw
  sketches to illustrate this relationship.
\item If what is to be portrayed is a \emph{typical} value in an
  array, it is most typical because no value occurs more often.
\item For data measured at the nominal level, it is the only average
  that can be found.
\end{enumerate}

\subsection{The Median}
The median is that value in the distribution such that half of the
observations are less than this value and half are greater than this
value.  Because the area under the distribution curve represents the
total number of observations, the median is that \X value on the
frequency polygon such that half of the area under the curve lies to
the right and half of the area lies to the left of the value. The
median can be read directly off the ogive curve by locating the
variable value corresponding to \lcr=.50=50\%.

\begin{center}
\includegraphics[width=6in]{image2-2.png}
\end{center}

\clearpage
Some important characteristics of the median are:
\begin{enumerate}
\item The median is representative of the data array because it is in
  the geometrical centre of the distribution.  It is the exact halfway
  point. Half the observations are less and half are greater than the
  median value.
\item On the positively skewed data set, the median will be to the
  right of the mode and on negatively skewed data sets to the left.
  Draw sketches to illustrate this relationship.
\item The median is \emph{always unique} for a data set.
\item The median is useful for descriptive purposes when the data set
  is \emph{skewed} because of the constancy of its location.  It is always
  exactly the middle observation in the data array when the array is
  \emph{rank ordered} and it is insensitive to outliers.
\item The median can be found for data that has an ordinal level of
  measurement or higher.
\end{enumerate}

\subsection{The Arithmetic Mean}
If the word ``average'' is used without a qualifier, the arithmetic
mean is the average meant.  Its location on a distribution curve is
more abstract.  It has the property of being the \X\ value at the
``balance point'' or ``centre of gravity'' of the distribution curve.
Think of the teeter-totter example:

\begin{center}
\includegraphics[width=4in]{image2-2b.png}
\end{center}

The balance point of the teeter-totter arrangement above is at the
centre of the system.

\begin{center}
\includegraphics[width=4in]{image2-3.png}
\end{center}

To make the teeter totter arrangement above balance, the balance point
must be moved away from the centre of the system.

For a statistical distribution, the arithmetic mean by definition is the
value of the variable that is at the balance point on a frequency
distribution graph.

\begin{center}
\includegraphics[width=4in]{image2-4.png}
\end{center}

The diagram on the left shows that the balance point of this
distribution is located at the same place as the median and the mode,
namely at the middle of the range.  The balance point of a skewed
distribution is shifted away from the middle of the range. 

 Some important characteristics of the arithmetic mean are:
\begin{enumerate}
\item The arithmetic mean is the average which is found by the
procedure: 
\[\mbox{``average''}=\frac{\mbox{sum of all observations}}
                          {\mbox{number of observations}}\]
\item The location of the mean is dependent upon the shape of the
distribution.  It may not 
always be representative of the centre.
\item The arithmetic mean has mathematical properties that the other two
averages do not have.  (Balance point property).
\item Because of its mathematical properties, the mean lends itself
to further mathematical analysis of data sets unlike the other two averages.
\item The mean is used as a measure of the centre in statistical
inference because these mathematical properties are important in that
instance.
\item The mean requires a quantitative variable, typically at the
  ratio level of measurement.
%Further mean properties could be incorporated here.
\end{enumerate}

\subsection*{The Arithmetic Mean In Samples And Populations}
Because the mean is used as a measure of the centre in statistical
inference problems, there is a different symbol that is used to
represent the mean in a sample and the mean in a population.
\[
\left.
\begin{array}{l}
\pmean=\mbox{Population Mean} \\ \\
\smean=\mbox{Sample Mean}
\end{array}
\right\}
=\frac{\mbox{sum of all observations}}{\mbox{number of observations}}
\]


Visualize the relationship between these two symbols with the following
diagram:

\begin{center}
\includegraphics[width=3in]{image2-5.png}
\end{center}

\reading{Read your textbook pages 43 to 49.}

If the distribution is symmetrical all averages are located at
midrange.  On a skewed distribution curve there is a spread of the
three averages. It is approximately true that the median is one third
of the way from the mean towards the mode in a skewed distribution.
% A diagram should be added here.

\assignment{For case studies that are grouped frequency
  distributions, estimate the mode, median, and the mean for the
  distributions using only your histograms and ogives.}

\section[Averages for Ungrouped Data]{Calculating an Average for Ungrouped Data}
Because an ungrouped frequency table preserves all the raw data
from which it is assembled, the two cases are treated similarly when
calculating the measures of central tendency.
\subsection{The Mode}
\subsubsection{Raw Data}
No calculation is required.  Determine which value occurs the
most often by rank ordering the data.

\example{The ages of people in a certain occupation were
observed to be:  (yrs)

\begin{center}
23, 67, 26, 32, 26, 45, 26, 54
\end{center}

The array rank ordered is:
\begin{center}
23, 26, 26, 26, 32, 45, 54, 67
\end{center}

The mode of the data is 26.0 years.}

\subsubsection{Ungrouped Frequency Table}

No calculation is required.  Determine the value that has the
highest frequency of occurrence by inspection of the table.
\example{\begin{center}
\begin{tabular}{|c|c|}\hline
 Wage (\$/hr) & \f \\\hline
  ~9.25& ~4\\
  10.50& 10\\
  12.50& ~5\\
  14.50& ~1\\\hline
& $\sum\f=20$\\\hline
\end{tabular}~~~~~~~~~~
\begin{minipage}{3in}
  The wages of employees on a summer work project were as
  shown. The mode of the data is 10.50 \$/hr since that value has the
  greatest frequency.
\end{minipage}
\end{center}}

\clearpage
\subsection{The Median}

\subsubsection{\label{subsec:medianraw}Raw Data}

Rank order the data and pick the value in the middle position. To
identify the median, two procedures are necessary, first finding the
position of the median and then its actual value at that position:
\[\boxed{\mbox{Median Position} =  \frac{1}{2}\left(n+1\right)}\]

\[\boxed{\mbox{Median Value} = \X_{\frac{1}{2}\left(n+1\right)}}\]

\example{\begin{itemize}
\item Haircuts at barbershops in a community were
observed to have the the following prices:~(\$)
\begin{center}
20.00,  12.00,  7.50,  6.50,  8.00,  9.50,  8.00
\end{center}
\begin{eqnarray*}
\mbox{Median Position} & = & \frac{1}{2}\left(n+1\right)=\frac{1}{2}\left(7+1\right)=4^{\mbox{\scriptsize th}}\\
\mbox{Median Value} & = & \X_4
\end{eqnarray*}

The \textbf{fourth observation} in \textbf{rank order} is the Median value.

\begin{center}
6.50,  7.50, 8.00,  \fbox{8.00},  9.50,  12.00, 20.00.

\end{center}
The median is \$8.00.

\item Suppose an eighth barbershop was accidentally
omitted.  It charges \$9.00 for a haircut.
\begin{eqnarray*}
\mbox{Median Position}& = &\frac{1}{2}\left(n+1\right)=\frac{1}{2}\left(8+1\right)
=4.5^{\mbox{\scriptsize th}}\\
\mbox{Median Value}& = & \X_{4.5}
\end{eqnarray*}

Since there are 8 observations, the value halfway between the fourth
and fifth observation in rank order will be the median.

\begin{center}
6.50,  7.50,  8.00,  \fbox{8.00,  9.00,}  9.50,  12.00, 20.00
\end{center}

Interpolating halfway between $X_4$ and $X_5$, amounts to taking the average:

\[\mbox{Median Value}=\X_{4.5}=\frac{X_4+X_5}{2}=\frac{\$8.00+\$9.00}{2}=\$8.500000 = \$8.50\ .\]
The median is \$8.50 .
\end{itemize}}

\subsubsection{\label{subsec:medianungrouped}Ungrouped Frequency Table}

The method of calculating the median is the same as for
ungrouped data except a \lcf\ column is required to
locate the position.

\example{Fishery biologists want to test the efficacy of a fish ladder
around a dam.  They electronically tag a number of fish and count the
number of fish that cross the fish ladder in a given day with the
following results:

\begin{tabular}{|c|c|c|}\hline
Catch (fish) & Days & \lcf \\ \hline
1&3&~3\\
2&8&11\\
3&8&19\\
5&1&20\\ \hline
& $\sum\f = 20 $& \\ \hline
\end{tabular}~~~~~~~~~~~~~
\begin{minipage}{3in}
Remember that this table is a shorthand method of writing a list of 40
values in rank order, so
\[\boxed{\mbox{Median Position} = \frac{1}{2}\left(\sum\f+1\right)}=\frac{1}{2}\left(20+1\right)=10.5^{\mbox{\scriptsize th}}\]
\[\boxed{\mbox{Median Value}  =  \X_{\frac{1}{2}\left(\sum\f+1\right)}}=\X_{10.5} = 2.0\ \mbox{fish}\]
\end{minipage}

The median is half way between the tenth and eleventh
observation.  From the \lcf\ column, we see that both observations are
2 fish so the median is 2.0 fish. Had the values $\X_{10}$ and $\X_{11}$
been different, we would have averaged them as before.}

\subsection{The Arithmetic Mean}

\subsubsection{Raw Data}
\label{subsubsec:meanraw}

The arithmetic mean is calculated as the sum of all observations divided
by the number of observations.  Place the observations in rank order
with the sum of all observations at the foot of the column. Use the
appropriate captions and footing symbols.
%
%Original Andromeda photo taken from the Wikipedia article on Andromeda.
%By Boris Stromar
%It has the following license attributes:
%This file is licensed under the Creative Commons Attribution 3.0
%Unported license. 	
%    You are 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).
% I modified the original photo to make it more suitable for printing using
% imagemagick's convert program:
% convert M31bobo.jpg -colorspace gray -colors 256 M31_256.png
% convert M31_256.png -negate M31_256_invert.png
% Original images are in the image directory.
%window environment requires picinpar package
%The first option says what line to put the picture at
%The second option says whether the picture should be left (l) centre (c)
%or right(r)
%Note that footnotes can't be used in the window environment, nor in the
%the \example environment.  One must use
%the footnotemark in the window and footnotetext outside of it.
\example{%
\begin{window}[1,r,%
\fbox{\includegraphics[width=2in]{M31_256_invert.png}},{\centering\textbf{The Andromeda Nebula}}]
A \emph{Cepheid Variable} is a type of star
whose brightness oscillates over time in a repeated fashion.  By
measuring this period of oscillation, astronomers are able to
determine how bright the star is in absolute terms.  By comparing this
with the star's apparent brightness and knowing that intensity falls
of with distance squared, astronomers can calculate the actual
distance to these stars.  Using this technique an astronomer
calculates the distance to five such stars found in the
\emph{Andromeda Nebula}\footnotemark\ (right) with the following
results (in millions of light-years\footnotemark):

%centering commands/environments don't seem to work in window so used \hfil
\hfil 2.6, 2.4, 2.5, 2.4, 2.7 (\mbox{Mly})\ .\hfil
\end{window}
Calculate the mean distance, and hence estimate how far the Andromeda
Nebula is from our sun.}{%
Proceeding in a tabular format:
\begin{center}
\begin{tabular}{|c|}\hline
\X (Mly)\\\hline
2.4\\
2.4\\
2.5\\
2.6\\
2.7\\\hline
$\sum\X = 12.6$\\\hline
\end{tabular}
~~~~~~~~~~~~~
\begin{minipage}{3in}
The arithmetic mean of a sample is calculated as:
\[\boxed{\smean=\frac{\sum\X}{n}}\]
 In our case:
\[\smean=\frac{\sum\X}{n}=\frac{12.6\ \mbox{Mly}}{5}=2.520000\ \mbox{Mly}=2.52\ \mbox{Mly}\]
\end{minipage}
\end{center}}
%We have to play with the footnote counter to get the numbers correct at the
%bottom of the page.
\addtocounter{footnote}{-1}%
\footnotetext{The Andromeda Nebula is often referred to by its number
  in the Messier astronomical catalogue, M31. Original photo by Boris
  \v{S}tromar altered to grayscale with black-white inversion.}
\addtocounter{footnote}{1}%
\footnotetext{One light-year is the distance light can travel in one
  year, about $9.46\times 10^{15}\ \mbox{metres}$.}

It is helpful to rank order the data for purposes of checking the
answer.  The mean is a central value.  The calculated value can be
compared to the range of values.  \emph{It must lie inside the range}. Pay
attention to the symbol used for the sample mean.

\subsubsection{Ungrouped Frequency Tables}
\label{subsubsec:meanungrouped}
To calculate the sum of all observations in this case, the frequency
of occurrence of each observation must be taken into account when
summing all observations.

\example{A statistician played the lottery every week for four years
and tabulated all of his resulting winnings in the following table for
his article \emph{Why I decided to stop playing the lottery after four
  years}.
\begin{center}
\begin{tabular}{|c|c|c|}\hline
 Winnings \X $\left(\mbox{\$}\right)$ & Tickets \f & \f\X$\left(\mbox{\$}\right)$\\\hline
 ~~0.00& 172& ~~0.00\\
 ~~5.00& ~20& 100.00\\
 ~10.00& ~~6& ~60.00\\
 100.00& ~~2& 200.00\\\hline
 & $\sum\f = 200$ & $\sum\f\X = 360.00$\\\hline
\end{tabular}
~~
\begin{minipage}{2.6in}
For ungrouped data the arithmetic mean formula is:
\[\boxed{\pmean=\frac{\sum\f\X}{\sum\f}}\]
 
In our case:
\[\pmean=\frac{\sum\f\X}{\sum\f}= \frac{\$360.00}{200}  =  \$1.80000 = \$1.80\]
\end{minipage}
\end{center}
If each ticket cost \$5.00, how much, on average, did the statistician
donate to the lottery company each time he bought a ticket?}

\subsubsection*{The Number Of Decimal Place To Retain In An Average Calculation}

Use \textbf{one place more precision} in the calculated average than
is found in the precision of the data array. An exception is if the
data consist of exact dollar amounts, in which case the precision of
the calculation will be \textbf{to the nearest cent}.  See the
examples in Sections~\ref{subsubsec:meanraw} and
\ref{subsubsec:meanungrouped} respectively for application of these
rules.

\clearpage
\subsubsection*{Populations and Samples}

In applied problems the mean is the average that is most often used in
statistical inference situations.  Because of this, there are two
different symbols used to designate the mean, \smean\ and \pmean. For
samples use the symbol \smean\ as was done in
Section~\ref{subsubsec:meanraw}.  For populations use the symbol
\pmean\ as demonstrated in Section~\ref{subsubsec:meanungrouped}.  The
procedure is the same for calculating a population mean as for a
sample mean. The two formulae use different symbols to show that the
data sets represent different situations.  The following table
summarizes the formulae so far for the mean.

\begin{center}
\begin{tabular}{c||c|c}
& Population & Sample \\\hline\hline
Raw Data\raisebox{-1.2em}{\rule{0in}{3.4em}}& ~~~$\displaystyle\pmean=\frac{\sum\X}{N}$~~~ & ~~~$\displaystyle\smean=\frac{\sum\X}{n}$~~~\\\hline
Grouped Frequency\raisebox{-1.2em}{\rule{0in}{3.4em}} & $\displaystyle\pmean=\frac{\sum\f\X}{\sum\f}$ & $\displaystyle\smean=\frac{\sum\f\X}{\sum\f}$
\end{tabular}
\end{center}

\subsubsection*{Statistical Keys on the Calculator}

The mean can be calculated directly on a calculator with the use of
its statistical keys.  The calculator must be placed in statistical
mode before the data is entered as discussed in
Section~\ref{sec:summing}.  The calculator has only one symbol to
represent a mean because most often when a mean is calculated it is
done on sample data. Use this same key to calculate the mean value for
populations but replace the symbol with the ${\mu}$ symbol.

\assignment{For each case study that is raw data or an ungrouped
  frequency distribution calculate the mode, the median, and the
  arithmetic mean.  Where a calculation is required (median and mean),
  remember to include the items below in your answer as demonstrated
  in the previous examples.
\begin{center}
\rule{4in}{.05em}
\end{center}
\begin{center}
\large{Requirements for a Complete Solution (\textbf{F.S.A.R.U.})}
\end{center}
\begin{description}
\item[Formula] State the formula used, including appropriate symbols
  to identify population or sample.
\item[Substitution] Substitute the values for your problem.  Remember
  to add any columns to the table that are required for the
  calculation of those values (e.g. \f\X\, or \lcf).
\item[Answer] Write your answer including sufficient extra decimals of
  significance to allow for rounding.
\item[Rounding] Round to the appropriate number of decimal places
  discussed above.
\item[Units] Include the appropriate units.  Note that all the
  measures of central tendency have the same units as the statistical
  variable \X.
\end{description}
}

\clearpage
%Make a new column for the table of contents.
\addtocontents{toc}{\protect\columnbreak}
\section[Averages for Grouped Data]{Calculating Average Values of Grouped Frequency Distributions}

Recall that the individual observations \emph{are lost} when data are
summarized by grouping.  It is therefore \emph{impossible} to locate
the \emph{exact} value within the array that is at the centre.
\emph{Approximations} to these averages are possible by comparing the
definitions of these values to the frequency polygon and the ogive
curve.

Examine the summary table, frequency polygon, and ogive curves below:

\begin{center}
\begin{tabular}{|c|c|c|}\hline
\multicolumn{3}{|c|}{Value of Used Computer Hard Drive}\\\hline
 Value (\$)& \f & \lcf\\\hline
 ~5.00 - 15.00& ~5& ~5\\
 15.00 - 25.00& ~8& 13\\
 25.00 - 35.00& 12& 25\\
 35.00 - 45.00& ~6& 31\\
 45.00 - 55.00& ~5& 36\\
 55.00 - 65.00& ~4& 40\\\hline
& $\sum\f = 40$ & \\\hline
\end{tabular}
\end{center}

% The following histogram seems to reflect a bug in the histogram
% package.  For some reason it is defaulting to a y-axis of lower limit 5(the
% lowest frequency) rather than 0 even though I have set the axis.
% Setting the y-axis just serves to show the lines below 5 not drawn.
% To trick the histogram code, I had to add not only empty classes
% beside on the outside, but I had to give one of them a
% frequency of .000001.  This made it work.
\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={5,15,25,35,45,55,65};
real[] binswzeros={-5,5,15,25,35,45,55,65,75};
real[] mids={0,10,20,30,40,50,60,70};
real[] count={5,8,12,6,5,4};
real[] countwzeros={0.00001,5,8,12,6,5,4,0};
real zerof(real x) {return 0.0;}
ylimits(0,12);
histogram(binswzeros, countwzeros, bars=true);
//histogram(bins, count, bars=true);
xaxis("$\mbox{Value}(\$)$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Ticks=bins));
draw(graph(mids,countwzeros),black+1);
yaxis("$\f$",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,12/(10*40));
    draw(pic,graph(pic,zerof,-5,75),invisible);
    yaxis(pic,"$\p\ (1/\$)$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Frequency Versus Used Hard Drive Value",point(N));
\end{asy}
\end{center}

\begin{center}
\begin{asy}
import graph;
import stats;
size(300,150,IgnoreAspect);
real[] bins={5,15,25,35,45,55,65};
real[] cumulative={0,5,13,25,31,36,40};
real[] myticks={0,.25,.50,.75,1};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Value}(\$)$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Ticks=bins));
yaxis("$\lcf$",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,5,65),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks(Ticks=myticks));
  });
add(q);
label(shift(5mm*N)*"Cumulative Frequency Versus Hard Drive Value",point(N));
\end{asy}
\end{center}

\subsection{The Mode Of Grouped Data}

The mode is the value of the variable observed the most often.  The
\textbf{midpoint of the class with the highest frequency} is taken as
the mode because by looking at the frequency polygon, the value of the
variable under the peak is the midpoint of the class with the highest
frequency.
\example{For the previous data:
\[\mbox{mode}=\frac{\$25.00+\$35.00}{2}=\$30.00\ .\]
}
\subsection{The Arithmetic Mean Of Grouped Data}

By examining the frequency polygon, the point plotted for a class is at
the midpoint of the class.  In calculating the mean, the assumption is
made that the values in the class are concentrated at the midpoint of
the class.  An approximation to the mean can be found by replacing the
interval by the midpoint and proceeding to do the calculation as it was
done for ungrouped summary tables.\reading{Textbook page 64}

\example{Here is the calculation table for the previous data:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
 \X (\$)  &  \f & \f\X (\$) \\\hline
 10.00& ~5& ~50.00\\
 20.00& ~8& 160.00\\
 30.00& 12& 360.00\\
 40.00& ~6& 240.00\\
 50.00& ~5& 250.00\\
 60.00& ~4& 240.00\\\hline
 & $\sum\f = 40$ & $\sum\f\X = 1300.00$\\\hline
\end{tabular}
~~~~~\begin{minipage}{3in}
Approximate arithmetic mean:  
\[\boxed{\smean=\frac{\sum\f\X}{\sum\f}}= \frac{\$1300.00}{40} = \$32.50\]
\end{minipage}
\end{center}
}

\subsection{\label{subsec:mediangrouped}The Median Of Grouped Data}

The median is that value in the data array located exactly in the
middle of an ordered array.  If the ogive curve is available, the
median can be approximated by locating the value of the variable
corresponding to the .5 mark (50\%) on the \lcr\ axis.  (Equivalently,
as can be seen on the ogive, this corresponds to the point
$\frac{1}{2}\sum\f$ on the \lcf\ axis.) 
\begin{center}
\begin{asy}
import graph;
import stats;
size(300,150,IgnoreAspect);
real[] bins={5,15,25,35,45,55,65};
real[] cumulative={0,5,13,25,31,36,40};
real[] myticks={0,.25,.50,.75,1};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Value}(\$)$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Ticks=bins));
yaxis("",Left,RightTicks(trailingzero));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,5,65),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks(Ticks=myticks));
    yequals(pic,.5,xmin=30.83,xmax=65,dashed);
    xequals(pic,30.83,ymin=0,ymax=.5,dashed);
  });
label(q,"$\frac{1}{2}\sum\f=$",Scale(q,(-5.4,.53)),black);
label(q,"$\sum\f=$",Scale(q,(-5,1.03)),black);
label(q,"$\lcf$",Scale(q,(-5,.78)),black);
add(q);
label(shift(5mm*N)*"~~~~~~~Cumulative Frequency Versus Hard Drive Value",point(N));
\end{asy}
\end{center}
 Graphically we see that the median for the previous data is
 approximately \$31.00. If a more precise scale were available the
 median would be found to be \$30.83.

If the ogive curve is not available, the median can be approximated by
interpolating from the frequency distribution.
\example{Find the median for the previous grouped frequency distribution.}{%
\textbf{First}, find the position of the median:
\[\boxed{\mbox{Median Position}=\frac{1}{2}\left(\sum\f\right)}
=\frac{1}{2}\left(40\right)=20^{th}\]

* A common error is to find $\frac{1}{2}\left(\sum\f+1\right)$ as was
done for ungrouped data.  This is not done here because the horizontal
line on the ogive curve meets the left axis at $\frac{1}{2}\sum\f$.

\begin{center}
\begin{tabular}{c}
\\
\\
\\
Median Class~$\longrightarrow$\\
\\
\\
\\
\\
\end{tabular}
\begin{tabular}{|c|c|c|}\hline
 Value (\$) &\f & \lcf \\\hline
 ~5.00 - 15.00& ~5& ~5\\
 15.00 - 25.00& ~8& 13\\\hline\hline
 25.00 - 35.00& 12& 25\\\hline\hline
 35.00 - 45.00& ~6& 31\\
 45.00 - 55.00& ~5& 36\\
 55.00 - 65.00& ~4& 40\\\hline
 & $\sum\f = 40$ & \\\hline
\end{tabular}
\end{center}

\textbf{Second}, find the value of the median.  Go down the
{\textless}Cf column until the first value equal to or exceeding the
location is found. In our case, this is a \lcf\ value of 25.  This
means that the median is located in the third class between \$25.00
and \$35.00. This is called the \textbf{median class}.  Interpolate
within this class:
\[
\begin{array}{c|c}
~~~~~~~~~~~~~~~~~~~~~~\mbox{Variable Value}~~~~~~ & \mbox{Position}~~~~~ \\\hline
\rule{0em}{3em}\$10\left(\begin{array}{c}
\mbox{Median}-\$25\left(\begin{array}{c}\$25\\ \mbox{Median} \end{array}\right.\\ 
~~~~~~~~~~~~~~~~~~~~\$35\end{array}\right. &
\left.\begin{array}{c}
\left.\begin{array}{c}
~~~13 \\
~~~20
\end{array}\right)7\\
\!\!25
\end{array}\right)12
\end{array}
\]

This gives the fractional equation:
\[\frac{\left(\mbox{Median Value}\right)-\$25}{\$10}=\frac{7}{12}\]

Solving for the median:
\[
\mbox{Median Value}=\$25+\frac{7}{12}\cdot
\left(\$10\right)=\$30.83
\]}
Equivalently, here is a formula that
interpolates within the grouped data table once the position is found.
Normally interpolating directly is easier than remembering the terms
of the formula.

\[\boxed{\mbox{Median Value}=L_i+\frac{\left\{\frac{1}{2}\left(\sum
f\right)-\lcf_{i-1}\right\}}{f_{i}}\cdot\cwidth}\]
Where:
\begin{eqnarray*}
i & = & \mbox{number of the median class (here $3^{\mbox{\scriptsize rd}}$)} \\
L_i & = & \mbox{lower limit of the median class (here \$25)} \\
\cwidth & = & \mbox{class width (here $\$35-\$25=\$10$)} \\
\f_i & = &\mbox{frequency of the median class (here 12)} \\
\lcf_{i-1} & = & \mbox{cumulative frequency of the class prior to the median class (here 13)}
\end{eqnarray*}
\assignment{For each case study that is a grouped
  frequency distribution calculate the mode, the median, and the
  arithmetic mean.  Remember F.S.A.R.U. for all calculations.}

\ifthenelse{\boolean{heavy}}{
\section{The Weighted Mean (\Xw)}
Sometimes values in a data array carry more ``importance'' than
others.  In this case the arithmetic mean cannot be computed by simply
adding up all the values and dividing by the number of values.  The
importance of each value must be taken into account when summing.
This is done by weighting the values according to importance before
summing.  The arithmetic mean for a frequency distribution can be
thought of a weighted mean with the frequency being the weight.  The
weighted mean generalizes this concept to other weights as shown in
the following example.

\example{A student wrote 3 tests of various time lengths.  On a
$\frac{1}{2}$ hour test, the score achieved was 62\%.  On a 1 hour
test, the score achieved was 95\%.  On a 3 hour test the score achieved
was 51\%.  What is the student's mean score?

Set up the calculation tabularly with an \X\ column
representing the variable column, i.e. score, and a \W\ column
representing the weight of the variable value.  The weighted mean score
is given by:
\[\boxed{\Xw=\frac{\sum\W\X}{\sum\W}}\]
\reading{Textbook pages 49-51}
\begin{center}
\begin{tabular}{|c|c|c|}\hline
\X(\%) & \W(h) & \W\X (h\%) \\ \hline
51 & 3.0 & 153 \\
62 & 0.5 & ~31 \\
95 & 1.0 & ~95 \\ \hline
 & $\sum\W=4.5$ & $\sum\W\X=279$\\ \hline
\end{tabular}~~$\displaystyle\Xw=\frac{\sum\W\X}{\sum\W}=\frac{279\ \mbox{h\%}}{4.5\ \mbox{h}}=62.00000\%=62.0\%$
\end{center}}

Note:
\begin{itemize}
\item It would not make sense, in this case, to simply
add the three marks and divide by 3.
\item A common error is to mix up the
\X\ and \W\ columns.  Remember the \X\ column is the quantity that is to  be
averaged, i.e. the variable.
\item The units of the weight column, here hours, always cancel in the final result.
\end{itemize}\reading{Exercises pages 51 to 54 textbook}

\newcommand{\weightedanswer}{Weighted Mean:\vspace{.2em}%
\begin{enumerate}[1.]
\item $\Xw=\$2.24$
\item values are unequally represented
\item \$112.00
\end{enumerate}
}
\answer{\protect\weightedanswer}
\assignment{Do the following exercise:

  A lumberyard packages timber studs of different quality into a
  package for retail sale.  50\% of the package contains first grade
  lumber that would sell for \$2.80 per stud.  30\% of the package
  contains construction grade lumber that would sell for \$1.80 per
  stud.  The remainder of the package is utility lumber that would
  sell for \$1.50 per stud.
\begin{enumerate}
\item What is the average value of a stud in the package?
\item Why can the prices not be added up and divided by 3 to give a
meaningful average price?
\item If the package contained 50 studs, what should it sell for?
\end{enumerate}}
}{}
\ifthenelse{\boolean{heavy}}{
\section{The Geometric Mean (\GM)}

Up to this point we have considered data that could be reordered (for
instance ranked) without significant loss of information because the
order has been unimportant.  Such is the case for a repeated
experiment under controlled conditions; the measurements should not
depend on when the experiment is performed.  A \textbf{time series} is
a listing of a data array at specific instances of time where the time
is important.  For example, the amount of bacteria in a culture grows
over time so the hour at which the measurement is made is significant.
Usually the time periods at which the variable is measured are equal.

%If a time series grows so that the \emph{amount of change} between any
%two equal successive time periods is constant, the series is called an
%\textbf{arithmetic series}.  For instance if subsequent measurements
%increased by a fixed \$500 this would be an arithmetic series.  An
%plot of the variable versus time in this case will appear as a
%straight line on regular graph paper. (Both axes are scaled in equal
%intervals.)

If a time series changes such that the \emph{ratio} or \emph{percentage
  change} of the variable between any two equal successive time
periods is constant, the series is called a \textbf{geometric series}.
For instance if a bacteria sample was growing such that subsequent
measurements at one hour time intervals were always 1.2 times the
previous measurement (a constant increase of 20\%) this would be a
geometric series.  A plot of the variable versus time for a geometric
series on semilogarithmic graph paper\footnote{Semilogarithmic graph
  paper has an arithmetic horizontal scale and a logarithmic vertical
  scale.  A logarithmic scale is one where a number goes on the scale
  at distance proportional to the logarithm of the number.  The
  vertical scale starts at some chosen power of ten not at zero
  because the logarithm of zero is not defined.  The distance between
  consecutive powers of ten on a logarithmic axis is referred to as
  one cycle.} is a straight line.

\example{A person earns a salary to do a given job which changes over time as follows:

\begin{tabular}{|c|c|}\hline
Year & Salary on Jan 1 (\$) \\ \hline
1998 & 10,000 \\
1999 & 11,200 \\
2000 & 12,320 \\
2001 & 12,566 \\ \hline
\end{tabular}~~~~~~~~
\begin{minipage}{3.5in}
Clearly the salaries constitute a time series as they show a definite
trend (increasing) in time.  Calculating the factors of increase ($F$)
or equivalently the percent increases we see they are roughly
constant as shown in the next table.
\end{minipage}

\begin{tabular}{|c|c|c|c|}\hline
Year & Salary on Jan 1 (\$) & $F$ & $\%\ \mbox{change}$\\ \hline
1998 & 10,000 & -- & -- \\
1999 & 11,200 & 1.12 & 12\\
2000 & 12,320 & 1.10 & 10\\
2001 & 12,566 & 1.02 & ~2\\ \hline
\end{tabular}~~~~~~~~
\begin{minipage}{2.5in}
Here we used for the factor of increase:
\[F=\frac{\mbox{New Value}}{\mbox{Old Value}}\]
and for the percent change:
\[\%\ \mbox{change}=\frac{\mbox{New Value}-\mbox{Old Value}}{\mbox{Old Value}}\cdot 100\]
\end{minipage}}

Consideration of the $F$ and $\%\ \mbox{change}$ columns show the following useful conversion formulae between them:
\[\boxed{F=1+\frac{\%\ \mbox{change}}{100}}~~~~~~~~~\Leftrightarrow~~~~~~~~\boxed{\%\ \mbox{change}=(F-1)\cdot 100}\]

Now since they are roughly constant, we could consider taking the
arithmetic mean of our factors of increase
($\frac{1.12+1.10+1.02}{3}=1.08$) or equivalently the percent changes
($\frac{12+10+2}{3}=8\%$).  Unfortunately the arithmetic mean does not
give a useful average when applied to a distribution of ratios or \%
values.  To see why, consider what a constant factor of increase of
1.08 (percent increase of 8\%) implies if we start at \$10,000:

\begin{tabular}{|c|c|c|}\hline
Year & Actual Salary on Jan 1 (\$) & Constant 8\% Increase \\ \hline
1999 & 11,200 & 10,800\\
2000 & 12,320 & 11,664\\
2001 & 12,566 & \fbox{12,597}\\ \hline
\end{tabular}
~~~~~\begin{minipage}{2.5in}
\raggedright After three years of increase, the arithmetic mean produces a value
  of the variable (boxed) that differs from the actual variable.
\end{minipage}

The correct average to use in this case is called the
\textbf{geometric mean}.\reading{Textbook pages 45, 52} By design, if
the geometric mean is applied for $n$ time intervals starting with the
initial value, one will arrive at the same final value as the original
data.  The geometric mean assumes a constant factor of increase, F,
across each time period.  To see what value it must have, convert each
annual \% increase to its corresponding factor of increase and place
the figures on the time line below:

\begin{center}
\includegraphics[width=5in]{image2-10.png}
\end{center}

Applying the constant factor $F$ three times should have the same effect as
applying the three variable factors.
\[F\cdot F\cdot F=F_1\cdot F_2\cdot F_3\ \ \mbox{or}\ \ F^3 = F_1 \cdot F_2 \cdot F_3\]
Solve this for $F$:  
\[F=\sqrt[3]{F_1\cdot F_2\cdot F_3}\ .\] In this case\footnote{Note
  that to evaluate the $n^{\mbox{\scriptsize th}}$ root on your calculator you can
  either use the \fbox{$\sqrt[n]{~}$} key or take the exponent to
  (1/n).  For example, for a cube root, raise the number to the power
  (1/3). Parentheses will be required for proper evaluation.}

\[F=\sqrt[3]{1.12\cdot 1.10\cdot 1.02} = 1.0791\ ,\]
which converted to a \% change using our formula above is 7.91\%.
This is the effective average annual \% increase.

Generalizing our work above, a formula, which finds the effective \%
change across $n$ equal time intervals in a time series is:

\[\boxed{\GM=\left[\sqrt[n]{F_1F_2F_3\ldots F_n}-1\right]\cdot 100}\ ,\]

where the $F_i$ values are the variable factors of increase. Make sure
to convert the \% changes to factors of change before substitution using our
above formula.

\example{The annual sea ice minimum in the arctic ocean occurs at the end of each summer.  Scientists have measured the percent change each year in this value from 2000 until 2007 and found the following results:
\[7.4,\ -12.1,\ 5.9,\ 0.0,\ -8.0,\ 4.0,\ -28.8\ (\%)\]
Calculate the \textbf{average percent change per year} in the sea ice
extent over this time period.}{%
\begin{eqnarray*}
\GM & = & \left[\sqrt[n]{F_1F_2F_3\ldots F_n}-1\right]\cdot 100 \\
    & = & \left[\sqrt[7]{F_1F_2F_3F_4F_5F_6F_7}-1\right]\cdot 100 \\
    & = & \left[\sqrt[7]{(1.074)(.879)(1.059)(1.000)(.920)(1.040)(.712)}-1\right]\cdot 100 \\
    & = & \left[-.0533922\right]\cdot 100 \\
    & = & -5.33922\ \%/\mbox{yr} \\
    & = & -5.34\ \%/\mbox{yr}
\end{eqnarray*}
The sea ice extent \textbf{decreased} on average by 5.34\ \%/yr from 2000 to
2007. (Notice the effect of the signs in this problem both in the
conversion to factors and in the interpretation of the answer.)
% Petry created this problem from a graphic found at
% http://www.digitaljournal.com/imag/62822
% which showed the sea ice diminishing over time.
}

Another situation that can arise is when the initial amount and the
final amount of the time series are given.  The problem here is to
find the constant \% change per period required to affect the overall
amount of change.  Returning to our original problem, since the
constant factor of $F$ applied three times to the initial amount
\$10,000 must result in the same final amount \$12,566, one has
\[F^3 (\$10,000) = \$12,566\ \ \mbox{or}\ \  F = \sqrt[3]{\frac{\$12,566}{\$10,000}}=1.0791\]
This converted to a \% change is 7.91\% as before.

A general formula which will calculate the geometric mean in these types of
situations is:

\[\boxed{\GM=\left(\sqrt[n]{\frac{\mbox{Final}}{\mbox{Initial}}}-1\right)\cdot 100}\ .\]

\example{The amount of carbon dioxide in the atmosphere has increased
steadily over the last $45$ years from $315$~ppmv (parts per million
by volume) in 1960 to $380$~ppmv in 2005.  Calculate the
\textbf{average percent change per year} in $CO_2$ over this time period.}{%
\begin{eqnarray*}
\GM & = & \left(\sqrt[n]{\frac{\mbox{Final}}{\mbox{Initial}}}-1\right)\cdot 100\\
    & = & \left(\sqrt[45]{\frac{380\ \mbox{ppmv}}{315\
      \mbox{ppmv}}}-1\right)\cdot 100 \\
    & = & \left(1.00417756-1\right)\cdot 100 \\
    & = & .417756\ \%/\mbox{yr} \\
    & = & .42\ \%/\mbox{yr}
\end{eqnarray*}
$CO_2$ has \textbf{increased} an average of .42\ \%/yr over this time period.}

\newcommand{\geometricmeananswer}{Geometric Mean:%
\begin{enumerate}[1.]
\item 7.60 \%/yr
\item 4.11 \%/yr
\item 4.91 \%/yr
\item 10.07 \%/yr
\item \begin{enumerate}[(a)]
\item not time series
\item the arithmetic mean, 75.6\%
\end{enumerate}
\item 7.46 \%/qtr
\end{enumerate}}
\assignment{\answer{\protect\geometricmeananswer}%
Do the following exercises involving the geometric mean.
\begin{enumerate}
\item A telephone company increased its rates by the following \% values
over the last 7 years:
\[15,  2,  13,  10,  6,  7,  1\]
What is the average annual \% increase in phone rates over the past
seven years?
\item A widget has had the following \% change in prices over the past 4
years.
\[20,  -8,  12, -5\]
What is the average annual \% change in price of the widget? Be
careful when converting \% decreases into factors of change.
\item Mary had a salary of \$13,500 on July 1, 1982.  By July 1, 1988,
her salary had increased to \$18,000.  What is the average annual \%
increase in salary that Mary has had over this time period?
\item The population of Averageville was 5800 on January 1, 1980.  It
has experienced a rapid growth in the last 8 years.  On January 1, 1988
the population was 12,500.  What is the average annual \% increase in
population over this time period?
\item Five students wrote an exam.  Their marks were (\%):
\[56,  89,  76,  98,  59\]
\begin{enumerate}
\item Should the geometric mean be used to find the average
score in \% obtained by the students?  Explain.
\item What average score in \% should be reported for the students? 
\end{enumerate}
\item Sales at Ajax Company were \$45,000,000 last year.  If total sales
for this year are expected to be \$60,000,000, what is the average \%
increase per quarter expected to be?
\end{enumerate}
}
}{}

\section{Measuring Dispersion in a Distribution}
\label{sec:dispersion}
\subsection{The Range as a Measure of Dispersion}
Recall that variability is the basis for all statistical analysis.  Data
arrays have a tendency to cluster around some central value called an
average.  The usefulness of this average as a representative depends
upon the strength of this tendency to cluster.  If many of the data
values are spread out a long distance from centre, then the average is
a poor representative of the distribution. The tendency for values in
the data array to be spread or dispersed from the average is measured
in several ways.

\begin{center}
\includegraphics[width=6in]{image2-6.png}
\end{center}

In the above diagrams note:
\begin{itemize}
\item There is more variation in distribution 1 than in 2.
\item The range ($\X_n-\X_1$) of distribution 1 is larger than in 2.
\end{itemize}

\begin{center}
\includegraphics[width=6in]{image2-7.png}
\end{center}

In the above diagrams note:
\begin{itemize}
\item There is more variation in distribution 3 than in 4.
\item The ranges of the distribution are equal.
\end{itemize}
In conclusion, variation can be measured absolutely by comparing
ranges or it can be measured by the amount of variation within the
range.  Often the latter is of greater value, and, as shown in the
second set of figures the range then is a coarse and often misleading
measure of dispersion because of its sensitivity to outliers and its
insensitivity to the internal frequency distribution.

\subsection{The Difference from the Mean}
When measuring the amount of variation within a range, statisticians
measure the dispersion from the centre. The arithmetic mean (\pmean\
or \smean) is used as this central point.  The mathematical properties
of the mean must be taken into account when computing this measure.

As a first attempt for measuring the dispersion of a distribution one
might consider calculate the \emph{difference from the mean},
$\X-\pmean$, for each data value and taking the average of them
($\frac{\sum(\X-\pmean)}{\np}$).  Calculating this for the population
data (kg) 20, 30, 35, 41 produces:

\begin{center}
\begin{tabular}{|c|c|}\hline
\X (kg) & $\X-\pmean$ (kg)\\\hline
20 & -14 \\
30 & ~-4 \\
35 & ~~1 \\
51 & ~17 \\ \hline
$\sum\X=136$ & $\sum(\X-\pmean)=0$ \\\hline
\end{tabular}
\end{center}
Here, before tabulating the second column, we had to first calculate the mean:
\[\pmean=\frac{\sum\X}{\np}=\frac{136\ \mbox{kg}}{4}=34.000000\ \mbox{kg}=34.0\ \mbox{kg}\ .\]

One finds that the sum of the difference $\X-\pmean$ is found to be
zero.  The reason this sum is zero is because the mean is the balance
point of the data and one can prove\footnote{Proof:
  $\sum(\X-\pmean)=\sum\X-\sum\pmean=\sum\X-\pmean\sum
  1=\sum\X-\frac{\sum\X}{\np}\cdot\np=\sum\X-\sum\X=0$} that it is always true that
\[\sum(\X-\pmean)=0\ .\]
The sum of the negative differences and the positive differences is
zero. Because differences from the mean sum to zero, the average difference
from the mean will always be zero no matter how close or how far the
individual values are spread from centre.

For this reason, the average deviation is not calculated by averaging
these differences.

Statisticians make the deviations from the mean
positive in one of two ways:
\begin{enumerate}
\item Take the absolute value of the differences (that is take the
  \emph{distance} from the mean) and compute the average of these
  deviations.
\item Square these differences and compute the average squared value.
\end{enumerate}

\subsection{The Average Deviation (\adev)}
A measure of dispersion called the \textbf{Average Deviation} is
calculated by averaging the \textbf{absolute value} of the difference
(the distance) from the mean.
\[\begin{array}{ccc}
\displaystyle \boxed{\adev=\frac{\sum\left|\X-\smean\right|}{\ns}} &
~~~\mbox{or}~~~ &
\displaystyle \boxed{\adev=\frac{\sum\left|\X-\pmean\right|}{\np}} 
\end{array}\]

The units on this measurement are the same as that of the variable.
The only significance of the average deviation is its size.  The
smaller the value, the more closely are the numbers grouped around the
mean within the range of observations. The average deviation is not
used for statistical inference purposes so its use is limited to a
descriptive measure.\footnote{The reason the average deviation is not
  used much in statistics is that the presence of the absolute
  value $|~|$ in the definition makes it mathematically unpleasant.
  For one thing the derivative of the absolute value function $|x|$ at
  $x=0$ is discontinuous.}

\example{Calculate the average deviation for the previous data.}{%
\begin{center}
\begin{tabular}{|c|c|c|}\hline
\X (kg) & $\X-\pmean$ (kg) & $|\X-\pmean|$ (kg) \\\hline
20 & -14 & 14\\
30 & ~-4 & ~4\\
35 & ~~1 & ~1\\
51 & ~17 & 17\\ \hline
$\sum\X=136$ & *Do not sum & $\sum|\X-\pmean|=36$ \\\hline
\end{tabular}
\end{center}

\[
\adev=\frac{\sum\left|\X-\pmean\right|}{\np}=\frac{36~\mbox{kg}}{4}=9.000000\ \mbox{kg}=9.0\ \mbox{kg}
\]
Statistically this means that we should see the majority of the
observations within 9.0 kg of centre (the mean).}

\subsection{The Population Variance (\pvar) and Standard Deviation (\pdev)}
A measure of dispersion called the \textbf{Variance} is calculated by
averaging the \textbf{squared deviations} from the mean. For a
\emph{population}:\footnote{We will see that the variance and standard
  deviation for a sample have different formulae than the population
  formula.}
\[
\boxed{\pvar=\frac{\sum\left(\X-\pmean\right)^{2}}{\np}}
\]
The symbol for the variance for a population data array is the Greek letter lower case sigma,
\pdev, with an exponent 2.

\example{Calculate the variance for the previous population.}{%
\begin{center}
\begin{tabular}{|c|c|c|}\hline
\X (kg) & $\X-\pmean$ (kg) & $\left(\X-\pmean\right)^2$ ($\mbox{kg}^2$) \\\hline
20 & -14 &196\\
30 & ~-4 &~16\\
35 & ~~1 &~~1\\
51 & ~17 &289\\ \hline
$\sum\X=136$ & *Do not sum & $\sum\left(\X-\pmean\right)^2=502$ \\\hline
\end{tabular}
\end{center}

\[
\pvar=\frac{\sum\left(\X-\pmean\right)^2}{\np}=\frac{502~\left(\mbox{kg}^2\right)}{4}=125.5\ \left(\mbox{kg}^2\right)
\]
Statistically, this is a bit difficult to interpret at this point, but
think about this value as a measure of the variability of the numbers
within their range.}

As the example shows, the units on the variance will be in units of
the \textbf{variable squared}.  This, compared to the average
deviation, is a serious drawback since one cannot say that the
majority of measurements are some fraction of variance away from the
mean.  The fact that the variance has square units of the variable
means that one cannot create such an interval directly from the
variance.  However, one still may compare the variance of two
comparable sets of data to see which one has greater dispersion.


To place the units on this measure into the same value as the variable
we take the square root.  This quantity is called the \textbf{standard
deviation}.  Its symbol for a population is lower case sigma without
the square:
\[
\boxed{\pdev=\sqrt{\frac{\sum\left(\X-\pmean\right)^{2}}{\np}}}
\]
Now, as with the average deviation, one expects the majority of measured
values to lie within one standard deviation from the mean.

\example{Calculate the standard deviation of the above data.}{%
\[
\pdev=\sqrt{\frac{\sum\left(\X-\pmean\right)^2}{\np}}=\sqrt{\frac{502~\left(\mbox{kg}^2\right)}{4}}=11.2026\
\mbox{kg}=11.2\ \mbox{kg}
\]
This also means that statistically we should see the majority of the
observations within 11.2 kg of centre (the mean).}

\subsection*{Significance Of The Two Measures Of Dispersion}
Note that the size of the standard deviation found in the example
(11.2 kg) is roughly the same as that of the average deviation (9.0
kg).  This, coupled with its preferable mathematical properties, means
the standard deviation is the preferred measure of dispersion.  We
will only calculate the average deviation for data presented in raw
format.

Because of the mathematical properties of the mean, the variance and
standard deviation are more important. These two measures are found in
theoretical distribution curves from which statistical inferences are
drawn.

\subsection*{Statistical Keys On The Calculator}

Recall the procedure for summing data using the statistical keys on
the calculator in Section~\ref{sec:summing}.  To find the standard
deviation, the data is keyed into the calculator in the same way as
was done there.  Locate the key on your calculator that finds the
population standard deviation. The population standard deviation often
has an $n$ in the symbol, such as $\pdev_n$, which reflects the \np\
that appears in the denominator of the formula.  Other calculators
have a population mode which must be set before selecting the standard
deviation to ensure the proper formula is being used.  There is no key
that finds average deviation.

After entering all the data values, the standard deviation for a
population can be found by pushing this key.  Try it for the previous
example. Once you have the standard deviation on your display, the
variance can be found by pushing the key that squares data if there is
no separate key for it on your calculator. Report your answer to one
place more precision than is found in the data set.

\assignment{For each case study that is raw data calculate the
  average deviation.  For raw data which is also population data
  calculate the standard deviation and variance.  Remember F.S.A.R.U.
  Check the standard deviation results on your calculator.}

\section{Computing the Standard Deviation}

\subsection{The Computing Formula for Pop. Variance and Standard Deviation}
\label{subsec:popcomputingformula}

It can be proven, by expanding $(\X - \pmean)^2$
algebraically,\footnote{%
  One has $\sum\left(\X -\pmean\right)^2 =
  \sum\left(\X^2-2\pmean\X+\pmean^2\right) = \sum\X^2-2\pmean\sum X
  +\pmean^2\sum 1 = \sum\X^2-2\pmean(N\pmean)+\pmean^2(N) =\sum\X^2 -
  N\pmean^2$, where we used that $\pmean=\frac{\sum\X}{\np}$ is
  constant and can be pulled out of the two sums.} that
\[\sum\left(\X -\pmean\right)^2 = \sum\X^2 - N\pmean^2\]
This leads to a mathematically equivalent method for computing the
variance and standard deviation that has certain advantages over using
the formula based on the definition.  The new formula is called the
\textbf{computing formula}.  (The previous formula will be referred to
as the \textbf{definitional formula})

Replace $\sum(\X - \pmean)^2$ by $\sum\X^2 - N\pmean^2$ in the
variance formula $\pvar=\frac{\sum\left(\X-\pmean\right)^{2}}{\np}$:
\[
\pvar=\frac{\sum\X^2-\np\pmean^2}{N}=\frac{\sum\X^2}{\np}-\pmean^2=\frac{\sum\X^2}{\np}-\left[\frac{\sum\X}{\np}\right]^2
\]
The computing formula for population variance for raw data is therefore:
\[
\boxed{\pvar=\frac{\sum\X^2}{\np}-\left[\frac{\sum\X}{\np}\right]^2}
\]
Taking the square root gives the computing formula for population standard deviation:
\[
\boxed{\pdev=\sqrt{\frac{\sum\X^2}{\np}-\left[\frac{\sum\X}{\np}\right]^2}}
\]
\example{Using the example from Section~\ref{sec:dispersion}, compute
the standard deviation by the computing formula. Show that the answer
is identical to that obtained by the definitional formula.}{%
\begin{center}
\begin{tabular}{|c|c|}\hline
\X (kg) & $\X^2$ ($\mbox{kg}^2$) \\\hline
20 & ~400\\
30 & ~900\\
35 & 1225\\
51 & 2601\\ \hline
$\sum\X=136$ & $\sum\X^2=5126$ \\\hline
\end{tabular}
\end{center}
\begin{eqnarray*}
\pdev & = & \sqrt{\frac{\sum\X^2}{\np}-\left[\frac{\sum\X}{\np}\right]^2}
=\sqrt{\frac{5126\ \left(\mbox{kg}^2\right)}{4}-\left[\frac{136\ \mbox{kg}}{4}\right]^2}
=\sqrt{1281.5\ \left(\mbox{kg}^2\right)-(34\ \mbox{kg})^2}\\
& = & \sqrt{125.5\ \left(\mbox{kg}^2\right)}=11.2\ \mbox{kg}\ ,
\end{eqnarray*}
the same value as was obtained by the formula based on the definition.}

*Note that the summation $\sum\X^2$ appearing in the computing formulae
requires calculation of the data values squared followed by their
summation.  It is \textbf{not} equal to $(\sum\X)^2$, i.e. the
summation of the variable values followed by squaring.

In statistical analysis, you will find both the definitional and
computational formulae used to compute~\pdev. The definitional formula
is often used if the mean works out to be an integer value producing a
difference that is easily squared.  The computational formula lessens
the number of calculations and allows for easier adjustments if more
data points are added to the data array.  You should be able to use
both formulae.

\subsection{The Standard Deviation of Population Frequency Distributions}
\label{subsec:popdev}
The most effective way of calculating the standard deviation and
variance of a frequency table is by the computing formulae.  The
various quantities that appear in the raw data formulae and their
equivalents in a frequency distribution are given in the following
table:
\begin{center}  
\begin{tabular}{|c|c|c|}\hline
Quantity & Raw Data & Frequency Distribution \\\hline
number of observations & \np & $\sum\f$ \\
sum of observations & $\sum\X$ & $\sum\f\X$ \\
sum of squares of observations & $\sum\X^2$ & $\sum\f\X^2$ \\\hline
\end{tabular}
\end{center}

If the raw data symbols are replaced with their frequency distribution
counterparts in the computing formula, it takes the following form
for the \textbf{population variance}:
\[
\boxed{\pvar=\frac{\sum\f\X^2}{\sum\f}-\left[\frac{\sum\f\X}{\sum\f}\right]^2}
\]
The computing formula for \textbf{population standard deviation} for a
frequency distribution is similarly:
\[
\boxed{\pdev=\sqrt{\frac{\sum\f\X^2}{\sum\f}-\left[\frac{\sum\f\X}{\sum\f}\right]^2}}
\]
If the data are ungrouped, the \X\ values are the values of the
variable listed in the table.  If the data are grouped data the \X\ values
are the \textbf{class midpoints}.

\example{Suppose all 100 households of a community were surveyed.  It
was found the number of rooms per household was distributed as
follows.  Calculate the standard deviation and variance.}{%
\begin{center}
\begin{tabular}{|c|c|c|c|}\hline
 \X (rooms) & \f & \f\X (rooms) & $\f\X^2$ ($\mbox{rooms}^2$)\\\hline
 ~1& ~2& ~~2& ~~2\\
 ~2& 15& ~30& ~60\\
 ~3& 20& ~60& 180\\
 ~4& 40& 160& 640\\
 ~5& 20& 100& 500\\
 ~8& ~2& ~16& 128\\
 12& ~1& ~12& 144\\\hline
 & $\sum\f = 100$ & $\sum\f\X= 380$ & $\sum\f\X^2 = 1654$\\\hline
\end{tabular}
\end{center}
The standard deviation is: 
\begin{eqnarray*}
\pdev & = & \sqrt{\frac{\sum\f\X^2}{\sum\f}-\left[\frac{\sum\f\X}{\sum\f}\right]^2}
=\sqrt{\frac{1654\ \left(\mbox{rooms}^2\right)}{100}-\left[\frac{380\ \mbox{rooms}}{100}\right]^2}\\
& = & \sqrt{2.1\ \left(\mbox{rooms}^2\right)}=1.44913\ \mbox{rooms}\\
& = & 1.4\ \mbox{rooms}
\end{eqnarray*}
The variance is just the square of this value (the last term under the square root):
\[\pvar=2.1\ \left(\mbox{rooms}^2\right)\]}

*Note that the $\f\X^2$ column is \textbf{not} the square of the
preceding $\f\X$ column since the frequency is not squared
(i.e. $\f\X^2\neq(\f\X)^2=\f^2\X^2$).  Some students may wish to add an $\X^2$
column to the table to facilitate the calculation of $\f\X^2$.

Since the population mean is
$\pmean=\frac{\sum{\f\X}}{\sum\f}=3.8\ \mbox{rooms}$, it may be
observed that the majority of observations really do fall between
$\pmean-\pdev=2.4\ \mbox{rooms}$ and $\pmean+\pdev=5.2\ \mbox{rooms}$.

It is possible to calculate the standard deviation and variance by the
formula based on the definition in frequency tables but because of the
number of arithmetic operations required we will always use the
computational formula for frequency distributions.

\subsection*{Statistical Keys on the Calculator}
As seen in Section~\ref{sec:summing}, the summation of data values can
be found by using the $\sum\X$ function on the calculator after keying
in data.  Statistical calculators similarly have a key for obtaining
the sum of the squares of the data, $\sum\X^2$, which can be used to
check tabular results.  Remember that frequency distribution data may
be entered on a calculator as discussed in Section~\ref{sec:summing}.
In that case the $n$, $\sum\X$, and $\sum\X^2$ calculator keys will
generate the results for $\sum\f$, $\sum\f\X$, and $\sum\f\X^2$
respectively.
\clearpage
\newcommand{\computingstddevanswer}{\begin{enumerate}
\item See individual case study answers.
\item $\pmean=2.6\ \mbox{points}$, $\pdev=2.2\ \mbox{points}$, $\pvar=4.9\ \mbox{points}^2$
\end{enumerate}}
\assignment{\answer{\protect\computingstddevanswer}%
\begin{enumerate}
\item For each case study that is population data
  (including recalculating the result for raw data) calculate the
  standard deviation and variance using the computational
  formulae.  Remember F.S.A.R.U.  Check your results using the
  calculator.
\item The following diagram shows the setup of a chess board.  Because
  of the ways the pieces move, all pieces are not created equal!  If
  Pawns (\sympawn) are worth 1~point, then Bishops (\symbishop ) and
  Knights (\symknight) are worth roughly 3~points, Rooks (\symrook)
  are 5~points, and Queens (\symqueen) are worth 9~points.  The Kings
  (\symking) have infinite value because if you lose your king you
  lose the game!

\newgame
\centerline{\smallboard\showboard}
\noindent Create an ungrouped frequency distribution for the
\textbf{value} of the chess pieces (excluding the kings) at the start
of the game. Calculate its mean, standard deviation and variance.
(Use the computational formula.) Sketch the histogram and see that
your values make sense.  Check your work on your calculator.\newline
\begin{tabular}{|c|c|c|c|c|}\hline
\rule{0em}{4em}\rule{3em}{0em} & \rule{3em}{0em} & \rule{3em}{0em} & \rule{3em}{0em} & \rule{3em}{0em} \\ \hline\hline
\rule{0em}{3em} & & & & \\ \hline
\rule{0em}{3em} & & & & \\ \hline
\rule{0em}{3em} & & & & \\ \hline
\rule{0em}{3em} & & & & \\ \hline\hline
\rule{0em}{4em} & & & & \\
\hline
\end{tabular}
\end{enumerate}

\vspace{1in}}

\section{Sample Standard Deviation (\sdev) and Variance (\svar)}
The purpose of sampling is to make inferences about a population.
Statistical descriptors of a population are called \textbf{parameters}.  The
calculated values found using sample data for the purpose of drawing
inferences about population parameters are called \textbf{statistics}.

%The following diagram is rather kludgy.  I used the picture environment
%only so I could get a circle.  Notice that the pict2e package has to be
%included so that the circle size can be large enough.  Ultimately this
%diagram will likely break if I change font size. 
\begin{center}
\begin{picture}(300,100)
\put(0,0){
\framebox(300,100){
\begin{tabular}{cc}
\rule[-4em]{0em}{8em}\begin{tabular}{c}
$\left.\begin{array}{l}
\smean \\
\svar \\
\sdev
\end{array}\right\}\mbox{Statistics}$ \\
\ns
\end{tabular}~~~~~~~~~~~~~~~~
&\begin{tabular}{c}
$\left.\begin{array}{l}
\pmean \\
\pvar \\
\pdev
\end{array}\right\}\mbox{Parameters}$ \\
\np
\end{tabular}
\end{tabular}
}
}
\put(80,50){\circle{90}}
\end{picture}
\end{center}

Because population data is usually inaccessible, the population values
exist in theory but are not available in practice. Their values must
be inferred from sample information. Letters of the Greek alphabet are
reserved for parameters in statistical analysis to reflect the fact
that they are theoretical values.

\subsection{Sample Standard Deviation by the Definitional Formula}
When estimating a population mean, \pmean, the best available estimate
is the sample mean, \smean.  As may be shown, this is because the
average value of all possible sample means is \pmean.  Recall that
there is no difference in the procedure for computing the sample
statistic, \smean, or the population parameter, \pmean.  This is not
the case with the \textbf{sample variance}, \svar.  If the sample
variance is calculated by the same procedure as the population
variance, the sample variance is not the best estimator of the
population variance.  $\sum\left(\X-\smean\right)^2$ tends to
underestimate $\sum\left(\X - \pmean\right)^2$, on the average, in the
variance formula.  This places the numerator in the variance formula
too low.  To correct this, the denominator is reduced by 1.  The best
available estimate of \pvar\ is \svar\ calculated by the
\textbf{definitional formula for sample variance}:
\[\boxed{\svar=\frac{\sum\left(\X-\smean\right)^2}{\ns-1}}\] 
The \textbf{definitional formula for sample standard deviation} is its square root:
\[\boxed{\sdev=\sqrt{\frac{\sum\left(\X-\smean\right)^2}{\ns-1}}}\] 

As with populations, we will only use the sample definitional formula
with raw data in this course.

\example{Calculate the standard deviation and variance of the stellar
distances of the Andromeda Nebula in the example from
Section~\ref{subsubsec:meanraw}. Use the definitional formula.}{%
Continuing with our previous table we have:
\begin{center}
\begin{tabular}{|c|c|c|}\hline
Distance (Mly) & $\left(\X-\smean\right)$ (Mly) & $\left(\X-\smean\right)^2$ ($\mbox{Mly}^2$)\\\hline
2.4 & -.12 &.0144\\
2.4 & -.12 &.0144\\
2.5 & -.02 &.0004\\
2.6 & ~.08 &.0064\\
2.7 & ~.18 &.0324\\\hline
$\sum\X=12.6$&&$\sum\left(\X-\smean\right)^2=.068$\\\hline 
\end{tabular}
\end{center}

Here we required our sample mean from before:
\[\smean=\frac{\sum\X}{\ns}=\frac{12.6\ \mbox{Mly}}{5}=2.52\ \mbox{Mly}\]
The sample variance is:
\[\svar=\frac{\sum\left(\X-\smean\right)^2}{\ns-1}
=\frac{.068\ (\mbox{Mly}^2)}{5-1}=.017\ (\mbox{Mly}^2)\]
The sample standard deviation is its square root: 
\[\sdev=\sqrt{\frac{\sum\left(\X-\smean\right)^2}{\ns-1}}
=\sqrt{\frac{.068\ (\mbox{Mly}^2)}{5-1}}=.130384\ \mbox{Mly}=.13\
\mbox{Mly}\] Check that the standard deviation is reasonable with
respect to the data.  Does a standard deviation of $\sdev=.13\
\mbox{Mly}$ in the distance to the stars tell you anything useful
physically about the Andromeda Nebula?
% Given that it is the range to the stars, this gives a measure of
% the depth of the galaxy along the line of site.  Assuming it is
% spherically symmetric (which it isn't - it is a spiral disk at an
% angle), this gives an estimate of the size of the galaxy.  Optically
% one can see that the Andromeda Nebula subtends about three degrees
% in the sky, which, given the distance of 2.52 Mly gives a diameter
% of .13 Mly which shows the order of magnitude estimate is correct.
% Note one would also have to argue that the error was not due to the
% experimental error in measuring the distance, but this is at most
% .05 Mly given my roundoff, which was simply chosen so I could get
% two decimals for my mean and standard deviation.  The real data
% and an estimate using 100s of stars can be found online in the tract
% "The Distance to Andromeda" by Florian Freistetter, ARI Heidelberg.
% There he does the calculation using software and a real stellar database.
% He gets an answer of 2.52+/-.14 Mly upon which this data was fabricated
% by Petry.
}

\subsection{Sample Standard Deviation By the Computing Formula}
Similar to the discussion in Section~\ref{subsec:popcomputingformula}, a
mathematical equivalent to $\sum\left(\X-\smean\right)^2$ is $\sum
\X^2-\ns\smean^2$.  If this is substituted into the definitional
formula, the \textbf{computing formula for sample (raw) data standard deviation} results:
\[\boxed{\sdev=\sqrt{\frac{\sum\X^2-\frac{\left(\sum\X\right)^2}{\ns}}{\ns-1}}}\]
The computing formula for the sample variance \svar\ is just the
expression under the root sign.

\example{Compute the standard deviation and variance for the previous
sample using the computational formula.}{%
\begin{center}
\begin{tabular}{|c|c|}\hline
Distance (Mly) & $\X^2$ ($\mbox{Mly}^2$)\\\hline
2.4 & 5.76\\
2.4 & 5.76\\
2.5 & 6.25\\
2.6 & 6.76\\
2.7 & 7.29\\\hline
$\sum\X=12.6$ & $\sum\X^2=31.82$\\\hline 
\end{tabular}
\end{center}
The sample standard deviation is:
\[\sdev=\sqrt{\frac{\sum\X^2-\frac{\left(\sum\X\right)^2}{\ns}}{\ns-1}}
=\sqrt{\frac{31.82\ (\mbox{Mly}^2)-\frac{\left(12.6\ \mbox{\scriptsize Mly}\right)^2}{5}}{5-1}}
=\sqrt{.017\ (\mbox{Mly}^2)}=.130384\ \mbox{Mly}=.13\ \mbox{Mly}\]
The sample variance is just the square of this value:
\[\svar=.017\ (\mbox{Mly}^2)\]}

If the sample data is from a \textbf{frequency distribution} the sums
must be adjusted to reflect the frequency of occurrence of the listed
data values as was done in Section~\ref{subsec:popdev}. The
\textbf{computing formula} for the \textbf{standard deviation of a
  frequency distribution of sample data} is:
\[\boxed{\sdev=\sqrt{\frac{\sum\f\X^2-\frac{\left(\sum\f\X\right)^2}{\sum\f}}{\sum\f-1}}}\]
The formula for the sample variance \svar\ is the same without the square root.

\example{A random sample of household appliances showed the following
power consumption while nominally switched ``off''.  Calculate the
standard deviation and variance of these \emph{phantom} electrical
power losses.
\begin{center}
\begin{tabular}{|c|c|c|c|c|}\hline
Power Consumption (Watts) & \# of appliances & \X (Watts) & \f\X (Watts)& $\f\X^2$ $\left(\mbox{Watts}^2\right)$\\\hline
0~-\;~2 & 16 & 1 & 16 & ~16 \\
2~-\;~4 & ~4 & 3 & 12 & ~36 \\
4~-\;~6 & ~6 & 5 & 30 & 150 \\
6~-\;~8 & ~2 & 7 & 14 & ~98 \\
8~-\;10 & ~2 & 9 & 18 & 162 \\ \hline
& $\sum\f=30$ & & $\sum\f\X=90$ & $\sum\f\X^2=462$ \\\hline 
\end{tabular}
\end{center}
The sample standard deviation is
\begin{eqnarray*}
\sdev & = & \sqrt{\frac{\sum\f\X^2-\frac{\left(\sum\f\X\right)^2}{\sum\f}}{\sum\f-1}}
=\sqrt{\frac{462\ \left(\mbox{Watts}^2\right)-\frac{\left(90\ \mbox{\scriptsize Watts}\right)^2}{30}}{30-1}}
=\sqrt{\frac{192\ \left(\mbox{Watts}^2\right)}{29}}\\
& = & \sqrt{6.62068\ \left(\mbox{Watts}^2\right)}=2.573\ \mbox{Watts}\\
& = & 2.6\ \mbox{Watts}
\end{eqnarray*}
The sample variance is just the square of this value:
\[\svar=6.62068\ \left(\mbox{Watts}^2\right)=6.6\ \left(\mbox{Watts}^2\right)\]
If one mistakenly thought this were population data, one would have
found a standard deviation of $\pdev=2.5$ Watts versus the true value
of $\sdev=2.6$ Watts.  This reflects the fact that for a large sample
(here 30) the difference between the two values diminishes.}

\subsection*{Statistical Keys on the Calculator}
Locate the two keys that calculate standard deviation on your
calculator.  On some calculators the keys are distinguished by
$\sigma$ (or $\sigma_x$) for population data and $s$ (or $s_x$) for
sample data.  On other calculators since the population standard
deviation uses the denominator \np\ in its procedure while the sample
standard deviation uses the denominator $\ns-1$ in its procedure the
keys may be distinguished by the subscript and look like $\sigma_n$
and $\sigma_{n-1}$ respectively.  Other calculators will have the user
select a population or sample mode before data entry so the correct
formula is applied when standard deviation is selected.  Finally other
calculators may have one select the procedure from a menu of options.
Once you have figured out how your calculator does the calculation,
confirm the text examples done with it.

\assignment{For each case study that is raw sample data,
  calculate the standard deviation and variance using the definitional
  formula.  For each case study that is sample data (including
  recalculating the result for raw data) calculate the standard
  deviation and variance using the computational formulae.  Remember
  F.S.A.R.U.  Check your results using the calculator.}

\ifthenelse{\boolean{heavy}}{
\section{Uses of the Standard Deviation}

The standard deviation is a key measure of dispersion in a distribution
because it is useful in describing and analyzing many different
properties of a data array.

\subsection{Chebyshev's Theorem}
As we have seen, the arithmetic mean is a measure of the centre of the
data so data lies on either side of the mean.  How close is the data
to the mean?  Chebyshev's theorem gives us a measure of the amount of
data near the mean measured in units of the standard deviation.

\textbf{Chebyshev's Theorem:} \emph{The fraction of any data set that lies
within $k$ standard deviations of the mean is at least
$\displaystyle\boxed{1-\frac{1}{k^2}}$ where $k$ is any number greater than
$1$.}

According to the theorem within $k=\sqrt{2}\approx 1.41$ standard deviations of the mean there is at least
\[1-\frac{1}{(\sqrt{2})^2}=1-\frac{1}{2}=.50=50\%\] of all the data
elements. Within $k=2$ standard deviations of the mean there is at
least $1-\frac{1}{2^2}=\frac{3}{4}=.75=75\%$ of all the data elements.
Similarly within $k=3$, $k=4$, and $k=10$ standard deviations one must
have at least $\frac{8}{9}=89\%$, $\frac{15}{16}=94\%$, and
$\frac{99}{100}=99\%$ of all the data values respectively.

\example{Astronomers estimate that the population of stars in our
Milky Way galaxy have distances~(\X) from galactic centre (in
thousands of light-years) having arithmetic mean $\smean=13\
\mbox{kly}$ and standard deviation of $\sdev=9\ \mbox{kly}$.
According to Chebyshev's Theorem using $k=1.41$ at least 50\% of the
stars must have distances to the centre of the galaxy between
\[\smean-k\sdev=13-(1.41)(9)=.3\ \mbox{kly}\]
 and
\[\smean+k\sdev=13+(1.41)(9)=25.7\ \mbox{kly}\ .\]
For $k=2$ one has at least 75\% of stellar distances lying between
$\smean-k\sdev=13-2(9)=-5\ \mbox{kly}$ and $\smean+k\sdev=13+2(9)=31\
\mbox{kly}$.  (Since our variable \X\ is a distance, this can only
take on positive values so this means at least 75\% of galaxy stars
are less than $31\ \mbox{kly}$ from the galactic centre.)}
   
\clearpage
\subsection{Standard Score (\Z)}

The \textbf{standard score} or \textbf{\Z\ value} measures the distance
that an observation is from the mean in units of standard deviations.
\[\boxed{\Z = \frac{\X-\pmean}{\pdev}}\ \leftarrow\ \mbox{For a population, or}\ \ 
\boxed{\Z = \frac{\X-\smean}{\sdev}}\ \leftarrow\ \mbox{For a
  sample}\] The \textbf{sign} of the standard score indicates whether
the data element lies above ($\Z>0$) or below ($\Z<0$) the mean.

Chebyshev's Theorem allows us to conclude, based on the \textbf{magnitude} of
\Z\, how far the observation lies away from the mean:\footnote{The terms used here (slight, moderate, extreme) are subjective in nature, but will be used in this course.  Quoting the actual \Z\ value is unambiguous.}
\begin{compactitem}%Used compactitem to squeeze in more space
\item $|\Z|\approx 0$: \X\ is \textbf{approximately equal} to the mean
\item $|\Z|\approx 1$: \X\ is \textbf{slightly} removed from the mean
\item $|\Z|\approx 2$: \X\ is \textbf{moderately} removed from the mean
\item $|\Z|\gtrsim 3$: \X\ is \textbf{extremely} removed from the mean
\end{compactitem}

\example{Continuing our previous example, if stars are distributed
with distances from the centre of the galaxy with arithmetic mean
$\smean=13\ \mbox{kly}$ and standard deviation of $\sdev=9\
\mbox{kly}$, find the standard score $Z$ of:
\begin{enumerate}
\item Our sun which is at a distance of $\X=27\ \mbox{kly}$ from the
  centre of the Milky Way.
\[\Z=\frac{\X-\smean}{\sdev}=\frac{27\ \mbox{kly}-13\ \mbox{kly}}{9\ \mbox{kly}}=1.56\]
Interpretation: Our sun is +1.56 standard deviations from the mean, so slightly to moderately above the average distance.
\item A star in the central bulge of our galaxy at a distance of
  $\X=4\ \mbox{kly}$ from galactic centre.
\[\Z=\frac{\X-\smean}{\sdev}=\frac{4\ \mbox{kly}-13\ \mbox{kly}}{9\ \mbox{kly}}=-1.00\]
Interpretation: This bulge star is -1.00 standard deviations from the
mean, so slightly below the average distance.
\item A typical star in the Andromeda Nebula.  From
  Section~\ref{subsubsec:meanraw} such a star has an approximate
  distance from our sun of $2.52\ \mbox{Mly}=2520\ \mbox{kly}$.  Given
  our sun is $\X=27\ \mbox{kly}$ from galactic centre, geometrical
  considerations show that the closest an Andromeda Nebula star could be to
  galactic centre is \mbox{$\X=2520-27=2493\ \mbox{kly}$}.  The
  corresponding \Z\ value for such a distance is:
\[\Z=\frac{\X-\smean}{\sdev}=\frac{2493\ \mbox{kly}-13\ \mbox{kly}}{9\ \mbox{kly}}=275.56\]
Interpretation: Stars in the Andromeda Nebula are more than +275
standard deviations from the mean, so extremely, extremely, extremely
above the average distance from galactic centre.  According to
Chebyshev's theorem one has (with $k=275$) at least
$1-\frac{1}{275^2}=99.9987\%$ of all Milky Way stars lying within 275
standard deviations of the mean, so these Andromeda stars are highly
improbable!  What's going on?  (Hint: After Edwin Hubble first
determined accurate distances to the Cepheid Variable stars of the
Andromeda Nebula in 1925, we started referring to it as the Andromeda
\emph{Galaxy}.)
\end{enumerate}}

Besides giving a quick method of interpreting where a data value is
with respect to the mean and how typical it is, the \Z-score is also
useful for comparing observations from two different populations.

\example{The stars in the Andromeda Galaxy have a distance from
\textbf{their} galactic centre with arithmetic mean $\smean=17\
\mbox{kly}$ and standard deviation $\sdev=12\ \mbox{kly}$.  If a star
in the disk of Andromeda is measured to be at a distance of $\X=30\
\mbox{kly}$ from the centre of its galaxy, which is further from the
centre of its own galaxy that star or our sun?}{%
Calculating the \Z-score of the Andromeda star gives:
\[\Z=\frac{\X-\smean}{\sdev}=\frac{30\ \mbox{kly}-17\ \mbox{kly}}{12\ \mbox{kly}}=1.08\]
Interpretation: In absolute terms the Andromeda star is further out
than our sun since $30\ \mbox{kly} > 27\ \mbox{kly}$.  However in
relative terms (with respect to the rest of its galaxy), the Andromeda
star is closer to its centre since it is only 1.08 standard deviations
above the mean, compared to 1.56 standard deviations above the mean
for our sun.}

\assignment{For each case study answer the standard score or
  Chebyshev Theorem question found there.}
}{}

\ifthenelse{\boolean{heavy}}{%
\section{Other Statistics Derived from the Standard Deviation}
\subsection{The Coefficient of Variation (\CV)}
The smaller the value of the standard deviation, the less the
variation in the distribution.  When judging whether the standard
deviation is large or small, the standard deviation must be compared to
some value.  The value used for comparison purposes is the mean.
%Wikipedia mentions that the C.V. should be used with ratio data for which
%the mean is positive.
The statistical measure, which expresses the standard deviation as a
percentage of the mean, is called the coefficient of variation.

\[\boxed{\CV = \frac{\pdev}{\pmean}\cdot 100} \ \leftarrow\ \mbox{For a population, or}\ \ 
\boxed{\CV = \frac{\sdev}{\smean}\cdot 100} \ \leftarrow\ \mbox{For a sample}\]

\example{The mean age of a group of employees is 49.6 yrs with a
standard deviation of 6.0 yrs.  Calculate the \CV\ .}{%
\[\CV=\frac{\pdev}{\pmean}\cdot 100 = \frac{6.0\
  \mbox{yr}}{49.6\ \mbox{yr}} \cdot 100 = 12.1\%\ \ \ (\mbox{age})\]}

The larger the coefficient of variation, the greater the relative
dispersion.  One can consider the following values to be
typical\footnote{These ranges are subjective.  Others consider $\CV <
  100\%$ small and $\CV > 100\%$ large.  For purposes of this course
  the stated ranges will be used for interpreting the coefficient of
  variation.}:
% Note wikipedia suggests > 100/% is large and < 100/% is small.
\begin{itemize}
\item $\CV\approx 5\%$: \textbf{small} dispersion
\item $\CV\approx 15\%$: \textbf{moderate} dispersion
\item $\CV\gtrsim 25\%$: \textbf{large} dispersion
\end{itemize}
% These ranges were found in a book somewhere by my predecessors.

The coefficient of variation is particularly useful for comparing variations
in different data sets.
\example{The mean wage of the same group of employees is \$3600 with a
standard deviation of \$850.  Which set is more homogeneous, ages or wages?}{%
Calculating the coefficient of variation for the employee wages one finds:
\[\CV=\frac{\pdev}{\pmean}\cdot 100 = \frac{\$850}{\$3600} \cdot 100 = 23.6\%\ \ \ (\mbox{wage})\]
%window environment requires picinpar package
%The first option says what line to put the picture at
%The second option says whether the picture should be left (l) centre (c)
%or right(r)
\begin{window}[0,r,%
\fbox{\includegraphics[width=2.6in]{image2-11.png}},{}]
Comparing coefficients of variation, there is more variety (relative
dispersion) in wages than in ages.  This means that ages tend to be
relatively more similar than wages for this group of people.  Since
\emph{homogeneous} means similar in the context of data, we conclude
that ages are more homogeneous than wages in this case.  If the
frequency polygon for each distribution were superimposed on the same
graph and the scale of the variables chosen so that their means lay at
the same place the curves may appear as in the diagram on the right.
\end{window}

Notice that the standard deviations cannot be directly compared because
they have different units.  That would be like comparing apples and
oranges.  6.0 years would have to be compared to 850 dollars in terms
of size.}

\subsection{The Coefficient of  Skewness (\Sk)}

The coefficient of skewness measures the degree to which a
distribution deviates from symmetry.  Recall that in a perfectly
symmetrical distribution the mean and the median are equal.  It can be
shown that in the worst case of skewness the mean and the median are
separated by about 1 standard deviation.  A measure of skewness based
on this principle is the coefficient of skewness.\footnote{This
  definition is called \emph{Pearson's median or second skewness
    coefficient}.  The more standard definition of skewness is defined
  as the third standardized moment $\gamma_{\s1}$ which, for a finite
  population is
  $\gamma_{\s1}=\frac{1}{\np}\sum\left(\frac{\X-\pmean}{\pdev}\right)^3$\ .}

\[\boxed{\Sk=\frac{3\left(\pmean-\mbox{Median}\right)}{\pdev}}\ \ \leftarrow\ \ \mbox{For a
population, or}\ \ \boxed{\Sk=\frac{3\left(\smean-\mbox{Median}\right)}{\sdev}}\ \
\leftarrow\ \ \mbox{For a sample}\]

The quantity, \Sk, is a number that ranges from about -3 to +3.  The \textbf{magnitude} of
\Sk tells you how skewed the distribution is:
\begin{itemize}
\item $|\Sk|\approx 0$: close to \textbf{symmetric} (no skew)
\item $|\Sk|\approx 1$: \textbf{slightly} skewed
\item $|\Sk|\approx 2$: \textbf{moderately} skewed
\item $|\Sk|\approx 3$: \textbf{extremely} skewed
\end{itemize}
Assuming the distribution has a significant skew the \textbf{sign} of
\Sk\ tells you whether it is \textbf{positively skewed} (\Sk\
positive) or \textbf{negatively skewed} (\Sk\ negative).  Combining
magnitude and sign in one diagram gives:

\begin{center}
\includegraphics[width=4in]{image2-12.png}
\end{center}

\example{Suppose a group of 100 people had a mean age of 37.5 years,
a median age of 44.0 years and a standard deviation of 9.0
years.  Describe the shape of the distribution of ages.}{%
\[\Sk=\frac{3\left(\pmean-\mbox{Median}\right)}{\pdev}=\frac{3\left(\text{37.5\ \mbox{yr}}-44.0\ \mbox{yr}\right)}{9.0\ \mbox{yr}}=-2.16666=-2.2\]

\begin{window}[0,r,%
\fbox{\includegraphics[width=3in]{image2-13.png}},{}]
This means that the distribution of ages is moderately negatively
skewed in shape.  If its frequency polygon were drawn it might look
like that at the right.  It would have a pronounced tail on the left
hand side of the range.  In terms of the numbers in the distribution,
this means that a large majority of the ages in the distribution are
above the mean but that there are a few extremely small values that
are pulling the mean down.
\end{window}}

\assignment{For each case study calculate the coefficient of
  variation and the coefficient of skewness.  Interpret your values.}
}{}

\ifthenelse{\boolean{heavy}}{
\section{Fractional Measures of Position}
\subsection{Fractiles}
Fractiles are positional measures within a data set.  Just as the
median measures the halfway point, there are other fractional
positions that can be computed.  The fractions in common use are
quarters, tenths and hundredths.  Quartiles are quarter divisions,
deciles are tenths divisions and percentiles are hundredth divisions. A sample
of these fractiles is shown below.

\begin{window}[0,r,%
\fbox{\includegraphics[width=2.5in]{image2-14.png}},{\centering\textbf{The Third Quartile}}]
\raggedright \FQ{3} represents the third quartile.  It is that
  value of the variable
  such that $\frac{3}{4}$ of the distribution falls below this value
  if the data array is ranked.
\end{window}
\vspace{.75in}

\begin{window}[0,r,%
\fbox{\includegraphics[width=2.5in]{image2-15.png}},{\centering\textbf{The Eighth Decile}}]
\raggedright \FD{8} represents the eighth decile.  It is that value of
the variable such that $\frac{8}{10}$ of the distribution falls below
this value if the data array is ranked.
\end{window}
\vspace{.75in}

\begin{window}[0,r,%
\fbox{\includegraphics[width=2.5in]{image2-16.png}},{\centering\textbf{The Ninety-fifth Percentile}}]
\FP{95} represents the ninety fifth percentile.  It is that value of
the variable such that $\frac{95}{100}$ of the distribution falls
below this value if the data array is ranked.
\end{window}
\vspace{.75in}

What do \FQ{2}, \FD{5}, and \FP{50} equal?

\subsection{Calculating Fractile Values}
Fractile values are calculated in an \textbf{identical manner} to the
way in which the \textbf{median} was calculated.\footnote{Note that
  there are minor variations in how fractiles are defined and hence
  how they are calculated.  For this class they should be calculated
  as shown here.  When comparing with other sources the answers may
  not be exactly the same but they should be close.}  (See Sections~
\ref{subsec:medianraw}, \ref{subsec:medianungrouped}, and
\ref{subsec:mediangrouped}.) The only difference is that the fraction
used to find the location is not $\frac{1}{2}$ but depends on the
fraction in the fractile. On the formula sheet, we will use the two
formulae for the median calculation but we will change the fraction to
correspond to the fractile.  For a fractile $F_i$ the denominator will
be 4, 10, or 100 depending on whether $F$ is $Q$, $D$, or $P$ while
the numerator becomes $i$.

\subsubsection{Raw Data and Ungrouped Frequency Distributions}
\label{subsubsec:fractilerawungrouped}
Rank order the data and locate the value occupying the position.

\example{A group of young children were observed to have the following
heights (cm)
\[56,\  70,\  78,\  65,\ 62,\ 71,\ 56,\ 63,\ 65,\ 71\]
Find the $\mathbf{10}^{\textbf{th}}$ \textbf{percentile}.}{%
In rank order we have:
\[56,\ 56,\ 62,\ 63,\ 65,\ 65,\ 70,\ 71,\ 71,\ 78\]
\[\mbox{Position}\ \FP{10} = \frac{\textbf{10}}{\textbf{100}}\left(n+1\right)=\frac{10}{100}\left(10+1\right)=1.1^{\mbox{st}}\]
Since $\X_1=56\ \mbox{cm}$ and $\X_2=56\ \mbox{cm}$ we have for the
value of \FP{10}:
\[\FP{10} = \X_{1.1} = 56.0\ \mbox{cm}\]}

In this last example no interpolation was required because
$\X_1=\X_2$.  Had they been different, in the median case the only
possible position in between would have been 1.5 and we would have just
averaged the values.  New in the case for fractiles for raw data and
ungrouped frequency distributions is that a real interpolation is
often required, as demonstrated in the following example.

\example{Over a two month period the number of cancelled flights in a given day
were recorded for an airport with the results at left.  Find the
\textbf{eighth decile} for the data.

\begin{tabular}{|c|c|c|}\hline
Cancellations (flights) & Days & \lcf \\ \hline
0&29&29\\
1&19&48\\
3&~8&56\\
4&~3&59\\
5&~1&60\\ \hline
& $\sum\f = 60 $& \\ \hline
\end{tabular}~~~~~~~~
\begin{minipage}{3.5in}
First we find the position by modifying the median formula for ungrouped data:
\[\mbox{Position}\ \FD{8} =\frac{\mathbf{8}}{\mathbf{10}}\left(\sum\f+1\right)=\frac{8}{10}\left(60+1\right)=48.8^{\mbox{\scriptsize th}}\]
From the cumulative frequency column we see that \mbox{$\X_{48}=1\ \mbox{flight}$} and $\X_{49}=3\ \mbox{flights}$, so we interpolate.
\end{minipage}
\[
\begin{array}{c|c}
~~~~~~~~~~~~~~~~~~~~~~\mbox{Variable Value}~~~~~~ & \mbox{Position}~~~~~ \\\hline
\rule{0em}{3em}2\ \mbox{flights}\left(\begin{array}{c}
\FD{8}-1\ \mbox{flight}\left(\begin{array}{c}1\ \mbox{flight}\\ \FD{8} \end{array}\right.\\ 
~~~~~~~~~~~~~~~~~~~~3\ \mbox{flights}\end{array}\right. &
\left.\begin{array}{c}
\left.\begin{array}{c}
~48~~ \\
~~48.8
\end{array}\right)0.8\\
49~~~~~~~~
\end{array}\right)1
\end{array}
\]
This gives the fractional equation:
\[\frac{\FD{8}-1\ \mbox{flight}}{2\ \mbox{flights}}=\frac{0.8}{1}\]

Solve for the eighth decile value:
\[
\FD{8}=1\ \mbox{flight}+\frac{0.8}{1}\cdot \left(2\
  \mbox{flights}\right)=2.60000\ \mbox{flights}=2.6\ \mbox{flights}\ .\]}
}{}

\ifthenelse{\boolean{heavy}}{
\subsubsection{Grouped Frequency Distributions}
\label{subsubsec:fractilegrouped}
\example{A survey of the price of a certain size of refrigerator was
made with the results at left.
Find the price at the \textbf{third quartile}.

\begin{tabular}{|c|c|c|}\hline
Price (\$) & \f & \lcf \\ \hline
500 - ~600 & ~6 & ~6 \\
600 - ~700 & 12 & 18 \\
700 - ~800 & 18 & 36 \\
800 - ~900 & 10 & 46 \\
900 - 1000 & ~4 & 50 \\ \hline
& $\sum\f=50$ & \\ \hline
\end{tabular}~~~~~~~~
\begin{minipage}{3.5in}

First find the position:
\[\mbox{Position}\ \FQ{3}=\frac{\mathbf 3}{\mathbf 4}\left(\sum\f\right)
=\frac{3}{4}\left(50\right)=37.5^{th}\]

Examining the cumulative frequency column indicates that \FQ{3} lies
in the \$800-\$900 class, so we interpolate:
\end{minipage}

\[
\begin{array}{c|c}
~~~~~~~~~~~~~~~~~~~~~~\mbox{Variable Value}~~~~~~ & \mbox{Position}~~~~~ \\\hline
\rule{0em}{3em}\$100\left(\begin{array}{c}
\FQ{3}-\$800\left(\begin{array}{c}\$800\\ \FQ{3} \end{array}\right.\\ 
~~~~~~~~~~~~~~~~\$900\end{array}\right. &
\left.\begin{array}{c}
\left.\begin{array}{c}
~36~~ \\
~~37.5
\end{array}\right)1.5\\
46~~~~~~~~
\end{array}\right)10
\end{array}
\]
This gives the fractional equation:
\[\frac{\FQ{3}-\$800}{\$100}=\frac{1.5}{10}\]

Solve for the third quartile value:
\[
\FQ{3}=\$800+\frac{1.5}{10}\cdot
\left(\$100\right)=\$815.0000=\$815.00
\]}

\subsection{Using Fractiles to Measure Dispersion}
There are various types of ranges that are calculated on the basis of
these fractional measures. The effect of these calculations is to trap
a given proportion of the array about centre and to cut off the values
in the extremities of the distribution.  

\subsubsection{Interquartile Range (\IQR)}

\begin{center}
\includegraphics[width=4in]{image2-17.png}
\end{center}
The \textbf{interquartile range} captures the middle 50\% of the data
and is defined by
\[\boxed{\IQR=\FQ{3}-\FQ{1}}\ .\]

\example{Find the \textbf{interquartile range} for the example of Section~\ref{subsubsec:fractilegrouped}.}{%
We have already found $\FQ{3}=\$815.00$.  We need \FQ{1}.  This time
we'll use the formula to find it.

First find the position:
\[\mbox{Position}\ \FQ{1}=\frac{\mathbf 1}{\mathbf 4}\left(\sum\f\right)
=\frac{1}{4}\left(50\right)=12.5^{th}\]

Examining the cumulative frequency column indicates that \FQ{3} lies
in the \$600-\$700 class.\newline

Using the median formula for grouped frequency distributions suitably
modified for the first quartile gives:
\[\FQ{1}=L_i+\frac{\left\{\frac{\textbf 1}{\textbf 4}\left(\sum
f\right)-\lcf_{i-1}\right\}}{f_{i}}\cdot\cwidth=\$600+\left\{\frac{\frac{1}{4}\left(50\right)-6}{12}\right\}\cdot\$100=\$654.166666=\$654.17\]

Finally the interquartile range is:
\[\IQR=\FQ{3}-\FQ{1}=\$815.00-\$654.17=\$160.83\]}

\subsubsection[Percentile (\IPR) and Interdecile (\IDR) Ranges]{10-90 Percentile Range (\IPR) or Interdecile Range (\IDR)}
\begin{center}
\includegraphics[width=4in]{image2-18.png}
\end{center}
The \textbf{10-90 percentile range} is defined by
\[\boxed{\IPR=\FP{90}-\FP{10}}\ .\]
This is also sometimes called the \textbf{interdecile range} from
\FD{1} to \FD{9} since $\FP{10}=\FD{1}$ and $\FP{90}=\FD{9}$.
\[\boxed{\IDR=\FD{9}-\FD{1}}\ .\]
These ranges capture the middle 80\% of the data.

\example{Calculate the \textbf{10-90 percentile range} for the first
example in Section~\ref{subsubsec:fractilerawungrouped}\ .}{%
We already found $\FP{10}=56.0\ \mbox{cm}$.  We need $\FP{90}$.  First find
its position:

\[\mbox{Position}\ \FP{90} = \frac{\textbf{90}}{\textbf{100}}\left(n+1\right)=\frac{90}{100}\left(10+1\right)=9.9^{\mbox{\scriptsize th}}\]

Since $\X_9=71\ \mbox{cm}$ and $\X_{10}=78\ \mbox{cm}$ we must
interpolate to find $\FP{90}=\X_{9.9}$:

\[
\begin{array}{c|c}
~~~~~~~~~~~~~~~~~~~~~~\mbox{Variable Value}~~~~~~ & \mbox{Position}~~~~~ \\\hline
\rule{0em}{3em}7\ \mbox{cm}\left(\begin{array}{c}
\FP{90}-71\ \mbox{cm}\left(\begin{array}{c}71\ \mbox{cm}\\ \FP{90} \end{array}\right.\\ 
~~~~~~~~~~~~~~~~~~78\ \mbox{cm}\end{array}\right. &
\left.\begin{array}{c}
\left.\begin{array}{c}
~~9~~ \\
~~~9.9
\end{array}\right)0.9\\
10~~~~~~~~
\end{array}\right)1
\end{array}
\]
This gives the fractional equation:
\[\frac{\FP{90}-71\ \mbox{cm}}{7\ \mbox{cm}}=\frac{0.9}{1}\]

Solve for the ninetieth percentile value:
\[
\FP{90}=71\ \mbox{cm}+\frac{0.9}{1}\cdot \left(7\
  \mbox{cm}\right)=77.30000\ \mbox{cm}=77.3\ \mbox{cm}\ .\]

Finally the 90-10 percentile range is
\[\IPR=\FP{90}-\FP{10}=77.3\ \mbox{cm}-56.0\ \mbox{cm}=21.3\ \mbox{cm}\ .\]
The interdecile range, \IDR, has the same value.}

Note:
\begin{itemize}
\item If an ogive graph is available, all fractiles may be easily read from
it and these ranges calculated.
\item We could have defined an interpercentile range by
  $\FP{99}-\FP{1}$.  Why might that not be so useful?
\end{itemize}

% If we add an ogive graph with questions we should also reverse
% the question and ask what percentile a certain grade is. We
% wouldn't want to burden this with an exact calculation but reading
% off an ogive is useful and quick to add here.

\assignment{For each case study calculate the fractiles and
  fractile ranges requested.}
}{}

\section{Case Studies}

% The following command generates a list of answers which we then put
% in the answer appendix.  Note that this allows us to issue only a single
% \protect command rather than the many required if we passed the list
% in directly.  See lectures.sty
\newcommand{\textbookcasestudyanswers}{Case study 1:\vspace{.2em}
\begin{enumerate}[(a)]
\item The population is used copies of the particular textbook available online.
\item sample data
\item $\X=\mbox{book price}$
\item quantitative
\item discrete
\item ratio
\item raw data
\item $\ns=7$
\item $\sum \X=\$149.60$, no
\item Two modes, $\$7.50$ and $\$50.00$
\item $\mbox{Median}=\$12.00$
\item $\smean=\$21.37$
\item $\adev=\$16.36$
\item $\sdev=\$19.98$, $\svar=399.02\ (\$^2)$
\item $\sdev=\$19.98$, $\svar=399.02\ (\$^2)$
\ifthenelse{\boolean{heavy}}{
\item $\Z=-0.72$\ \ Price is .72 standard deviations (slightly) below the mean.
\item $\CV=93\%$\ \ large variation
\item $\Sk=2.82$\ \ extreme positive skew
\item $\FQ{1}=\$7.50$, $\FQ{3}=\$50.00$, $\IQR=\$42.50$
}{}
\end{enumerate}}
\newcommand{\mathmarkscasestudyanswers}{Case study 2:\vspace{.2em}
\begin{enumerate}[(a)]
\item Population is the math exams taken by the student for his math course.
\item population data
\item $\X=\mbox{score on the exam}$
\item quantitative
\item discrete (assuming no fractional percents given)
\item ratio
\item raw data
\item $\np=6$
\item $\sum\X=452\%$, no
\item $\mbox{mode}=70.0\%$
\item $\mbox{median}=74.5\%$
\item $\pmean=75.3\%$
\item $\adev=7.0\%$
\item $\pdev=7.6\%$, $\pvar=57.6\ (\%^2)$
\item $\pdev=7.6\%$, $\pvar=57.6\ (\%^2)$
\ifthenelse{\boolean{heavy}}{
\item at least 41\% of data between 65.4\% and 85.2\%, $\frac{4}{6}=67\%>41\%$
\item $\CV=10\%$\ \ moderate variation
\item $\Sk=0.32$\ \ very slight positive skew
\item $\FD{7}=80.8\%$
}{}
\end{enumerate}}
\newcommand{\gamecasestudyanswers}{Case study 3:\vspace{.2em}
\begin{enumerate}[(a)]
\item Population is the rolls of two dice.
\item sample data
\item $\X=\mbox{sum of the two dice}$
\item quantitative
\item discrete
\item ratio
\item ungrouped frequency distribution
\item $\f$ is the \emph{Occurrences} column.
\item $\sum\f=50$
\item $\sum\f\X=200$, no
\item Add \rel, \lcf, \lcr\ .  $\sum\rel=1.00$
\item $\mbox{mode}=4.0$
\item $\mbox{median}=4.0$
\item $\smean=4.0$
\item $\sdev=1.2$, $\svar=1.3$
\ifthenelse{\boolean{heavy}}{
\item $\Z=1.67$\ \ Roll is 1.67 standard deviations (moderately) above the mean.
\item $\CV=30\%$\ \ moderate variation
\item $\Sk=0.00$\ \ symmetric
\item $\FP{10}=2.1$, $\FP{90}=6.0$, $\IPR=3.9$
}{}
\end{enumerate}}
\newcommand{\preschoolcasestudyanswers}{Case study 4:\vspace{.2em}
\begin{enumerate}[(a)]
\item Population is all students at this particular preschool in the last year.
\item population data
\item $\X=\mbox{student age}$
\item quantitative
\item discrete (since human age means number of birthdays)
\item ratio
\item ungrouped frequency distribution
\item $\f$ is the \emph{\# of children} column.
\item $\sum\f=20$
\item $\sum\f\X=58\ \mbox{years}$, no
\item Add \rel, \lcf, \lcr\ .  $\sum\rel=1.00$
\item $\mbox{mode}=2.0\ \mbox{years}$
\item $\mbox{median}=2.5\ \mbox{years}$
\item $\pmean=2.9\ \mbox{years}$
\item $\pdev=1.4\ \mbox{years}$, $\pvar=1.9\ (\mbox{years}^2)$
\ifthenelse{\boolean{heavy}}{
\item at least 75\% of data between 0.1\ yr and 5.7\ yr, $\frac{18}{20}=90\%>75\%$
\item $\CV=48\%$\ \ large variation
\item $\Sk=0.86$\ \ slight positive skew
\item $\FP{66}=2.9\ \mbox{yr}$
}{}
\end{enumerate}}
\newcommand{\webcasestudyanswers}{Case study 5:\vspace{.2em}
\begin{enumerate}[(a)]
\item Population is items sold on \emph{cheapjunk.com} over the previous year.
\item population data
\item $\X=\mbox{selling price}$
\item quantitative
\item discrete (since price is to nearest penny)
\item ratio
\item grouped frequency distribution
\item $\f$ is the \emph{Purchases} column.
\item $\sum\f=150$
\item $\sum\f\X=\$15120.00$, yes
\item Add \rel, \p, \lcf, \lcr\ .  $\sum\rel=1.000$
\item See Figure~\ref{fig:web}\ .
\item symmetric
\item From histogram, $\mbox{mode}\approx\$100.00$, \mbox{$\pmean\approx\$100.00$}.  From ogive, \mbox{$\mbox{median}\approx \$100.00$}
\item $\mbox{mode}=\$100.00$
\item $\mbox{median}=\$100.39$
\item $\pmean=\$100.80$
\item $\pdev=\$48.98$, $\pvar=2399.36\ (\$^2)$
\ifthenelse{\boolean{heavy}}{
\item $\Z=0.00$\ \ Purchase price equals the mean.
\item $\CV=49\%$\ \ large variation
\item $\Sk=0.03$\ \ symmetric
\item $\FD{1}=\$30.00$, $\FD{9}=\$172.73$, $\IDR=\$142.73$
}{}
\end{enumerate}}
\newcommand{\windcasestudyanswers}{Case study 6:\vspace{.2em}
\begin{enumerate}[(a)]
\item Population is wind near Swift Current on a given day.
\item sample data
\item $\X=\mbox{peak wind speed}$
\item quantitative
\item continuous
\item ratio
\item grouped frequency distribution
\item $\f$ is the \emph{Days} column.
\item $\sum\f=30$
\item $\sum\f\X=1100.0\ \mbox{km/h}$, yes
\item Add \rel, \p, \lcf, \lcr\ .  $\sum\rel=1.000$
\item See Figure~\ref{fig:wind}\ .
\item positively skewed
\item From histogram, $\mbox{mode}\approx 30 \ \mbox{km/h}$, \mbox{$\pmean\approx 36\ \mbox{km/h}$}.  From ogive, \mbox{$\mbox{median}\approx 32\ \mbox{km/h}$}
\item $\mbox{mode}=30.0\ \mbox{km/h}$
\item $\mbox{median}=31.7\ \mbox{km/h}$
\item $\smean=36.7\ \mbox{km/h}$
\item $\sdev=24.3\ \mbox{km/h}$, $\svar=588.5\ \mbox{km}^2/\mbox{h}^2$
\ifthenelse{\boolean{heavy}}{
\item $\Z=4.66$\ \ Wind speed is 4.66 standard deviations (extremely) above the mean.
\item $\CV=66\%$\ \ large variation
\item $\Sk=0.62$\ \ slight positive skew
\item $\FQ{3}=52.5\ \mbox{km/h}$
}{}
\end{enumerate}}
\begin{enumerate}
\item \answer{\protect\textbookcasestudyanswers} A student
  interested in buying a used textbook from a friend does a quick
  survey to find out its value.  She goes online and finds the
  following data for used book prices for the text:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|m{0.200\textwidth}|m{0.200\textwidth}|m{0.200\textwidth}|m{0.200\textwidth}|}\hline
\centering{Price $\left(\mbox{\$}\right)$} &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
~5.00 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
~7.50 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
~7.50 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
12.00 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
17.60 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
50.00 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
50.00 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{2.00cm}

\item Calculate the \textbf{mode}. \vspace{2.00cm}

\item Calculate the \textbf{median}. \vspace{4.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{4.00cm}

\item Calculate the \textbf{average deviation}. \vspace{5.00cm}
\clearpage

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{definitional} formula.) \vspace{7.00cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Calculate the \textbf{standard score} of a purchase of a book costing \$7.00.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{first quartile}, the \textbf{third quartile}, and the \textbf{interquartile range}. \vspace{6.50cm}
\clearpage
}{}

\end{enumerate}
\clearpage

\item \answer{\protect\mathmarkscasestudyanswers}
A student in a math class received the following scores on his exams for the course:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|m{0.200\textwidth}|m{0.200\textwidth}|m{0.200\textwidth}|m{0.200\textwidth}|}\hline
\centering{Score $\left(\mbox{\%}\right)$} &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
65 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
70 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
70 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
79 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
81 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
87 &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}
\clearpage

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{2.00cm}

\item Calculate the \textbf{mode}. \vspace{2.00cm}

\item Calculate the \textbf{median}. \vspace{5.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{5.00cm}

\item Calculate the \textbf{average deviation}. \vspace{5.00cm}
\clearpage

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{definitional} formula.) \vspace{9.50cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Find the \textbf{percentage of data} and the \textbf{data
    interval} corresponding to Chebyshev's Theorem with $k=1.3$.  Show
  that the \textbf{actual percentage} of data elements in the dataset
  within this interval satisfies the inequality.\vspace{5.00cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{seventh decile}.  \vspace{5.00cm}
\clearpage
}{}

\end{enumerate}
\clearpage
\item \answer{\protect\gamecasestudyanswers} A designer of children's
  games decides to use ``3-sided'' dice by labelling a regular 6-sided
  die with two 1's, two 2's, and two 3's.  In his game he decides that
  movement will be determined by rolling two such dice.  In order to
  determine the likelihood of a given roll he rolls two dice
  repeatedly with the following results for the sum on the dice:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|c|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|}\hline
\centering{Roll} & \centering{Occurrences} &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
2 & ~5 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
3 & 12 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
4 & 17 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
5 & 10 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
6 & ~6 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Identify the \textbf{frequency} column with the appropriate symbol. \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}
\clearpage

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{1.50cm}

\item Add a column for \textbf{relative frequency}(\rel).  (If the distribution is grouped also add \textbf{relative frequency density}(\p).)  Also add columns for \textbf{cumulative frequency} (\lcf) and \textbf{cumulative relative frequency} (\lcr).  Remember to \textbf{sum} any column for which it is appropriate. \vspace{0.00cm}

\item Calculate the \textbf{mode}. \vspace{1.50cm}

\item Calculate the \textbf{median}. \vspace{5.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{3.00cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Calculate the \textbf{standard score} of a roll of 6.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{tenth percentile}, the \textbf{ninetieth percentile}, and the \textbf{10-90 percentile range}. \vspace{6.50cm}
}{}
\end{enumerate}
\clearpage
\item \answer{\protect\preschoolcasestudyanswers} A preschool
  completes a report for the government indicating the age of students
  in their care for the past year:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|c|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|m{0.143\textwidth}|}\hline
\centering{Age $\left(\mbox{years}\right)$} & \centering{\# of children} &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
1 & 2 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
2 & 8 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
3 & 4 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
4 & 4 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
6 & 2 &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Identify the \textbf{frequency} column with the appropriate symbol. \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{2.00cm}

\item Add a column for \textbf{relative frequency}(\rel).  (If the distribution is grouped also add \textbf{relative frequency density}(\p).)  Also add columns for \textbf{cumulative frequency} (\lcf) and \textbf{cumulative relative frequency} (\lcr).  Remember to \textbf{sum} any column for which it is appropriate. \vspace{0.00cm}

\item Calculate the \textbf{mode}. \vspace{2.00cm}

\item Calculate the \textbf{median}. \vspace{5.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{3.00cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Find the \textbf{percentage of data} and the \textbf{data
    interval} corresponding to Chebyshev's Theorem with $k=2$.  Show
  that the \textbf{actual percentage} of data elements in the dataset
  within this interval satisfies the inequality.\vspace{5.00cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your
  answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your
  answer. \vspace{3.50cm}

\item Calculate the \textbf{sixty-sixth percentile}.  \vspace{5.00cm}
\clearpage
}{}

\end{enumerate}
\clearpage
\item \answer{\protect\webcasestudyanswers} A web startup company,
  \emph{cheapjunk.com}, reported in their annual report the following
  purchases from their website for the first year of operation:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|c|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|}\hline
\centering{Value $\left(\mbox{\$}\right)$} & \centering{Purchases} &  &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
~~0.00~--~~40.00 & 20 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
~40.00~--~~80.00 & 29 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
~80.00~--~120.00 & 51 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
120.00~--~160.00 & 28 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
160.00~--~200.00 & 22 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Identify the \textbf{frequency} column with the appropriate symbol. \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{2.00cm}

\item Add a column for \textbf{relative frequency}(\rel).  (If the distribution is grouped also add \textbf{relative frequency density}(\p).)  Also add columns for \textbf{cumulative frequency} (\lcf) and \textbf{cumulative relative frequency} (\lcr).  Remember to \textbf{sum} any column for which it is appropriate. \vspace{0.00cm}

\item In the space below sketch a \textbf{histogram} and an \textbf{ogive} for the data.  On your histogram also draw a \textbf{frequency polygon}. \vspace{7.00cm}

\item Is your histogram (frequency polygon) \textbf{symmetric} or \textbf{skewed}?  If it is skewed is it \textbf{positively} or \textbf{negatively} skewed?  \mbox{(Circle the correct answers.)} \vspace{0.00cm}

\item By looking at only your histogram and ogive, estimate the \textbf{mode}, the \textbf{median}, and the \textbf{arithmetic mean}.  Indicate your reasoning on the graphs. \vspace{3.00cm}

\item Calculate the \textbf{mode}. \vspace{1.50cm}

\item Calculate the \textbf{median}. \vspace{5.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{5.00cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Calculate the \textbf{standard score} of a purchase of value \$100.80.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{first decile}, the \textbf{ninth decile}, and the \textbf{interdecile range}. Verify your fractiles using your ogive.\vspace{6.50cm}
\clearpage
}{}

\end{enumerate}
\clearpage
\item \answer{\protect\windcasestudyanswers} In order to evaluate the
  viability of a wind turbine installation near Swift Current,
  SaskPower measured the daily peak wind speed at the location over a
  month with the following results:

\ifthenelse{\isodd{\thepage}}{\hspace*{-.5in}}{\hspace*{-1.25in}}\resizebox{\textwidth+1in}{!}{\begin{tabular}{|c|c|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|m{0.111\textwidth}|}\hline
\centering{Speed $\left(\mbox{km/h}\right)$} & \centering{Days} &  &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}} \\\hline
~0~--~~20 & ~8 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
20~--~~40 & 12 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
40~--~~60 & ~4 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
60~--~~80 & ~4 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
80~--~100 & ~2 &   &   &   &   &   &   &  \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\
\hline
 &  &  &  &  &  &  &  & \raisebox{-0.62cm}{\rule{0cm}{1.50cm}}\\ \hline
\end{tabular}}

\begin{enumerate}

\item What is the \textbf{population} (i.e. \textbf{experimental unit}) under consideration? \vspace{1.00cm}

\item Is the data for the whole population (\textbf{population data}) or for a sample of it (\textbf{sample data})? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item What is the \textbf{statistical variable}? Label the column with the appropriate symbol. \vspace{1.00cm}

\item Is the variable \textbf{qualitative} or \textbf{quantitative}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the variable \textbf{continuous} or \textbf{discrete}. \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Is the level of measurement of the variable \textbf{nominal},
  \textbf{ordinal}, \textbf{interval}, or
  \textbf{ratio}?\\* \mbox{(Circle the correct answer.)}\vspace{0.00cm}

\item Is the data presented as \textbf{raw data}, an \textbf{ungrouped frequency distribution} or a \textbf{grouped frequency distribution}? \mbox{(Circle the correct answer.)} \vspace{0.00cm}

\item Identify the \textbf{frequency} column with the appropriate symbol. \vspace{0.00cm}

\item What is the \textbf{number of data elements}? \vspace{1.00cm}

\item What is the \textbf{sum of observations}?  Is your answer approximate? \mbox{(Circle \textbf{yes} or \textbf{no})} \vspace{2.00cm}

\item Add a column for \textbf{relative frequency}(\rel).  (If the distribution is grouped also add \textbf{relative frequency density}(\p).)  Also add columns for \textbf{cumulative frequency} (\lcf) and \textbf{cumulative relative frequency} (\lcr).  Remember to \textbf{sum} any column for which it is appropriate. \vspace{0.00cm}

\item In the space below sketch a \textbf{histogram} and an \textbf{ogive} for the data.  On your histogram also draw a \textbf{frequency polygon}. \vspace{7.00cm}

\item Is your histogram (frequency polygon) \textbf{symmetric} or \textbf{skewed}?  If it is skewed is it \textbf{positively} or \textbf{negatively} skewed?  \mbox{(Circle the correct answers.)} \vspace{0.00cm}

\item By looking at only your histogram and ogive, estimate the \textbf{mode}, the \textbf{median}, and the \textbf{arithmetic mean}.  Indicate your reasoning on the graphs. \vspace{3.00cm}

\item Calculate the \textbf{mode}. \vspace{1.50cm}

\item Calculate the \textbf{median}. \vspace{5.00cm}

\item Calculate the \textbf{arithmetic mean}. \vspace{5.00cm}

\item Calculate the \textbf{standard deviation} and \textbf{variance}. (Use the \textbf{computing} formula.) \vspace{7.00cm}

\ifthenelse{\boolean{heavy}}{
\clearpage
\item Calculate the \textbf{standard score} of a wind speed of 150 km/h.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of variation}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{coefficient of skewness}.  Interpret your answer. \vspace{3.50cm}

\item Calculate the \textbf{third quartile}. Verify the fractile using your ogive.\vspace{6.50cm}
\clearpage
}{}
\end{enumerate}
\end{enumerate}
\clearpage
\customlistofanswer
\begin{figure}[h]
% The zerof and invisible draw below are to make the right axis be
% properly aligned.
\ifthenelse{\isodd{\thepage}}{}{\hspace*{-.5in}}\begin{asy}
import graph;
import stats;
size(180,180,IgnoreAspect);
real[] bins={0,40,80,120,160,200};
real[] binswzeros={-40,0,40,80,120,160,200,240};
real[] mids={-20,20,60,100,140,180,220};
real[] count={20,29,51,28,22};
real[] countwzeros={0.00001,20,29,51,28,22,0};
real zerof(real x) {return 0.0;}
ylimits(0,51);
histogram(binswzeros, countwzeros, bars=true);
xaxis("$\mbox{Value}(\$)$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Label(fontsize(10pt)),Ticks=bins));
yaxis("$\f$",Left,RightTicks(Label(fontsize(10pt))));
draw(graph(mids,countwzeros),black+1);
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,51/(40*150));
    draw(pic,graph(pic,zerof,-40,240),invisible);
    yaxis(pic,"$\p\ (1/\$)$",Right,LeftTicks(Label(fontsize(10pt))));
  });
add(q);
xequals(100,ymin=0,ymax=50,dashed);
dot(shift(2mm*N)*"Mode",(100,0),NW,fontsize(8pt));
dot(shift(.5mm*N)*"$\scriptstyle{\mu}$",(100.80,0),NE);
label(shift(5mm*N)*"Number of Purchases vs Purchase Value",point(N),fontsize(10pt));
\end{asy}
\hspace{9ex}
\vline
\hspace{2ex}
\begin{asy}
import graph;
import stats;
size(180,180,IgnoreAspect);
real[] bins={0,40,80,120,160,200};
real[] cumulative={0,20,49,100,128,150};
real[] myticks={0,.25,.50,.75,1};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Value}(\$)$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Label(fontsize(10pt)),Ticks=bins));
yaxis("$\lcf$",Left,RightTicks(Label(fontsize(10pt))));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,0,200),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks(Label(fontsize(10pt)),Ticks=myticks));
  });
add(q);
xequals(100.39,ymin=0,ymax=75,dashed);
yequals(75,xmin=100.39,xmax=200,dashed);
dot(shift(2mm*N)*"Median",(100.39,0),NE,fontsize(8pt));
label(shift(5mm*N)*"Cumulative Number of Purchases vs Purchase Value",point(N),fontsize(10pt));
\end{asy}
\caption{\label{fig:web}Histogram and ogive for web startup case study.}
\end{figure}
\begin{figure}[h]
\ifthenelse{\isodd{\thepage}}{}{\hspace*{-.5in}}\begin{asy}
import graph;
import stats;
size(180,180,IgnoreAspect);
real[] bins={0,20,40,60,80,100};
real[] binswzeros={-20,0,20,40,60,80,100,120};
real[] mids={-10,10,30,50,70,90,110};
real[] count={8,12,4,4,2};
real[] countwzeros={0.00001,8,12,4,4,2,0};
real zerof(real x) {return 0.0;}
ylimits(0,12);
histogram(binswzeros, countwzeros, bars=true);
xaxis("$\mbox{Wind Speed}(\mbox{km/h})$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Label(fontsize(10pt)),Ticks=bins));
yaxis("$\f$",Left,RightTicks(Label(fontsize(10pt))));
draw(graph(mids,countwzeros),black+1);
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,12/(20*30));
    draw(pic,graph(pic,zerof,-20,120),invisible);
    yaxis(pic,"$\p\ (\mbox{h/km})$",Right,LeftTicks(Label(fontsize(10pt))));
  });
add(q);
xequals(30,ymin=0,ymax=12,dashed);
label(shift(5mm*N)*"Number of Days vs Maximum Wind Speed",point(N),fontsize(10pt));
dot(shift(2mm*N)*"Mode",(30,0),NW,fontsize(8pt));
dot(shift(.5mm*N)*"$\scriptstyle{\bar{X}}$",(36.7,0),N);
\end{asy}
\hspace{11ex}
\vline
\hspace{5ex}
\begin{asy}
import graph;
import stats;
size(180,180,IgnoreAspect);
real[] bins={0,20,40,60,80,100};
real[] cumulative={0,8,20,24,28,30};
real[] myticks={0,.25,.50,.75,1};
real zerof(real x) {return 0.0;}
ylimits(0,max(cumulative));
draw(graph(bins,cumulative),black+1);
xaxis("$\mbox{Wind Speed}(\mbox{km/h})$",xmin=min(bins),xmax=max(bins),Bottom,LeftTicks(Label(fontsize(10pt)),Ticks=bins));
yaxis("$\lcf$",Left,RightTicks(Label(fontsize(10pt))));
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,1.0);
    draw(pic,graph(pic,zerof,0,100),invisible);
    yaxis(pic,"$\lcr$",Right,LeftTicks(Label(fontsize(10pt)),Ticks=myticks));
  });
add(q);
xequals(31.7,ymin=0,ymax=15,dashed);
yequals(15,xmin=31.7,xmax=100,dashed);
label(shift(5mm*N)*"Cumulative Number of Days vs Wind Speed",point(N),fontsize(10pt));
dot(shift(2mm*N)*"Median",(31.7,0),NE,fontsize(8pt));
\end{asy}
\caption{\label{fig:wind}Histogram and ogive for wind speed case study.}
\end{figure}

% Make the formula sheet.   Make it an empty page and start a new one so
% student can take it out.
\cleardoublepage
\thispagestyle{empty}
% Note that there may be a better way to do this, but I used the tabular
% environment because I wanted to have fixed width columns using m{}.  I
% then put \centering and $\displaystyle as input to the preamble of each
% column and $ after each column.  Finally note that you can't use \\ to
% end a line - the \centering chokes with a noalign error.  The webpage on
% Tables in the LaTeX wikibook was helpful here.
% The rowrule commands are defined in lectures.sty and provide height.
% These define some text which show up in the table repeatedly
\newcommand{\medpos}{\resizebox{!}{1.1em}{\begin{tabular}{c}Median \\ Position\end{tabular}}}
\newcommand{\medval}{\resizebox{!}{1.1em}{\begin{tabular}{c}Median \\ Value\end{tabular}}}
% This defines a line which only appears in the heavy course but the switch
% fails if put directly in the table.
\ifthenelse{\boolean{heavy}}{%
\newcommand{\ranges}{\multicolumn{3}{|c|}{\rowrulesmall\IQR=\FQ{3}-\FQ{1}\hfill\IDR=\FD{9}-\FD{1}\hfill\IPR=\FP{90}-\FP{10}}\tabularnewline \hline}}
{\newcommand{\ranges}{}}
\section*{Descriptive Statistical Measures}\vspace*{-1em}
\hspace*{-.3in}\begin{tabular}{|>{\centering$\displaystyle}m{.34\textwidth}<{$}||>{\centering$\displaystyle}m{.28\textwidth}<{$}||>{\centering$\displaystyle}m{.42\textwidth}<{$}|}\hline
\mbox{\raisebox{-1em}{\textbf{Raw Data}}} & \mbox{\textbf{Ungrouped Frequency}} & \mbox{\textbf{Grouped Frequency}} \tabularnewline
         & \mbox{\textbf{Distribution}}        & \mbox{\textbf{Distribution}} \tabularnewline\hline
\end{tabular}\vspace{.5em}\newline
\textbf{\large Measures of the Centre:}\vspace{.2em}\newline
\hspace*{-.3in}\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{.34\textwidth}<{$}||>{\centering$\displaystyle}m{.28\textwidth}<{$}||>{\centering$\displaystyle}m{.42\textwidth}<{$}|}\hline
\pmean=\frac{\sum\X}{\np}\ \mbox{or}\ \smean=\frac{\sum\X}{\ns} &
\pmean,\smean=\frac{\sum\f\X}{\sum\f} &
\pmean,\smean=\frac{\sum\f\X}{\sum\f} \tabularnewline\hline
\medpos=\frac{1}{2}\left(\np+1\right)\ \mbox{or}\ \frac{1}{2}\left(\ns+1\right) &
\medpos=\frac{1}{2}\left(\sum\f+1\right) &
\medpos=\frac{1}{2}\left(\sum\f\right) \tabularnewline
\medval= \X_{\frac{1}{2}\left(\np+1\right)}\ \mbox{or}\ \X_{\frac{1}{2}\left(\ns+1\right)}&
\medval= \X_{\frac{1}{2}\left(\sum\f+1\right)}&
\medval=L_i+\frac{\left\{\frac{1}{2}\left(\sum\f\right)-\lcf_{i-1}\right\}}{f_{i}}\cdot\cwidth\tabularnewline\hline
\end{tabular}\vspace{.5em}
\textbf{\large Measures of Dispersion:}\vspace{.2em}\newline
\hspace*{-.3in}\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{.34\textwidth}<{$}||>{\centering$\displaystyle}m{.28\textwidth}<{$}||>{\centering$\displaystyle}m{.42\textwidth}<{$}|}\hline
\rowrule A.D.=\frac{\sum\left|\X-\pmean\right|}{\np}\ \mbox{or}\ \frac{\sum\left|\X-\smean\right|}{\ns} & & \tabularnewline\hline
\rowrulelarge\pdev=\sqrt{\frac{\sum\left(\X-\pmean\right)^{2}}{\np}} & & \tabularnewline
\rowrulelarge\pdev=\sqrt{\frac{\sum\X^2}{\np}-\left[\frac{\sum\X}{\np}\right]^2} &
\pdev=\sqrt{\frac{\sum\f\X^2}{\sum\f}-\left[\frac{\sum\f\X}{\sum\f}\right]^2} &
\pdev=\sqrt{\frac{\sum\f\X^2}{\sum\f}-\left[\frac{\sum\f\X}{\sum\f}\right]^2}\tabularnewline
\rowrulelarge\sdev=\sqrt{\frac{\sum\left(\X-\smean\right)^2}{\ns-1}} & & \tabularnewline
\rowrulelarge\sdev=\sqrt{\frac{\sum\X^2-\frac{\left(\sum\X\right)^2}{\ns}}{\ns-1}}&
\sdev=\sqrt{\frac{\sum\f\X^2-\frac{\left(\sum\f\X\right)^2}{\sum\f}}{\sum\f-1}} &
\sdev=\sqrt{\frac{\sum\f\X^2-\frac{\left(\sum\f\X\right)^2}{\sum\f}}{\sum\f-1}}\tabularnewline \hline
\ranges
\end{tabular}\vspace{.5em}
\ifthenelse{\boolean{heavy}}{
\textbf{\large Other Statistical Measures:}\vspace{.2em}\newline
\hspace*{-.3in}\begin{tabular}{|*{2}{>{\centering$\displaystyle}m{.54\textwidth}<{$}}|}\hline
\rowrule \GM=\left[\sqrt[n]{F_1F_2F_3\ldots F_n}-1\right]\cdot 100 &
 \GM=\left(\sqrt[n]{\frac{\mbox{Final}}{\mbox{Initial}}}-1\right)\cdot 100 \tabularnewline 
\rowrule \Xw=\frac{\sum\W\X}{\sum\W} & 
 \Z = \frac{\X-\pmean}{\pdev}\ \ \mbox{or}\ \ \Z = \frac{\X-\smean}{\sdev} \tabularnewline
\rowrule \CV = \frac{\pdev}{\pmean}\cdot 100\ \ \mbox{or}\ \ \CV = \frac{\sdev}{\smean}\cdot 100 &
 \Sk=\frac{3\left(\pmean-\mbox{Median}\right)}{\pdev}\ \ \mbox{or}\ \ \ \Sk=\frac{3\left(\smean-\mbox{Median}\right)}{\sdev} 
\tabularnewline \hline
\end{tabular}\vspace{.5em}
\textbf{\large Miscellaneous Formulae:}\vspace{.2em}\newline
\hspace*{-.3in}\begin{tabular}{|>{\centering$\displaystyle}m{.34\textwidth}<{$}>{\centering$\displaystyle}m{.35\textwidth}<{$}>{\centering$\displaystyle}m{.35\textwidth}<{$}|}\hline
\rowrulesmall R= \X_n - \X_1 & N = 1 + \log(n)/\log(2) & \cwidth = \frac{R}{N} 
\tabularnewline
\multicolumn{3}{|c|}{\rowrule$\displaystyle\rel=\frac{\f}{\sum\f}$\hfill$\displaystyle\p=\frac{\rel}{\cwidth}$\hfill$\displaystyle F=1+\frac{\%\ \mbox{change}}{100}$\hfill$\displaystyle 1-\frac{1}{k^2}$} \tabularnewline
\hline
\end{tabular}
}{}
% Print the license
\gfdlsinglenewpage
\end{document}
% TODO:
% Add back in the questions about distinguishing which type of average
% is appropriate.  Perhaps add weighted mean and geometric mean in the mix.
% Fix case study indentation in answers. (Currently it is hacked.)
% I should add back in the original diagram for the Geometric mean
% with starting and final value given.
% Add a weighted mean problem or two.
% Add diagram about the relative location of mean, median, mode for skewed
% distribution.
% Add textbook refs and fix the \reading command to do something appropriate
% like put the ref in the margin.  Currently the \reading refs go to the
% 12th edition of Freund.
% Make a routine for histograms
% in lectures.sty so I don't need to see the asy code in my document.
% Remove old bitmap diagrams.
