% 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[11pt,twocolumn]{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{September 2, 2004}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 312: Lecture 01\\
R Basics}

% 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 {\em Data loading.} Let's illustrate basic R commands by
following example 1.5 about binge drinking in college. 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
3         13
.
.
.
.
138       67
139       67
140       68
\end{verbatim}

\begin{figure}
\centering
\includegraphics[width=70mm]{00-1.ps}
\caption{Histogram for binge drinker data}\label{fig:hist}
\end{figure}
\item {\em Histogram.} Let's see some basic R commands.
\begin{verbatim}
> a<-bingePct
> mean(a)
[1] 42.33571
> var(a)
[1] 205.8361
> sd(a)
[1] 14.34699
> hist(a)
\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}.

\item Binge drinking percentage can be modeled statistically. Let $X_i$ is the binge
drinking percentage at $i$-th campus which is distributed normally
with mean $40$ and standard deviation of $14$, i.e. $X_i \sim
N(40,14^2)$. Since binge drinking percentages in different campuses
should be independent, $X_i$'s should be assumed to be independent
random variables.

\item $X_1,\cdots, X_n$ form a {\em random sample} if $X_i$ are
independent and identically distributed random variables. A {\em
statistic} is a random variable. Hence {\em sample mean} $\bar X =
\sum_{i=1}^n X_i/n$ is a statistic. It will be distributed as
$$\bar X \sim N(40/140, 14^2/140).$$



{\em Note.} Read section 5.4, 5.5 and do Ex.5.48. 5.52. 5.63.
Lecture 2-4 will be based on sections 6.1-6.2.
\end{enumerate}

\end{document}
