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
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
anscombe data in
R. Attach the table using the command
Plot the 4 data sets
(x1,y1), (x2,y2), (x3,y3), (x4,y4) on a 2-by-2 grid of plots using the commands
Add the number of the dataset to each plot as the main title on each plot.
Fit a regression model to the data sets:
y1 ~ x1
y2 ~ x2
y3 ~ x3
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
y reversed. Using the command
summary, does anything about the results stay
the same when you reverse
Compute the $SSE, SST$ and $R^2$ value for each data set. Use the
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.
x1 x2 x3 x4 y1 y2 y3 y4 1 10 10 10 8 8.04 9.14 7.46 6.58 2 8 8 8 8 6.95 8.14 6.77 5.76 3 13 13 13 8 7.58 8.74 12.74 7.71 4 9 9 9 8 8.81 8.77 7.11 8.84 5 11 11 11 8 8.33 9.26 7.81 8.47 6 14 14 14 8 9.96 8.10 8.84 7.04 7 6 6 6 8 7.24 6.13 6.08 5.25 8 4 4 4 19 4.26 3.10 5.39 12.50 9 12 12 12 8 10.84 9.13 8.15 5.56 10 7 7 7 8 4.82 7.26 6.42 7.91 11 5 5 5 8 5.68 4.74 5.73 6.89