Homeworks 2-3
- Due Jan 31, 2019 by 4pm
- Points 4
Homework 2:
There will be another short R assignment due next week. Following section 3.6.3, run the function lm on the Boston housing data, but remove the 3 predictors whose p-values suggest they are least meaningful. Send a screenshot of what is displayed when you run summary(lm.fit). It should be very similar to what is displayed at the top of page 114.
Also answer the following question: Which of the quantities changed the most when you removed those three predictors, RSE, R^2, or F-statistic?
Homework 3:
1. Using calculus, deduce the formula in (3.38) (page 121) in the special case n = 4. Show this is the only critical value of beta, and that a local minimum occurs there. (I don't plan for us to do many questions like this, but this one is easy and really helps to make the formula look less random. If you're not sure what to do, ask on Piazza!)
2. Solve exercise 13 in Chapter 3. Use set.seed(3) at the beginning to get reproducible results. Submit (either by printing out or by emailing) the three scatterplots as well as your answer for part (j). Tell me also what values you used to generate the vector y with the noisier and the less noisy data.
3. Solve exercise 15ab in Chapter 3. For 15a, I wrote a for loop I'm not very satisfied with to automate checking the p-values for the different predictors. I've posted it on our Piazza page:
piazza.com/uci/winter2019/math199bdavis
Please let me know how my code could be improved (this quarter is my first serious time using R and there are a lot of basics I don't know). Submit a few plots from this question from 15a (none of them will look particularly linear) as well as a written explanation of your result from part 15b.