Question
Part 1 College data set is available in ISLR Library. Load the College data in the R environment by loading the ISLR library. Description of
Part 1
College data set is available in ISLR Library. Load the College data in the R environment by loading the ISLR library.
Description of College data set available at ISLR Library:
Statistics for a large number of US Colleges from the 1995 issue of US News and World Report.
A data frame with 777 observations on the following 18 variables.
- Private A factor with levels No and Yes indicating private or public university
- Apps Number of applications received
- Accept Number of applications accepted
- Enroll Number of new students enrolled
- Top10perc Pct. new students from top 10% of H.S. class
- Top25perc Pct. new students from top 25% of H.S. class
- F.Undergrad Number of fulltime undergraduates
- P.Undergrad Number of parttime undergraduates
- Outstate Out-of-state tuition
- Room.Board Room and board costs
- Books Estimated book costs
- Personal Estimated personal spending
- PhD Pct. of faculty with Ph.D.s
- Terminal Pct. of faculty with terminal degree
- S.F.Ratio Student/faculty ratio
- perc.alumni Pct. alumni who donate
- Expend Instructional expenditure per student
- Grad.Rate Graduation rate
We will predict the number of applications received Apps using all other variables in the College data set and apply LASSO and Tree regression models and compare their performance (test MSE).
Part 1
LASSO
Predict the number of applications received Apps using all other variables in the College data set using LASSO model for variable selection:
- Split the data set randomly into training and test data set.
- Fit Lasso model using glmnet() function on the training data set.
- Perform cross-validation on the training data set to choose the best lambda.
- Estimate the predicted values using the best lambda obtained in part (c) on the test data (using the predict() function) and compute test MSE.
- Compare the Lasso predicted test MSE with the null model (lambda=infinity) test MSE and least square regression model (lambda=0) test MSE.
- Now construct the Lasso model for the entire data set and obtain the Lasso coefficients using the best lambda obtained in part (c) and report the number of non-zero coefficient estimates.
- Now use the Lasso predictors obtained in part (f) to fit the Linear Regression Model and report the summary of the linear model.
Step 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