$24
1. The Mandel data set in the alr4 package contains eight artificial observations in a response y and two predictors x1 and x2. Use this data set to do the following:
a. Write the multiple linear regression model y = Xβ + e in terms of the actual data. (In other words, write the model equation but substitute the response vector in place of y, the parameter vector in place of β, and the design matrix in place of X.)
b. Fit the model by calculating the OLS estimators using (X⊤X)−1X⊤y.
c. Calculate the estimate of 2 using ˆ ⊤ ˆ .
σ RSS = (y − Xβ) (y − Xβ)
d. Calculate the estimated variance-covariance matrix of the OLS estimators.
2. The wm2 data in the alr4 package contains windspeed data for a location in South Dakota where developers were considering siting a wind turbine. Variables measured were Date, CSpd (the windspeed at the site), RSpd (the windspeed at a nearby reference site), RDir (the wind direction at the reference site), and Bin (a discretization of RDir).
a. Fit the MLR model (using lm()) that uses CSpd as response and RSpd and RDir as predictors. Report the estimated model.
b. Provide an interpretation of the regression coefficients you reported in the estimated model, including the intercept.
c. Report the fitted model’s estimate for σ2 and use it to find the value of RSS.
d. Obtain the effects plot for each predictor.