**You may discuss homework problems with other students, but you have to prepare the written assignments yourself. Late homework will be penalized 10% per day.**

**Please combine all your answers, the computer code and the figures into one file, and submit a copy to your dropbox folder.**

**Grading scheme: 10 points per question, total of 30.**

**Due date: 11:59 PM January 16, 2015 (Friday evening).**

On Groundhog Day, February 2, a famous groundhog in Punxsutawney, PA is used to predict whether a winter will be long or not based on whether or not he sees his shadow. I collected data on whether he saw his shadow or not from here. I stored some of this data in this table.

Although Phil is on the East Coast, I wondered if the information says anything about whether or not we will experience a rainy winter out here in California. For this, I found rainfall data, and saved it in a table. To see how this was extracted see this notebook.

Make a boxplot of the average rainfall in Northen California comparing the years Phil sees his shadow versus the years he does not.

Construct a 90% confidence interval for the difference between the mean rainfall in years Phil sees his shadow and years he does not.

Interpret the interval in part 2.

At level, $\alpha = 0.05$ would you reject the null hypothesis that the average rainfall in Northern California during the month of February was the same in years Phil sees his shadow versus years he does not?

What assumptions are you making in forming your confidence interval and in your hypothesis test?

The data set on supervisor performance has information on an overall measure of
supervisor performance (`Y`

), as well as a measure of how often they give raises based on performance (`X4`

) as well as 5 other measures.

Create a boxplot of the supervisor rating

`Y`

, splitting the data based on the median of`X4`

.Compute the sample mean, sample standard deviation

`Y`

in the two groups.Create a histogram of

`Y`

within each group.Compute a 90% confidence interval for the difference in supervisor performance between the two groups. What assumptions are you making?

At level $\alpha=5\%$, test the null hypothesis that the average supervisor performance does not differ between the two groups. What assumptions are you making? What can you conclude?

Repeat the test in 5. using the function

`lm`

.

Use the

`anscombe`

data in`R`

. Attach the table using the command`attach`

.Plot the 4 data sets

`(x1,y1), (x2,y2), (x3,y3), (x4,y4)`

on a 2-by-2 grid of plots using the commands`plot`

and`par(mfrow=c(2,2))`

. Add the number of the dataset to each plot as the main title on each plot.Fit a regression model to the data sets:

a.

`y1 ~ x1`

b.

`y2 ~ x2`

c.

`y3 ~ x3`

d.

`y4 ~ x4`

using the command

`lm`

. Verify that all the fitted models have the exact same coefficients (up to numerical tolerance).Using the command

`cor`

, compute the sample correlation for each data set.Fit the same models in 3. but with the

`x`

and`y`

reversed. Using the command`summary`

, does anything about the results stay the same when you reverse`x`

and`y`

?Compute the $SSE, SST$ and $R^2$ value for each data set. Use the commands

`mean, sum, predict`

.Using the command

`summary`

, verify that all 4 models have exactly (up to numerical accuracy) the same $t$-statistics for testing the hypotheses $H_0:\beta_0=0$ and $H_0:\beta_1=0$.Using the command

`abline`

, replot the data, adding the regression line to each plot.

In [2]:

```
%%R
anscombe
```