Question
USING R CODE PLEASE! Consider the business school admission data available in `admission.csv`. The admission officer of a business school has used an index of
USING R CODE PLEASE!
Consider the business school admission data available in `admission.csv`. The admission officer of a business school has used an "index" of undergraduate grade point average ($X_1$=`GPA`) and graduate management aptitude test ($X_2$=`GMAT`) scores to help decide which applicants should be admitted to the school's graduate programs. This index is used to categorize each applicant into one of three groups - `admit` (group 1), `do not admit` (group 2), and `borderline` (group 3).
a. Import the data set using the `read.csv()` function. Take the _last five_ observations in each category as the test data and the remaining observations as the training data. Print the indices of the 15 observations in the test data set.
b. Using the `train()` function of the `caret` package, fit `Multinomial Logistic Regression` to the training data. Set your `method` argument to "multinom". Since the response variable `Group` is coded as numeric (with values 1,2 and 3), convert it into a factor variable using the `as.factor()` function during model fitting.
c. Repeat part (b) for `LDA` setting the `method` argument to "lda".
d. Repeat part (b) for `QDA` setting the `method` argument to "qda".
e. Repeat part (b) for `Naive Bayes` setting the `method` argument to "nb".
f. Repeat part (b) for `KNN` with K=1 and setting the `method` argument to "knn". In this case, standardize the values of each predictor prior to fitting the `KNN` model.
g. Evaluate the performance of the five models on the test set. In a single table report the `Accuracy`, and averaged (over the three groups) `Sensitivity`, `Specificity`, `Pos Pred Value` and `Neg Pred Value` for each model (similar to what we did in class). Set `type='raw'` within the `predict()` function (we don't need the predicted class probabilities in this case b/c `Group` has three class levels). To compute the averages of `Sensitivity`, `Specificity`, `Pos Pred Value` and `Neg Pred Value` across the three groups, you can use the `colMeans()` function. Based on the overall performance, which model would you recommend?
addmissions.csv
GPA | GMAT | Group |
2.96 | 596 | 1 |
3.14 | 473 | 1 |
3.22 | 482 | 1 |
3.29 | 527 | 1 |
3.69 | 505 | 1 |
3.46 | 693 | 1 |
3.03 | 626 | 1 |
3.19 | 663 | 1 |
3.63 | 447 | 1 |
3.59 | 588 | 1 |
3.3 | 563 | 1 |
3.4 | 553 | 1 |
3.5 | 572 | 1 |
3.78 | 591 | 1 |
3.44 | 692 | 1 |
3.48 | 528 | 1 |
3.47 | 552 | 1 |
3.35 | 520 | 1 |
3.39 | 543 | 1 |
3.28 | 523 | 1 |
3.21 | 530 | 1 |
3.58 | 564 | 1 |
3.33 | 565 | 1 |
3.4 | 431 | 1 |
3.38 | 605 | 1 |
3.26 | 664 | 1 |
3.6 | 609 | 1 |
3.37 | 559 | 1 |
3.8 | 521 | 1 |
3.76 | 646 | 1 |
3.24 | 467 | 1 |
2.54 | 446 | 2 |
2.43 | 425 | 2 |
2.2 | 474 | 2 |
2.36 | 531 | 2 |
2.57 | 542 | 2 |
2.35 | 406 | 2 |
2.51 | 412 | 2 |
2.51 | 458 | 2 |
2.36 | 399 | 2 |
2.36 | 482 | 2 |
2.66 | 420 | 2 |
2.68 | 414 | 2 |
2.48 | 533 | 2 |
2.46 | 509 | 2 |
2.63 | 504 | 2 |
2.44 | 336 | 2 |
2.13 | 408 | 2 |
2.41 | 469 | 2 |
2.55 | 538 | 2 |
2.31 | 505 | 2 |
2.41 | 489 | 2 |
2.19 | 411 | 2 |
2.35 | 321 | 2 |
2.6 | 394 | 2 |
2.55 | 528 | 2 |
2.72 | 399 | 2 |
2.85 | 381 | 2 |
2.9 | 384 | 2 |
2.86 | 494 | 3 |
2.85 | 496 | 3 |
3.14 | 419 | 3 |
3.28 | 371 | 3 |
2.89 | 447 | 3 |
3.15 | 313 | 3 |
3.5 | 402 | 3 |
2.89 | 485 | 3 |
2.8 | 444 | 3 |
3.13 | 416 | 3 |
3.01 | 471 | 3 |
2.79 | 490 | 3 |
2.89 | 431 | 3 |
2.91 | 446 | 3 |
2.75 | 546 | 3 |
2.73 | 467 | 3 |
3.12 | 463 | 3 |
3.08 | 440 | 3 |
3.03 | 419 | 3 |
3 | 509 | 3 |
3.03 | 438 | 3 |
3.05 | 399 | 3 |
2.85 | 483 | 3 |
3.01 | 453 | 3 |
3.03 | 414 | 3 |
3.04 | 446 | 3 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-text-image.webp)
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Step: 3
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started