2. Consider the data set has four variables which are Y, X1, X2
and X3. Construct a multiple regression
model using Y as response variable and other X variables as
explanatory variables.
(a) Write mathematics formulas (including the assumptions) and give
R commands to obtain linear
regression models for Y Xi, i =1, 2 and 3.
(b) Write several lines of R commands to obtain correlations
between Xi and Xj , i 6= j and i, j =
1, 2, 3.
(c) Give R commands to construct the correlation matrix for all X
variables
(d) Give commands to do the multiple regression for the full model
Y X1 + X2 + X3.
(e) Give the simple R command to do model selection automatically
for the reduced model
Get Answers For Free
Most questions answered within 1 hours.