% 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.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 10\\
Hypothesis testing}

% 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 The {\em null hypothesis} $H_0$ is a claim about the value of a
population parameter. The {\em alternate hypothesis} $H_1$ is a
claim opposite to $H_0$.
\item A {\em test of hypothesis} is a method for using sample data
to decide whether to reject $H_0$. $H_0$ will be assumed to be
true until the sample evidence suggest otherwise.
\item A {\em test statistic} is a function of the sample data on
which the decision is to be based.
\item A {\em rejection region} is the set of all values of a test statistic for which
$H_0$ is rejected.

\item {\em Type I error}: you reject $H_0$ when $H_0$ is
true. $P(\mbox{Type I error}) = P(\mbox{reject } H_0|H_0 \mbox{
true}) =\alpha.$ The resulting $\alpha$ is called the {\em
significance level} of the test and the corresponding test is
called a {\em level $\alpha$ test}. We will use test procedures
that give $\alpha$ less than a specified level (0.05 or 0.01).
\end{enumerate}

\section*{In-class problem}
I believe that dogs are as smart as people. Assume IQ of a dog
follows $X_i \sim N(\mu, 10^2)$. IQ of 10 dogs are measured: 30,
25, 70, 110, 40, 80, 50, 60, 100, 60. We want to test if dogs are
as smart as people by testing
$$H_0: \mu = 100 \mbox{ vs. } H_1: \mu < 100.$$
One reasonable thing one may try is to see how high the sample
mean is.
\begin{verbatim}
> x<-c(30, 25, 70, 110, 40, 80, 50, 60,
100, 60)
> mean(x)
[1] 62.5
\end{verbatim}
Since the average IQ of 10 dogs are lower than 100, one would be
inclined to reject $H_0$.

Let $\bar X$ be a test statistic and $R=(-\infty,90]$ to be a
rejection region. Let's compute the probability of making Type I
error based on this testing procedure. Under the assumption $H_0$
is true,
$$X_i \sim N(100,10^2).$$
Under this condition, $\bar X \sim N(100,10)$ and
$$\alpha = P(\bar X \leq 90).$$
\begin{verbatim}
> pnorm(90,100,sqrt(10))
[1] 0.0007827011
\end{verbatim}
By using this test procedure, it is highly unlikely to make Type I
error. Let's see what happens when we change the rejection region.\\
When $R=(-\infty,95]$, $\alpha = P(\bar X \leq 95).$
\begin{verbatim}
> pnorm(95,100,sqrt(10))
[1] 0.05692315
\end{verbatim}

When $R=(-\infty,99]$, $\alpha = P(\bar X \leq 99).$
\begin{verbatim}
> pnorm(99,100,sqrt(10))
[1] 0.3759148 \end{verbatim} The test procedure based on rejecting
$H_0$ if $\bar X \leq 99$ will produce huge Type I error. Why?

%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.5]{chi.eps}
%\caption{$t_{1000}}
%\end{figure}




\section*{Self-study problems}
Example 8.1., 8.2., 8.3., 8.4., 8.5. Do not compute $\beta$.
\end{document}
