% 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 15\\
$P$-values}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
\date{November 2, 2004}
% For two authors (default example)
\maketitle \thispagestyle{empty}
\begin{enumerate}


\item The $P$-value is the smallest level of significance at which
$H_0$ would be rejected.\\

Example 8.5, 8.15. Nicotine contents $X_1,\cdots X_{32}$ of
cigarettes follow $N(\mu,0.2^2)$. We are interested in testing if
$$H_0: \mu = 1.5 \mbox{ vs. } H_1: \mu > 1.5.$$
Assume $\bar x = 1.57$. Given $\alpha$ level, the corresponding
rejection regions are given by
\begin{verbatim}
> -qnorm(0.05)
[1] 1.644854
> -qnorm(0.025)
[1] 1.959964
> -qnorm(0.01)
[1] 2.326348
> -qnorm(0.005)
[1] 2.575829

> (1.57-1.5)/(0.2/sqrt(32))
[1] 1.979899

> 1-pnorm(1.979899)
[1] 0.02385744
\end{verbatim}


\item $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$.


Example. Dog IQ example.
\begin{verbatim}
> 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}

\item P-value computation for two sided tests. Let us continue the
nicotine content example and find the P-value for testing
$$H_0:\mu = 1.5 \mbox{ vs. } H_1:\mu \neq 1.5.$$

\begin{verbatim}
> 2*(1-pnorm(1.979899))
[1] 0.04771488
\end{verbatim}
\end{enumerate}

{\em Review Problems.} Example 8.17., 8.18.

\end{document}
