Employ the lda method using all the predictors to do the


How to solve this question by using R Language?

You can attach the Boston data set in the MASS package.

library(MASS)

For the Boston data set, we are interested in predicting whether a given suburb has a crime rate above or below the median given other information in the data.

(a) Conduct the logistic regression analysis using all the predictors. To do the prediction, use the first 405 rows as the training set and the rest as the test set. Describe your result, include the error table and report the test error rate.

(b) Employ the LDA method using all the predictors. To do the prediction, use the first 405 rows as the training set and the rest as the test set. Describe your result, include the error table and report the test error rate.

(c) Employ KNN method using all the predictors. To do the prediction, use the first 405 rows as the training set and the rest as the test set. Use 5 fold cross-validation to choose k by splitting the training set into 5 equal-sized subsets. What is the optimal value of k? Describe your result, include the error table and report the test error rate.

(d) Which method is the best? Logistic regression, LDA or KNN? Why?

(e) For the logistic regression in (a), perform forward and backward model selections

[Hint: you can use the step() function in R]. Repeat (a) using only the selected predictors. Compare the full model and selected model(s), which model is better and why?

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Employ the lda method using all the predictors to do the
Reference No:- TGS02928111

Expected delivery within 24 Hours