% 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} %,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.6in} \setlength{\textwidth}{6.9in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0in} \setlength{\headsep}{-1in}
\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 23, 2003}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 312: Lecture 12\\
Testing on Population Proportion}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
\date{Feb 20, 2003}
% For two authors (default example)
\maketitle
\thispagestyle{empty}
\section*{Concepts}
\begin{enumerate}
\item Testing mean $\mu$ when the sample size is large.
$$H_0: \mu=\mu_0 \mbox{ vs. } H_1: \mu < \mu_0$$ Test statistic:
$z=\frac{\bar x -\mu_0}{s/\sqrt{n}}.$ Rejection region for level
$\alpha$ test: $z \leq -z_{\alpha}.$
\item Let $p$ be the proportion of a population with a specified
property. Large-sample level $\alpha$ test for
$$H_0: p = p_0 \mbox{ vs. } H_1: p < p_0$$
test statistic: $z=\frac{\hat p-p_0}{\sqrt{p_0(1-p_0)/n}}.$\\
rejection region: $z < -z_{\alpha}.$

\item The $P$-value is the smallest level of significance at which
$H_0$ would be rejected.\\
$P$-value $\leq \alpha \to$ reject $H_0$ at level $\alpha$.\\
$P$-value $> \alpha \to$ do not reject $H_0$ at level $\alpha$.\\
The smaller the $P$-value, the easier to reject $H_0$.
\end{enumerate}
\section*{In-class problems}

Example 8.11. 47 out of 102 doctors did not know the generic name
for the drug methadone. Can you conclude that fewer than half of
all doctors know the generic name for methadone? Test it at 1$\%$
level.
\begin{verbatim}
> p<-47/102
> (p-0.5)/sqrt(0.5*0.5/102)
[1] -0.792118
> qnorm(0.01)
[1] -2.326348
\end{verbatim}
%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.5]{chi.eps}
%\caption{$t_{1000}}
%\end{figure}

Assume the IQ of a dog follows normal. The IQs of 10 dogs are
measured: 30, 25, 70, 110, 40, 80, 50, 60, 100, 60. Find the
$P$-value for testing
$$H_0: \mu = 100 \mbox{ vs. } H_1: \mu < 100$$
\begin{verbatim}
> t=(mean(x)-100)/(sd(x)/sqrt(10))
> t
[1] -4.205156
> qt(c(0.001,0.002,0.003),9)
[1] -4.296806 -3.834510 -3.572577
> pt(-4.205156,9)
[1] 0.001144577
> t.test(x,mu=100,alternative="less",
 conf.level=0.95)
        One Sample t-test
 data:  x t = -4.2036, df = 9,
 p-value = 0.001147
 alternative hypothesis: true mean is
 less than 100
 95 percent confidence interval:
    -Inf 78.8531
 sample estimates: mean of x 62.5
\end{verbatim}
Three options for \texttt{alternative:less, greater, two.sided}.\\
Find the $P$-value for testing
$$H_0: \mu = 100 \mbox{ vs. } H_1: \mu \neq 100$$

\section*{Self-study problems}
Exercise 8.35., Example 8.17., Find the $P$-value for testing
$$H_0: \mu = 100 \mbox{ vs. } H_1: \mu > 100$$
\section*{Assignment 4.}
Due March 13. 11:00am. 8.24., 8.26, 8.28., 8.36. (a) and (b) only,
8.38.\\
\end{document}
