Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (30 points) Load the mtcars data in R. Consider mpg to be the response variable, and all other variables as features (a) Make a

image text in transcribed

1. (30 points) Load the mtcars data in R. Consider mpg to be the response variable, and all other variables as features (a) Make a scatterplot matrix between mpg and all other features in the data. Additionally, compute the correlation coefficient between mpg and all other features in the dataset. (The two things can be done simultaneously with a single function.) What are the two features most strongly correlated with mpg? (Don't forget that correlation can be positive or negative so you should use the absolute value.) (b) Fit two simple linear regression models: Model 1 using the strongest features from (a) and model 2 using the second strongest feature from (a). Report the linear regression formula i.e., report the line equations) and the value of R from the two models. If you had to choose between these two models, which one would you choose and why? (c) Fit a multiple linear regression model with all features. Which features are significant in this model? What is the value of R in this models? (d) Using stepAIC identify the best subset of features. Fit a multiple linear regression model using the best subset of features. Write down the regression formula and R2 for this model. Are any of the features from (a) included in this model? Do they have the same coefficients as they had in model 1 or model 2 from (b)? If the coefficient values have changed, explain why 1. (30 points) Load the mtcars data in R. Consider mpg to be the response variable, and all other variables as features (a) Make a scatterplot matrix between mpg and all other features in the data. Additionally, compute the correlation coefficient between mpg and all other features in the dataset. (The two things can be done simultaneously with a single function.) What are the two features most strongly correlated with mpg? (Don't forget that correlation can be positive or negative so you should use the absolute value.) (b) Fit two simple linear regression models: Model 1 using the strongest features from (a) and model 2 using the second strongest feature from (a). Report the linear regression formula i.e., report the line equations) and the value of R from the two models. If you had to choose between these two models, which one would you choose and why? (c) Fit a multiple linear regression model with all features. Which features are significant in this model? What is the value of R in this models? (d) Using stepAIC identify the best subset of features. Fit a multiple linear regression model using the best subset of features. Write down the regression formula and R2 for this model. Are any of the features from (a) included in this model? Do they have the same coefficients as they had in model 1 or model 2 from (b)? If the coefficient values have changed, explain why

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions