Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93122125

Have any Question?


Related Questions in Computer Engineering

Er database modeling questionemployees have an id name

ER database modeling question: Employees have an id, name, department and datejoined. A manager who is also an employee is managing a department and can be a manager of several employees in that department. Ignore Depart ...

Question define four different conflicts you have

Question: Define four different conflicts you have encountered. These conflicts can be work related or personal conflicts. Need in APA Format, 300 words, No Plagiarism. The response must be typed, single spaced, must be ...

An exam has 5 multiple choice questions with 2 possible

An exam has 5 multiple choice questions with 2 possible answers each, and 5 true and false questions. Assume each question on the test counts 10 points, and that each question has a unique answer. If a student guesses ea ...

Question suppose we have a rectangle class that includes

Question : Suppose we have a Rectangle class that includes length and width attributes of type int, both set by the constructor. Create a compareTo method for this class so that rectangle objects are ordered based on the ...

Assignmentsuppose you are a manufacturer of product abc

Assignment Suppose you are a manufacturer of product ABC, which is composed of components A, B, and C. Component A is further composed of parts X and Y. Each time a new product ABC is created, it must be recorded in the ...

Question sales tax in new york city is 8875write a function

Question : Sales tax in New York City is 8.875%. Write a function float computeTax(float saleamount) that takes the price of a purchase as input, and prints to the screen the amount of the purchase, the sales tax owed, a ...

Question suppose you wanted to delete the trash of all

Question : Suppose you wanted to delete the trash of all users just tonight at 11pm using the just created /root/deleteTrash.bash script. Assuming that the deleteTrash.bsh script which deletes the trash of all users exis ...

What are the key principles and tenets that any educated

What are the key principles and tenets that any educated person should know regarding the science of economics and their applicability in the world today?

Question include the following items in your paper and

Question: Include the following items in your paper and formal presentation: • A description of the Performance Check and Proficiency Testing targeted for improvement • An As-Is flow chart of the Performance Check and Pr ...

Q2 what layer uses encryptiondecryptiona what is

Q2. What layer uses encryption/decryption? a. What is encryption? Q3. What addressing system is used at Data Link layer? a. How long is the address? Is it Physical or logical? b. Is it unique or not unique?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As