Question: Read the data from the mpg.csv file into a tibble and display the data. 2. Drop any rows that contain missing values. 3. Split the

Read the data from the mpg.csv file into a tibble and display the data. 2. Drop any rows that contain missing values. 3. Split the data into training and testing data sets where the testing data set consists of 20% of the total data. 4. Using the training data set, get the r-values for the correlations between the mpg variable and all of the other numeric variables. 5. Using the training data set, plot the relationship between the mpg variable and the numeric variable with the strongest linear correlation. 6. Create a linear regression model and fit it to the training data set. 7. Use the tidy() function to view more information about the model. 8. Add predictions to the testing data using the model and store the results in a new tibble. 9. Using the testing data, plot the actual values and predicted values. Use black for the actual values and red for the predicted values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!