% 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[12pt,twocolumn]{article} %,twocolumn
%\usepackage[dvips]{graphicx,graphics}
%\usepackage{times,amsmath,amsfonts}

% Use following instead for LaTex 2.09 (may need some other mods as well).
% \documentstyle[times,twocolumn]{article}

% Set dimensions of columns, gap between columns, and paragraph indent
\setlength{\textheight}{9.2in} \setlength{\textwidth}{6.875in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0in} \setlength{\headsep}{-1in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.1875in}  % Centers text.
\setlength{\evensidemargin}{-.1875in}

% 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 23, 2003}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 312: Lecture 7\\
 Confidence Intervals III.}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
% For two authors (default example)
\maketitle
\thispagestyle{empty}
\section*{Concepts}
\begin{enumerate}

\item If $n$ is sufficiently large, approximate $100(1-\alpha)\%$
confidence interval for $\mu$ is $\bar x \pm z_{\alpha/2}s/\sqrt{n}$,
 where $s$ is the sample standard deviation.

\item Let $p$ denote the proportion of an individual with a
specified property. $100(1-\alpha)\%$ CI for a {\em population
proportion} $p$ is
$$\hat p \pm z_{\alpha/2}\sqrt{\hat p \hat q/n}.$$
\item One-sided confidence interval:
An upper confidence bound for $\mu$ is
$$\mu < \bar x + z_{\alpha}s/\sqrt{n}$$
and a lower confidence bound for $\mu$ is
$$\mu > \bar x - z_{\alpha}s/\sqrt{n}.$$
\end{enumerate}

\section*{In-class problems}
{\bf Ex.} Toss $n=100$ biased coins with $P(H)=p$. Suppose you
observe 38 heads. Construct 95$\%$ CI of $p$.
\texttt{rbinom(n,1,p)} will generate a Bernoulli random sample of
size $n$ with $P(X_i=1)=p$.
\begin{verbatim}
> X<-rbinom(100,1,0.4)
> X
  [1] 1 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0
 [17] 0 0 1 1 0 1 0 1 1 0 1 0 1 0 1 0
 [33] 1 1 0 0 0 0 1 0 1 0 0 0 0 0 1 0
 [49] 0 1 0 0 0 0 1 1 0 1 0 1 1 0 0 1
 [65] 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0
 [81] 1 0 1 0 0 1 1 0 0 0 1 0 0 1 1 1
 [97] 0 1 1 0
> sd(X)
[1] 0.4878317
> 0.38+1.96*0.49/sqrt(100)
[1] 0.47604
> 0.38-1.96*0.49/sqrt(100)
[1] 0.28396
\end{verbatim}
%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.3]{box7.6.ps}
%\caption{Box plot}
%\end{figure}
Exercise 7.23. Use Concept 2.\\
When 37 helmets were subjected to a certain impact test, 24
showed damage. Let $p$ denote the proportion of helmets that
would show damage under the test. Find a $99\%$ CI for $p$.

\section*{Self-study problems}
Example 7.8., 7.8. Use Concept 2.
\end{document}
