```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, include = TRUE,
fig.align="center",warnings = FALSE,fig.width = 5,fig.height=3)
```

For the problems in which calculations are needed, please include your R code with your answers, otherwise you will not be given full credit.  Please upload your assignment by Thursday, February 10, 11:59 pm in a html/pdf/word file to Sakai.

- 1. Suppose I have a dataset, for which I perform a simple linear regression of $Y$ on $X$.

-- a. I obtain a least squares regression line of $\hat{Y} = 4.95 - 1.6X$ with standard error values $s_{\hat{\beta}_0} = 0.156$ and $s_{\hat{\beta}_1} = 0.175$.  Suppose I wish to test for a significant linear relationship between $X$ and $Y$.  Find an appropriate test statitic for this hypothesis test.

-- b. I calculate 95% confidence and prediction intervals for our predicted value of $Y$ for $x = 2$, which gives us $\hat{Y}_{x=2} = 1.743$, and our two intervals (0.9245,2.563) and (-0.1767,3.664).  Which one is the prediction interval?  Explain your reasoning.

-- c. Now, suppose I wish to calculate a 95% confidence interval for the predicted value of $Y$ for $x = \bar{x}$.  Will this width of this confidence interval (the difference between upper and lower values of the interval) be larger or smaller?  Explain your reasoning.

- 2. Reconsider the dataset *AdRevenue.csv* as well as our simple linear regression model of ad revenue (in millions of dollars) based on circulation (in millions).

-- a. Calculate a 95% confidence interval for $\beta_1$.  Interpret this interval in the context of the problem.  
```{r}
```

-- b. Perform a hypothesis test for a linear relationship between ad revenue and circulation.  Be sure to properly state your hypotheses, your test statistic, p-value, and a decision and conclusion at $\alpha = 0.05$.
```{r}
```

-- c. What is the distribution of the test statistic in (b) under the null hypothesis?

-- d. Calculate a 95% confidence interval for the predicted ad revenue when there are 2.5 million subscriptions in circulation.  Interpret this interval in the context of the problem.
```{r}
```

-- e. Calculate a 95% prediction interval for a randomly selected magazine with 2.5 million subscriptions in circulation.  Interpret this interval in the context of the problem.
```{r}
```
