Question
Exercise 3. For this exercise use the Boston data set from the MASS package (you can read about this data set in the help menu).
Exercise 3. For this exercise use the Boston data set from the MASS package (you can read about this data set in the help menu). Consider the multiple linear regression model with medv as the response, and dis, rm, tax and chas as predictor variables.
(a) In R, compute the vector of least squares estimates = (X'X) ^-1X'Y . Then verify that the results are the same as the parameter estimates provided by the lm() function.
(b) In R, compute the variance-covariance matrix Var() = 2 (X'X)^-1 (plug in ^2 = RSS/(n p 1) as the estimate for ^2 ). Then verify that the square root of the diagonal entries of this matrix are the same as the standard errors provided by the lm() function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started