Regression problems using R
Description
The College dataset (College.csv) (https://www.statlearning.com/s/College.csv) contains statistics for a large number of US Colleges from 1995. The dataset has 777 observations on 18 variables. For a full list, see the description in College.txt.
a) Train a model to predict Apps, the number of applications a university receives, using the 17 predictors in the dataset. Justify your choice of model.
b) Again train a model to predict Apps, but this time use the 17 variables in addition to their interactions. If we have three variables X1, X2, X3, their interactions are X1 ? X2, X1 ? X3 and X2 ? X3. To use all the variables in addition to their interactions in lm(), specify the formula Apps ~.®To do this for glmnet, use the model.matrix() function to create the X matrix. Give the formula Apps ~.¦nbsp;as a first argument to the function and then set the data argument to your training data. Remember to also create this matrix for the testing data, as you will need to pass that to the newx argument in the predict() function.Justify your choice of model. Compare the results with part a).
Unformatted Attachment Preview
It contains 777 observations on the following 18 variables.
Variable Description
Private If private or public university
Apps Number of received applications
Accept Number of accepted applications
Enroll Number of new students
Top10perc Percent of new students from top 10% of high school class
Top25perc Percent of new students from top 25% of high school class
F.Undergrad Number of fulltime undergraduates
P.Undergrad Number of parttime undergraduates
Outstate Tuition for students from out-of-state
Room.Board Cost of accommodation and food
Books Estimated book costs
Personal Estimated personal spending
PhD Percentage of faculty that have Ph.D.
Terminal Percentage of faculty with terminal degree
S.F.Ratio Student to faculty rate
perc.alumni Percentage of alumni who donate
Expend Instructional expenditure per student
Grad.Rate Graduation rate
Purchase answer to see full
attachment
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."