% 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 14\\
Large sample test}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
\date{October 28, 2004}
% For two authors (default example)
\maketitle \thispagestyle{empty}
\begin{enumerate}
\item Testing mean $\mu$ with unknown variance $\sigma^2$.
$$H_0: \mu=\mu_0 \mbox{ vs. } H_1: \mu < \mu_0$$ Test statistic:
$t=\frac{\bar x -\mu_0}{s/\sqrt{n}}.$ Rejection region for level
$\alpha$ test: $z \leq -t_{\alpha,n-1}.$

Ex. IQ of a dog, $X_i \sim N(\mu, \sigma^2),$ where $\sigma$ is
unknown. Test
$$H_0: \mu = 100 \mbox{ vs. } H_1: \mu < 100$$
at level $\alpha = 0.05$.
\begin{verbatim}
> x<-c(30, 25, 70, 110, 40, 80, 50, 60,
100, 60)
> t=(mean(x)-100)/(sd(x)/sqrt(10))
> t
[1] -4.205156
> qt(0.05,9)
[1] -1.833113
\end{verbatim}
A simpler method is to use command {\tt t.test}.
\begin{verbatim}
>help(t.test)
...
t.test(x,alternative=c("two.sided", "less",
       "greater"),conf.level = 0.95)
...
> 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}
%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.5]{chi.eps}
%\caption{$t_{1000}}
%\end{figure}


\item Testing on 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. Assume the sample size to be large ($n > 40$).
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}.$ Example 8.11. 47 out of 102
doctors did not know the generic name for the drug methadone.What is
methadone? Methadone is a rigorously well-tested medication that is
safe and efficacious for the treatment of narcotic withdrawal and
dependence. 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}
\item Small sample size. Example 8.13.
\begin{verbatim}
> pbinom(15,20,0.9)
[1] 0.04317450
> pbinom(16,20,0.9)
[1] 0.1329533
\end{verbatim}
\end{enumerate}
{\bf Homework V.} Due Nov 11. 9:30pm. Exercise 8.18, 8.24, 8.26,
8.32, 8.38, 8.40. Second midterm (Nov 18) will cover Homework III.
IV. and V. materials.



\end{document}
