\documentclass{article}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{eufrak}
%\numberwithin{equation}{section}

\newtheorem{theorem}{Theorem}%[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}


\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\begin{document}

\title{Correlation and Regression\footnote{\copyright 2019 Joseph C Watkins}}
\author{Worksheet 4}
\date{}
\maketitle

\begin{enumerate}
\item Observations made by the astronomer Edwin Hubble showed that the universe is expanding. If $v$ is the galaxy's recession from the Milky Way and $d$ is the distance to that galaxy, Hubble's law is the linear relationship.
$$v=H_0d.$$
$H_0$ is known as {\em Hubble's constant}. To estimate $H$, we use the data below, Distance in measured in millions of light years. Velocity is measured in thousands of miles per second.
\begin{center}
\begin{tabular}{lrr}
Cluster&Distance&Velocity\\ \hline
Virgo&22&0.8 \\
Pegasus&68&2.4\\
Perseus&108&3.2 \\
Coma Berenices&137&4.7\\
Ursa Major \#1&255&9.3 \\
Leo&315&12.0\\
Corona Borealis&390&13.4\\
Gemini&405&14.4 \\
Bootes&685&24.5 \\
Ursa Major \#2&700&26.0\\
Hydra&1100&38.0 \\ \hline
\end{tabular}
\end{center}

\begin{enumerate}
\item Provide a scatterplot of the data using $d$ as the explanatory variable
\item Determine corresponding the regression line, and report your estimate of Hubble's constant. (Note that the $y$-intercept is 0.)
\item Give the sum of the residuals. Note that it is not equal to zero.
\item Determine the equation for the regression line using $v$ as the explanatory variable.
\item Find the product of the slopes of the two regression lines.
\item How close are they are being the same line?  Explain your answer.
\end{enumerate}
\item Download  the data set {\tt mammals} by calling for {\tt library("MASS")}
\begin{enumerate}
\item Enter {\tt mammals} and describe the data set.
\item Plot the data with {\tt plot(mammals)} and describe the plot.
\item Give appropriate transformations of one or both of the variables that gives a scatterplot suitable for linear regression. Make a scatterplot of the transformed data and describe the plot.
\item Give the coefficients in the regression line of the transformed variables.
\item On average, how does brain size change with a doubling of body size?
\item Use {\tt data.frame} with {\tt mammals} and the residuals to give examples of mammal species with unusually large and unusually small brain size. (The {\tt order} command can be used to order the residuals from small to large keeping the rows of the data intact.)
\end{enumerate}
\end{enumerate}

\end{document}