\documentclass[11pt, oneside]{article}   	% use "amsart" instead of "article" for AMSLaTeX format
\usepackage[top=1in,bottom=0.5in]{geometry}                		% See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   		% ... or a4paper or a5paper or ... 
%\geometry{landscape}                		% Activate for rotated page geometry
%\usepackage[parfill]{parskip}    		% Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}				% Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
								% TeX will automatically convert eps --> pdf in pdflatex		
\usepackage{amssymb, amsmath}
\usepackage{hyperref}

%SetFonts

%SetFonts
%0.77652974 -0.94089785 -0.66666491 -0.04677145

\title{Stat 185 -  Quiz 4 \\
\large Friday, November 10}
\date{}							% Activate to display a given date or no date
\author{}

\begin{document}
\maketitle
\thispagestyle{empty}
\pagestyle{empty}
\vspace{-0.5in}

\begin{flushright}
Name:\underline{\hspace{2.2in}}
\end{flushright}

\noindent Please write complete solutions (answers with supporting work) to these problems separate paper.

\begin{enumerate}

	\item I've got two CSV files on my webspace that you can read into R as follows:
	\begin{verbatim}
	df1 = read.csv("http://www.marksmath.org/data/data1.csv")
	df2 = read.csv("http://www.marksmath.org/data/data2.csv")
	\end{verbatim}
	The first is a random sample of 38 books and their prices chosen from UNCA's bookstore. 
	The second is a random sample of 42 books and their prices chosen from Amazon.  
	We'd like to run a hypothesis test to explore if the average price of a text from UNCA's bookstore is the same as the average price of a text
	from Amazon.
	\begin{enumerate}
		\item Letting $\mu_U$ represent the average price of a text from UNCA's bookstore and $\mu_A$ represent the average price of a text from Amazon,
		write down the null and alternative hypotheses for this problem.
		\item Use the \texttt{head} command to identify the column names in the data files. Write down those names as your answer to this part. \\
		Remember that you'll 
		type something like \texttt{df2\$column\_name} to refer to the data in a column of a data frame, where \texttt{column\_name} is the name of the column that you
		found by examining the \texttt{head} of the data.
		\item Use the \texttt{t.test} command to perform your hypothesis test. Write down the $p$-value and conclusion of the hypothesis test as your answer to this problem.
	\end{enumerate}
	
	\item In a sample of 13 Republicans, 8 were for issue 2 and 5 against. In a sample of 17 Democrats, 4 were for issue 2 and 13 against.
	Let's use this data to explore whether there is a genuine difference in the views of Democrats and Republicans on issue 2 to a 95\% level of confidence.
	\begin{enumerate}
		\item Compute the observed proportions $\hat{p}_R$ and $\hat{p}_D$, as well as the difference $$\hat{p} = \hat{p}_D-\hat{p}_R.$$
		\item Compute the standard error.
		\item Compute the test statistic.
		\item Use a command that looks something like \texttt{2*pt(-1.2,3)} to compute the $p$-value.
		\item State the conclusion of the test.
	\end{enumerate}


\end{enumerate}




\end{document}  
