Question: For this question, use the program R (https://www.r-project.org/) to determine the simple linear regression on the 'Auto' data set. link to csv dataset: https://www.dropbox.com/s/rz085hmev62c8c2/Auto-rev.csv?dl=0 (a)
For this question, use the program "R" (https://www.r-project.org/) to determine the simple linear regression on the 'Auto' data set. link to csv dataset: https://www.dropbox.com/s/rz085hmev62c8c2/Auto-rev.csv?dl=0
(a) 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 to include in your submission. Comment on the output.
i. Is there a relationship between the predictor and the response? ii. How strong is the relationship between the predictor and the response? iii. Is the relationship between the predictor and the response positive or negative? iv. What is the predicted mpg associated with a horsepower of 98? What are the associated 95% confidence and prediction intervals?
(b) Plot the response and the predictor. Use the abline() function to display the least squares regression line. Include this graph.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
