Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in R-studio (25 points) This question involves the use of simple linear regression on the Auto dataset from the ISLR library. (a) (2 points) Load
in R-studio
(25 points) This question involves the use of simple linear regression on the Auto" dataset from the ISLR library. (a) (2 points) Load the dataset and show how many rows and columns exist in it. (Hint: You may need to install this library first.) (b) (2 points) Plot the horsepower versus mpg. (c) (8 points) Do you think that we can apply linear regression to predict the "mpg" value for a horsepower of 250? If so, apply simple linear regression to find this value using your own code (without using the built-in functions). (d) (4 points) Use the lm () function to perform a simple linear regression with mpg as the response and horsepower as the predictor. Use the summary () function to print the results. Comment on the output. (e) (3 points) Compare the results obtained in part (c) with that of the Im function obtained in (d). (f) (2 points) What is the predicted mpg associated with a horsepower of 98? You may use the predict" function or the equation of straight line obtained in (c). (g) (2 points) Plot the response and the predictor. Use the abline() function to display the least squares regression line. (h) (2 points) Do you think that simple linear regression best fit this data? If not, what is the other regression technique that may result in a better fitStep 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