\setcounter{ExampleCounter}{1}
A box plot is nothing more than a graph that shows the five number summary for a data set.  Its value is in showing where the data is clustered and where it is spread out.

\subsection{Basic Box Plots}
The following is a simple box plot:
\begin{center}
\begin{tikzpicture}
\begin{axis}[
ymax=2,
ymin=0,
xmin=39.9,
xmax=48.1,
y=1.5cm,
xticklabels={},
yticklabels={},
axis lines=none,
%ytick={1,2,3},
%yticklabels={Group A, Group B, Group C},
]
\addplot+[black,thick,
boxplot prepared={
lower whisker=41, lower quartile=44,
median=45,
upper quartile=46, upper whisker=47,
},
]
coordinates {}
[above]
node at
(boxplot box cs: \boxplotvalue{lower whisker},1)
{Min}
node at
(boxplot box cs: \boxplotvalue{lower whisker},-0.5)
{Lower Whisker}
node at
(boxplot box cs: \boxplotvalue{lower quartile},1)
{$Q_1$}
node at
(boxplot box cs: \boxplotvalue{median},1)
{$Q_2$}
node at
(boxplot box cs: \boxplotvalue{median},-0.5)
{Median}
node at
(boxplot box cs: \boxplotvalue{upper quartile},1)
{$Q_3$}
node at
(boxplot box cs: \boxplotvalue{upper whisker},1)
{Max}
node at
(boxplot box cs: \boxplotvalue{upper whisker},-0.53)
{Upper Whisker}
;

\end{axis}
\end{tikzpicture}\\
(of course, in an example, we'll include a labeled axis for scale)
\end{center}

Remember, each segment of this box plot contains a quarter of the data.

\begin{example}{Box Plot}
The following data are the number of pages in 40 books on a shelf.
\begin{center}
\begin{tabular}{c c c c c c c c c c}
136 & 140 & 178 & 190 & 205 & 215 & 217 & 218 & 232 & 234\\
240 & 255 & 270 & 275 & 290 & 301 & 303 & 315 & 317 & 318\\
326 & 333 & 343 & 349 & 360 & 369 & 377 & 388 & 391 & 392\\
398 & 400 & 402 & 405 & 408 & 422 & 429 & 450 & 475 & 512
\end{tabular}
\end{center}

Construct a box plot.\\

The five number summary (from calculator) is \\

\begin{tabular}{l}
Min $=$ 136\\
$Q_1 = $ 237\\
Med $=$ 322\\
$Q_3 = $ 395\\
Max $=$ 512
\end{tabular}

Therefore, the box plot looks like the following.
\begin{center}
\begin{tikzpicture}
\begin{axis}[
ymax=2,
y=1.5cm,
xtick={150,200,...,500},
xticklabels={150,200,...,500},
yticklabels={},
axis y line=none,
axis x line=bottom,
xmin=113,
xmax=525,
%ytick={1,2,3},
%yticklabels={Group A, Group B, Group C},
]
\addplot+[black,thick,
boxplot prepared={
lower whisker=136, lower quartile=237,
median=322,
upper quartile=395, upper whisker=512,
}, /pgf/number format/precision=0
]
coordinates {}
[above]
node at
(boxplot box cs: \boxplotvalue{lower whisker},1)
{\pgfmathprintnumber{\boxplotvalue{lower whisker}}}
node at
(boxplot box cs: \boxplotvalue{lower quartile},1)
{\pgfmathprintnumber{\boxplotvalue{lower quartile}}}
node at
(boxplot box cs: \boxplotvalue{median},1)
{\pgfmathprintnumber{\boxplotvalue{median}}}
node at
(boxplot box cs: \boxplotvalue{upper quartile},1)
{\pgfmathprintnumber{\boxplotvalue{upper quartile}}}
node at
(boxplot box cs: \boxplotvalue{upper whisker},1)
{\pgfmathprintnumber{\boxplotvalue{upper whisker}}}
;

\end{axis}
\end{tikzpicture}
\end{center}

Note how each of the four quarters has about the same range; this data isn't too bunched or spread out anywhere.
\end{example}

\begin{example}{Comparing Two Groups}
Test scores for a statistics class held during the day are
\begin{center}
\begin{tabular}{c c c c c c c c c c}
99 & 56 & 78 & 55 & 32 & 90 & 80 & 81 & 56 & 59\\
45 & 77 & 85 & 84 & 70 & 72 & 68 & 32 & 79 & 90
\end{tabular}
\end{center}

Test scores for a statistics class held during the evening are
\begin{center}
\begin{tabular}{c c c c c c c c c c}
98 & 78 & 68 & 83 & 81 & 89 & 88 & 76 & 65 & 45\\
98 & 90 & 80 & 84 & 85 & 79 & 78 & 98 & 90 & 25
\end{tabular}
\end{center}

Create side by side box plots to compare these two classes.
\begin{center}
\begin{tabular}{l l}
Day Class & Evening Class\\
\hline
\\
Min $=$ 32 & Min $=$ 25\\
$Q_1 = $ 56 & $Q_1 = $ 77\\
Med $=$ 74.5 & Med $=$ 82\\
$Q_3 = $ 82.5 & $Q_3 = $ 89.5\\
Max $=$ 99 & Max $=$ 98
\end{tabular}
\end{center}

\begin{center}
\begin{tikzpicture}
\begin{axis}[
ymax=3.5,
ymin=0,
y=1.5cm,
xtick={20,30,...,100},
xticklabels={20,30,...,100},
ytick={1,2.5},
yticklabels={Evening Class, Day Class},
axis y line=left,
axis x line=bottom,
xmin=20,
xmax=105,
%ytick={1,2,3},
%yticklabels={Group A, Group B, Group C},
]
\addplot+[black,thick,
boxplot prepared={draw position=2.5,
lower whisker=32, lower quartile=56,
median=74.5,
upper quartile=82.5, upper whisker=99,
},/pgf/number format/precision=0
]
coordinates {}
[above]
node at
(boxplot box cs: \boxplotvalue{lower whisker},1)
{\pgfmathprintnumber{\boxplotvalue{lower whisker}}}
node at
(boxplot box cs: \boxplotvalue{lower quartile},1)
{\pgfmathprintnumber{\boxplotvalue{lower quartile}}}
node at
(boxplot box cs: \boxplotvalue{median},1)
{\pgfmathprintnumber{\boxplotvalue{median}}}
node at
(boxplot box cs: \boxplotvalue{upper quartile},1)
{\pgfmathprintnumber{\boxplotvalue{upper quartile}}}
node at
(boxplot box cs: \boxplotvalue{upper whisker},1)
{\pgfmathprintnumber{\boxplotvalue{upper whisker}}}
;
\addplot+[black,thick,
boxplot prepared={draw position=1,
lower whisker=25, lower quartile=77,
median=82,
upper quartile=89.5, upper whisker=98,
},/pgf/number format/precision=0
]
coordinates {}
[above]
node at
(boxplot box cs: \boxplotvalue{lower whisker},1)
{\pgfmathprintnumber{\boxplotvalue{lower whisker}}}
node at
(boxplot box cs: \boxplotvalue{lower quartile},1)
{\pgfmathprintnumber{\boxplotvalue{lower quartile}}}
node at
(boxplot box cs: \boxplotvalue{median},1)
{\pgfmathprintnumber{\boxplotvalue{median}}}
node at
(boxplot box cs: \boxplotvalue{upper quartile},1)
{\pgfmathprintnumber{\boxplotvalue{upper quartile}}}
node at
(boxplot box cs: \boxplotvalue{upper whisker},1)
{\pgfmathprintnumber{\boxplotvalue{upper whisker}}}
;
\end{axis}
\end{tikzpicture}
\end{center}
\end{example}
\vfill
\pagebreak

\subsection{Box Plots with Outliers}
Outliers are unusual data points.  Sometimes outliers are the result of mistakes in recording the data; sometimes there really are out-of-the-ordinary observations.

There is a rule of thumb using box plots that can identify outliers.

\begin{proc}{Outliers}
\paragraph{Interquartile Range:} The range between $Q_1$ and $Q_3$: \[Q_3 - Q_1\]

\paragraph{Outliers:} Multiply the IQR by 1.5, and go that far below $Q_1$ and above $Q_3$; any data point outside those fences is an outlier.
\end{proc}

Sometimes box plots are drawn like in the previous examples, with no mention of outliers (the fences extend all the way to the minimum and maximum).  Other times, box plots show the outliers.

\begin{center}
\includegraphics[width=\textwidth]{BoxPlotOutlier}
\end{center}
\vfill
\begin{center}
\includegraphics[width=0.9\textwidth]{xkcdBoyfriend}\\
\hfill xkcd.com
\end{center}
\pagebreak

\begin{example}{Box Plot with Outliers}
Test scores for a statistics class held during the evening are
\begin{center}
\begin{tabular}{c c c c c c c c c c}
98 & 78 & 68 & 83 & 81 & 89 & 88 & 76 & 65 & 45\\
98 & 90 & 80 & 84 & 85 & 79 & 78 & 98 & 90 & 25
\end{tabular}
\end{center}

\begin{center}
\begin{tabular}{l}
Min $=$ 25\\
$Q_1 = $ 77\\
Med $=$ 82\\
$Q_3 = $ 89.5\\
Max $=$ 98
\end{tabular}
\end{center}

The interquartile range is
\[Q_3 - Q_1 = 89.5 - 77 = 12.5\]

Multiply this by 1.5: \[(1.5)(12.5) = 18.75\]

Subtract this from $Q_1$ and add it to $Q_3$ to get the fences:
\begin{align*}
Q_1 - 1.5IQR &= 77-18.75 = 58.25\\
Q_3 + 1.5IQR &= 89.5 + 18.75 = 108.25
\end{align*}

Therefore, any data point below 58.25 or above 108.25 is an outlier.  There are two points that fit this description: 25 and 45.  Draw the lower whisker to the lowest data point that is not an outlier: 65.
\begin{center}
\begin{tikzpicture}
\begin{axis}[
ymax=2,
ymin=0,
y=1.5cm,
xtick={20,30,...,100},
xticklabels={20,30,...,100},
axis y line=none,
axis x line=bottom,
xmin=20,
xmax=105,
%ytick={1,2,3},
%yticklabels={Group A, Group B, Group C},
]
\addplot+[black,thick,
boxplot prepared={draw position=1,
lower whisker=65, lower quartile=77,
median=82,
upper quartile=89.5, upper whisker=98,
},/pgf/number format/precision=0
]
coordinates {(1,25) (1,45)}
[above]
node at
(boxplot box cs: \boxplotvalue{lower whisker},1)
{\pgfmathprintnumber{\boxplotvalue{lower whisker}}}
node at
(boxplot box cs: \boxplotvalue{lower quartile},1)
{\pgfmathprintnumber{\boxplotvalue{lower quartile}}}
node at
(boxplot box cs: \boxplotvalue{median},1)
{\pgfmathprintnumber{\boxplotvalue{median}}}
node at
(boxplot box cs: \boxplotvalue{upper quartile},1)
{\pgfmathprintnumber{\boxplotvalue{upper quartile}}}
node at
(boxplot box cs: \boxplotvalue{upper whisker},1)
{\pgfmathprintnumber{\boxplotvalue{upper whisker}}}
;
\end{axis}
\end{tikzpicture}
\end{center}
\end{example}
\vfill
\pagebreak

\subsection{Drawing Box Plots with TI Calculator}
After entering the data, press \includegraphics[height=0.3in]{CalcStatPlotMenu} to access the \verb|STAT PLOT| menu.  Turn the first plot \verb|ON|, then select one of the two types of box plots (one with outliers and one without.

Then press \includegraphics[height=0.3in]{CalcGraphButton} and adjust the window to the appropriate maximum and minimum $x$ values.

\begin{center}
\includegraphics[width=3in]{CalcBoxPlot}
\end{center}

\vfill
\pagebreak



