% 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]{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}{8in} \setlength{\textwidth}{6.875in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0.7in} \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{Stat312: Final Exam}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
% For two authors (default example)
\maketitle
\thispagestyle{empty}
\begin{center}
\small
Answer all questions clearly and {\bf circle your final answer}.\\ 
Your answers should be correct up to the {\bf second decimal places}.\\
One page note and a calculator are allowed.\\
No textbooks, scrap papers or hand-held computers are allowed.\\ 
All variables that are introduced should be defined.\\
This exam booklet consists of {\bf five problems} and {\bf eleven pages}.\\
\vspace{1cm}
\large
{\bf Name:}\underline{\hspace{10.5cm}}\\
{\bf Student ID:}\underline{\hspace{10cm}}\\

\normalsize
\vspace{1cm}
Pledge: On my honor, I have neither given nor received unauthorized\\
aid on this examination.\\
\vspace{1cm}
\large
{\bf Signature:}\underline{\hspace{10cm}}\\
\vspace{1cm}

\begin{tabular}{|r|l|c|}\hline
Question & Points}\\
\hline
1 & \\
\hline
2 & \\
\hline
3 & \\
\hline
4&\\
\hline
5&\\
\hline
%4 & \\
%\hline
Total & \\
\hline
\end{tabular}
\end{center}

\newpage

Please use the following R output in answering the appropriate
exam problems.

\begin{verbatim}
> qnorm(c(0.99,0.975,0.95,0.925,0.9))
[1] 2.33, 1.96, 1.64, 1.44, 1.28
> qt(c(0.99,0.975,0.95,0.925,0.9),2)
[1] 6.96 4.303 2.92 2.28 1.89
> qt(c(0.99,0.975,0.95,0.925,0.9),3)
[1] 4.54 3.18 2.35 1.92 1.64
> qt(c(0.99,0.975,0.95,0.925,0.9),4)
[1] 3.75 2.77 2.13 1.78 1.53
> qchisq(c(0.99,0.975,0.95,0.925,0.9),2)
[1] 9.21 7.38 5.99 5.18 4.60
> qchisq(c(0.99,0.975,0.95,0.925,0.9),3)
[1] 11.34  9.35  7.81  6.90  6.25
> qchisq(c(0.99,0.975,0.95,0.925,0.9),4)
[1] 13.28 11.14  9.49  8.50  7.78
\end{verbatim}

\newpage
\begin{enumerate}

\item We wish to fit paired sample $(x_1,y_1)$, $\cdots$, $(x_n,y_n)$ with a linear regression model $Y=c x + \epsilon$. We assume that $\epsilon$ follows a normal distribution with zero mean and variance $\sigma^2$.
 \begin{itemize}
\item[(a)] Estimate $c$ by minimizing the sum of the squared residuals (5pts).

\item[(b)] Write the log-likelihood function as a function of $c$ and $\sigma$ (5pts).
\newpage
\item[(c)] Find the likelihood estimator of $c$ by differentiating the log-likelihood function in (b). Derive everything (5pts).
\item[(d)] Either prove or disprove unbiasedness of the estimator you computed in (c) (5pts, no point given if (c) is incorrect).
\newpage
\item[(e)] Compute the variance of the estimator you computed in (a) (5pts, no point given if (a) is incorrect).
 
\item[(f)] If the sample correlation coefficient of the above paired data is $0.5$, what is the sample correlation correlation coefficient of data $(x_1 -\bar x,y_1 -\bar y), \cdots, (x_n -\bar x, y_n -\bar y)$?  $\bar x$ and $\bar y$ are the respective sample means of $x_i$'s and $y_i$'s. Prove your result (5pts).

\end{itemize}
\newpage

\item When you throw a coin 10 times, you observed 3 heads. Test if the coin is biased at $\alpha=0.2$. Clearly state appropriate parameters, hypotheses, a test statistic. You may use the following R output (15pts).
\begin{verbatim}
> pbinom(0:5,10,0.5)
 [1] 0.00 0.01 0.06 0.17 0.38 0.62
\end{verbatim}

\newpage
\item A manufacturer of automatic washers offers a particular model in one of three colors: white, green and blue. Of the 100 washers sold, 40 were white, 35 green, 25 blue. In each of the subsequent questions, clearly state appropriate parameters, hypotheses, a test statistic and its distribution under the null assumption.


\begin{itemize}
\item[(a)] Would you conclude that customers have no preference? Test it at $\alpha=0.05$ (10 pts).
\newpage
\item[(b)] Would you conclude that customers have a preference for white color? Test it at $\alpha=0.05$ (10 pts). 
\end{itemize}
\newpage

\item A quality control engineer has measured the numbers of defectives per day from a certain production process for 50 days and recorded below. Test if the number of defectives follows a binomial distribution at $\alpha=0.05$. (20pts).
\begin{center}
\begin{tabular}{|c|c|}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  number of defects & frequencies\\
  \hline
0 &10\\ \hline
1 &24\\ \hline
2 &10\\ \hline
3 &6\\ \hline
\end{tabular}\\
\end{center}


%\item Aptitude tests should produce scores with a lrage amount of variations to distinguish between persons with a low aptitude and pwersons with high aptitude. The standard test used by a certain industry produce scores with a mean of 100 points and a standard devation of 10 points. A new test is developed and was given to 5 prospective employees and produced a mean of 110 points and a sample standard devation of 12 points. Are scores from the new test significant more variable than scores from the standard? Test your claim at $\alpha=0.05$ (10pts).\\

%{\em Solution.} The hypotheses of interest is whether $H_0: \sigma^2 =10$ vs. $H_1: \sigma^2 >10$. Note that

\newpage 
\item Problem on the coefficient of determination.
\begin{itemize}
\item[(a)] The following it the R output of a regression analysis based on linear model $Y=\beta_0 + \beta_1 x + \epsilon$ for 11 paired data $(x_i,y_i)$. Compute the coefficient of determination and the coefficient of correlation (5pts).
\begin{verbatim}
>summary(lm(y~x))
Call:
lm(formula = y ~ x)
Residuals:
     Min       1Q   Median       3Q      Max
     -12     -6.6    -0.28     7.64    10.06
Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)           -14  16.1  -0.889      0.4
x                       7     1     3      0.001 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
\end{verbatim}

\newpage
\item[(b)] It is shown during the lecture that the coefficient of determination is always between 0 and 1. Prove it (15pts).\\



\end{itemize}


\end{enumerate}


\end{document}
