Question: 4 . Using the college.csv dataset Perform a Simple Linear Regression of Top 1 0 perc as the independent variable to graduation rate as the

4.
Using the college.csv dataset
Perform a Simple Linear Regression of Top10perc as the independent variable to graduation rate as the dependent variable - show all code to answer the following questions.
Create a data frame called X that drops Grad.Rate (since this is the dependent variable). Alternatively, you can create a new X dataframe that is only comprised of the dependent variable Top10perc. Whichever way you go, you will only be using the single independent variable.
Create a Series called y that is the Grad.rate feature.
Perform an 80/20 test train split resulting in X_train X_test, y_train and y_test
Train and test the model.
Show the coefficient and intercept
Show R^2 and RMSE - interpret these.
Show a line chart with datapoints and the regression line. Title and label accordingly.
7.
Leveraging the X and y defined in Question 4, perform a multiple linear regression.
Perform label encoding for any categorical features. You will need to drop any categorical features after this step since linear regression operates on numerical data.
Perform an 80/20 test train split resulting in X_train X_test, y_train and y_test
Use all features perform the regression
Train and test the model.
Provide R^2
P-values
F-Statistic
Coefficients and intercept
Interpret results.

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 Finance Questions!