Linear Regression on the “Auto” Data Set.

Textbook: An Introduction to Statistical Learning with Applications in R

Use python instead for the below questions. Data sets will be shared with tutor later. I do have solutions in R, need help to translate to Python.

Don't use plagiarized sources. Get Your Custom Essay on
Linear Regression on the “Auto” Data Set.
Just from \$13/Page

Chapter 3 Exercise 9

This question involves the use of multiple linear regression on the “Auto” data set.

• Produce a scatterplot matrix which include all the variables in the data set.
• Compute the matrix of correlations between the variables using the function cor(). You will need to exclude the “name” variable, which is qualitative.
• 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:
• Is there a relationship between the predictors and the response?
• Which predictors appear to have a statistically significant relationship to the response?
• What does the coefficient for the “year” variable suggest?
• 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 plots identify any observations with unusually high leverages?
• Use the * and : symbols to fit linear regression models with interaction effects. Do any interactions appear to be statistically significant?

ORDER NOW »»

and taste our undisputed quality.