% This is a simple LaTex sample document that gives a submission format
%   for IEEE PAMI-TC conference submissions.  Use at your own risk.

% Make two column format for LaTex 2e.
\documentclass[10pt]{article} %
\usepackage[dvips]{graphicx,graphics,color}
\usepackage{times,amsmath,amsfonts}

\setlength{\textheight}{10in} \setlength{\textwidth}{6.875in}
\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0in} \setlength{\headsep}{0in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.2in}  % Centers text.
\setlength{\evensidemargin}{-.2in}

% Add the period after section numbers.  Adjust spacing.
\newcommand{\Section}[1]{\vspace{-8pt}\section{\hskip -1em.~~#1}\vspace{-3pt}}
\newcommand{\SubSection}[1]{\vspace{-3pt}\subsection{\hskip -1em.~~#1}
        \vspace{-3pt}}
\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand {\diff}[1] {\frac{\partial}{\partial #1}}
\newcommand{\jacob}[3]{\frac{\partial^2 #3}{\partial #1 \partial #2}}
\newcommand{\der}[2]{\frac{\partial #2}{\partial #1}}
\begin{document}

% Don't want date printed
\date{January 18, 2005}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 324: Lecture 01\\
Descriptive statistics}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}

% For two authors (default example)
\maketitle \thispagestyle{empty}
\begin{enumerate}

\item A {\em population} is a collection of object under
investigation. A {\em sample} is a subset of the population. The
{\em frequency} of any particular value is the number of times that
value occurs in the data set. The {\em relative frequency} of a
value is the proportion of times the value occurs.

\item Let us consider following multivariate data. It can be
downloaded from\\ {\tt
http://www.stat.wisc.edu/$\sim$mchung/teaching/data/312score.data}
\begin{verbatim}
score <-read.table("d:/stat324/312score.data",header=T)
> score
   mid1 mid2 hw final
1    93  100 97    96
2    96   97 98    94
3    96  100 98    86
....
48   24   87 90    22
49   56   80 28    33

>plot(score$mid1,score$mid2)
>hist(score$mid1)
\end{verbatim}
To find out more about {\tt hist} command, use\\ {\tt > help(hist)}.
It will display a new window with detailed information about {\tt
hist}.
\begin{figure}[h]
\centering
\includegraphics[width=50mm]{324.01.ps}
\includegraphics[width=50mm]{324.01.02.ps}
\includegraphics[width=50mm]{324.01.03.ps}
\caption{Left: scatter plot of miderm1 vs. midterm2, middle:
histogram of the first midterm, right: histogram of the final exam
score}\label{fig:hist}
\end{figure}

\item The {\em sample mean.} is a summary measure of location.
\begin{verbatim}
> mean(score$mid1)
[1] 74.10204
> mean(score$mid2)
[1] 87.57143
> mean(score$final)
[1] 54.42857
\end{verbatim}

\item The {\em sample variance} is a summary measure of variability.
\begin{verbatim}
> var(score$mid1)
[1] 552.6352
> sd(score$mid1)
[1] 23.50819
> sd(score$mid2)
[1] 10.56330
> sd(score$final)
[1] 19.04818
\end{verbatim}

\item The {\em sample median} is obtained by ordering from data from
smallest to largest and taking the middle value.
\begin{verbatim}
> median(score$final)
[1] 54
> boxplot(score$mid1,score$mid2,score$hw,score$final)
\end{verbatim}
\begin{figure}[h]
\centering
\includegraphics[width=80mm]{324.01.04.ps}
\caption{Boxplot of midterm, homework and final exam scores.}
\end{figure}

\item {\em Importing example and exercise data.}
In order to load Example 1.5 data into {\tt R}, follow the following
command lines. Data is the percentage of binge drinkers on 140
campuses across the United States.
\begin{verbatim}
> library(Devore6)
> data(xmp01.05)
>attach(xmp01.05)
> xmp01.05
    bingePct
1          4
2         11
.
.
.
.
140       68
\end{verbatim}
To load Exercise 1.14 data, use command {\tt >data(ex01.14)}.
\end{enumerate}

{\bf Assigned Problems} Exercise 1.24. Exercise 1.56. Use {\tt R} to
generate figures. Click {\tt R} figures with the right mouse button
to save and print them.

\end{document}
