R Programming

Using Rmarkdown to do it, and leave the code there. Each question need some sentences to describe the answer.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

This exercise involves the Boston housing data set.
To begin, load in the Boston data set. The Boston data set is
part of the MASS library in R.
>library(MASS)
Now the data set is contained in the object Boston.
> Boston
This question involves the use of multiple linear regression on the
Auto data set.
(a) Produce a scatterplot matrix which includes all of the variables
in the data set.
(b) Compute the matrix of correlations between the variables using
the function cor(). You will need to exclude the name variable, which
is qualitative.
(c) Use the lm() function to perform a multiple linear regression
with mpg as the response and all other variables except name as the
predictors. Use the summary() function to print the results.
Comment on the output. For instance:
i. Is there a relationship between the predictors and the response?
ii. Which predictors appear to have a statistically significant
relationship to the response?
iii. What does the coefficient for the year variable suggest?
(d) Use the plot() function to produce diagnostic plots of the linear
regression fit. Comment on any problems you see with the fit. Do the
residual plots suggest any unusually large outliers? Does the
leverage plot identify any observations with unusually high leverage?
(e) Use the * and : symbols to fit linear regression models with
interaction effects. Do any interactions appear to be statistically
significant?
(f) Try a few different transformations of the variables, such as
log(X), √X, X2. Comment on your findings.
This question should be answered using the Carseats data set.
(a) Fit a multiple regression model to predict Sales using Price,
Urban, and US.
(b) Provide an interpretation of each coefficient in the model. Be
careful—some of the variables in the model are qualitative!
(c) Write out the model in equation form, being careful to handle the
qualitative variables properly.
(d) For which of the predictors can you reject the null hypothesis
H 0 : β j = 0 ?
(e) On the basis of your response to the previous question, fit a
smaller model that only uses the predictors for which there is
evidence of association with the outcome.
(f) How well do the models in (a) and (e) fit the data?
(g) Using the model from (e), obtain 95% confidence intervals for the
coefficient(s).
(h) Is there evidence of outliers or high leverage observations in
the model from (e)?

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER