4. (10 pts) Use the sample() function to generate a vector named train to split College01 into a training (containing roughly 70% of the observations) and a test set (containing the rest). train should contain indices of observations that belong to the training set. Run " set.seed(2)" first in order to ensure reproduciblety of results. How many elements does train have? Print out the first 25 elements in train. > dim(College01.ts) [13 234 19 > set.seed(2) > train - sample(nrow(College01), 0.7'nrom(College01)> train[1:25] [13 144 546 445 131 730 729 108 642 360 423 424 183 582 139 310 651 744 172 338 57 502 293 632 114 262 College01. to - College01[train,] > College01. ts - College01[-train,] > dim(College01.tr) 543 19 > die(College01.ts) [13 234 19 Train has 543 elements. 5. (15 pts) Build a logistic regression model using all appropriate predictors to predict whether a college belongs to " high" or "low" category, i.e., whether a college has higher- or lower- than-average graduation rate. Fit the model using the training data and predict for gr01 in the test set. Show your results. What are the training and test error rates? (Note: need to use the contrasts() function to find out how R codes the values of gr01, i.e., when R automatically converts " high"/"low" to 0/1, the contrasts() function tells us whether " high" or "low" is coded as 1.) 6. (15 pts) Build a linear discriminate analysis (LDA) model using all appropriate predictors to predict whether a college belongs to " high" or "low" category, i.e., whether a college has higher- or lower-than-average graduation rate. Fit the model using the training data and predict for gr01 in the test set. Show your results. What are the training and test error rates? 7. (15 pts) Build a quadratic discriminate analysis (QDA) model using all appropriate predictors to predict whether a college belongs to " high" or "low" category, i.e., whether a college has higher- or lower-than-average graduation rate. Fit the model using the training data and predict for gr01 in the test set. Show your results. What are the training and test error rates