### Our Services

Get 15% Discount on your First Order

# Check the attachments  Please read the instructions and questions carefully in ” Assignment_3_ 2024.pdf” file and use “Auto.csv” to

Check the attachments

Please read the instructions and questions carefully in ” Assignment_3_ 2024.pdf” file and use “Auto.csv” to finish the assignment. You should submit both 1) an R code ; 2) A PDF report with answers through the link “Submit Assignment 3 Here”.

## Guidelines:

· Use R only for the part 2 in this assignment

· Submit both R code and Report on findings

· Work is to be done individually for this assignment

1. Suppose we collect data for a group of students in a statistics class with variables X1 =hours studied, X2

=undergrad GPA, and Y = receive an A. We fit a logistic regression and produce estimated coefficient,

𝛽̂0 = −7, 𝛽̂1 = 0.06, 𝛽̂2 = 1. (You do not need R code to solve this question).

(1) Estimate the probability that a student who studies for 50 hours and has an undergrad GPA of 3.5 gets

an A in the class. (Hint: For logistic regression, 𝑝(𝑥) = 𝑒𝛽0+𝛽1𝑋1+𝛽2𝑋2

)

1+𝑒𝛽0+𝛽1𝑋1+𝛽2𝑋2

(2) How many hours would a student with GPA 3.4 need to study to have a 50% chance of getting an A

1

in the class? (Hint: We can use the equation log (
𝑝(𝑥) ) = 𝛽

+ 𝛽 𝑋

+ 𝛽 𝑋 ))

1−𝑝(𝑥)

0 1 1 2 2

2. The following questions (3) to (8) should be answered using the
Weekly data set, which is part of the
ISLR package. This data is similar in nature to the Smarket data from this chapter’s lab, except that it contains 1089 weekly returns for 21 years, from the beginning of 1990 to the end of 2010.

(3) Use require(ISLR) and library (ISLR) to load the ISLR package.

a) Use summary( ) function to produce some numerical summaries of the
Weekly data.

b) Use pairs ( ) function to produce a scatterplot matrix of the variables of the data.

c) Do you see the relationship between
Year and
Volume? What is the pairwise correlation value between
Year and
Volume?

d) Is the relationship positive or negative?

(4) Use the full dataset to perform a logistic regression with
Direction as the dependent variable and
Lag1, Lag2, Lag3, Lag4 and
Volume as independent variables (i.e. predictors). Use the summary() function to print the results. Do any of the predictors appear to be statistically significant? If so, which ones? Take a screenshot of your outputs and then answer the questions.

(5) Based on 4)’s results, compute the confusion matrix and overall faction of correct predictions (Hint: refer the code from Chapter 4 lab session on the textbook; we use 0.5 as the predicted probability cut-off for the classifier). What is the precision rate? What is the recall rate? Take a screenshot of your output and then answer the questions.

(6) Now fit the logistic regression model using a training data period from
1990 to 2009 with
Lag 2 as the only predictor. Compute the confusion matrix and the overall fraction of correct predictions for the held out data (i.e. test data) (the data from
2010). In addition, please calculate the precision rate and recall rate. (Hint: refer the code from Chapter 4 lab session on the textbook; we use 0.5 as the predicted probability cut-off for the classifier). Take a screenshot of your output and then answer the questions.

(7) Repeat (6) using KNN with K=1. Compute the confusion matrix and the overall fraction of correct predictions for the held-out data. In addition, please calculate the precision rate and recall rate. (Hint: refer the code from Chapter 4 lab session on the textbook; If you encounter some errors such as “dims of ‘test’ and ‘train’ differ”, try to use knn(data.frame(train.X), …) ). (Use set.seed(1))

(8) Repeat (6) using KNN with K=10. Compute the confusion matrix and the overall fraction of correct predictions for the held-out data. In addition, please calculate the precision rate and recall rate.

3. The quantity
𝑝(𝑋) is called the
odds. Please answer the following questions (You do not need R code

1−𝑝(𝑋)

to solve this question):

(9) On average, what fraction of people with an odds of 0.35 of defaulting on their credit card payment will in fact default?

(10) Suppose that an individual has a 15% chance of defaulting on her credit card payment. What are the odds that she will default?

4. The logistic regression model that results from predicting the probability of default from student status can be seen in the following table. We create a dummy variable that takes on a value of 1 for students and 0 for non-students. Please answer the following questions (You do not need R code for these questions).

(11) How to explain the coefficient before Student[Yes]?

(12) If it is a non-student, what are the estimated odds? Is the probability of default less than the probability of not default?

What to submit:

1. R code.

a.

b.

c.

d.

2. Report.

a.

b.

c.

d.

e.

Should include all the code to accomplish the tasks.

Clear and concise comments to indicate what part of the assignment each code chunk pertains to.

Filename should be in the format of: LastnameFirstname_A3.R

Take screenshots of your outputs in R Studio and answer all the questions. Submit in PDF format.

Includes appropriate plots. Make sure the plots are properly labeled.

The assignment will be graded on the correctness of the answers, comprehensiveness of the analysis, clarity of results’ presentation and neatness of the report.

## image1.jpeg

Order a Similar Paper and get 15% Discount on your First Order

## Related Questions

### 1- Read “Case 18.3: Wearable Technologies Supporting AI in Healthcare” and write an essay that answers the following questions: 1. What is

1- Read “Case 18.3: Wearable Technologies Supporting AI in Healthcare” and write an essay that answers the following questions: 1. What is wearable technology, and how has it evolved beyond its initial purpose of tracking athletic activities? 2. What are the different types of data that wearable technology can collect,

### Discuss some hardening techniques or products you have used for Workstations

Discuss some hardening techniques or products you have used for Workstations

### After the Executive Committee’s meeting, Peter Joseph, the President, and CEO of Container Manufacturing Solutions (CMS) was contented with the briefing

After the Executive Committee’s meeting, Peter Joseph, the President, and CEO of Container Manufacturing Solutions (CMS) was contented with the briefing that you made on how enterprise architecture can help the organization. Mr. Joseph is now interested in the risks involved in creating an EA. He wants you to prepare

### Please write a reflection summary of what you have learned these past 16 weeks in the course “Physical Security” Also, tell me what things I did as an in

Please write a reflection summary of what you have learned these past 16 weeks in the course “Physical Security” Also, tell me what things I did as an instructor that were the most helpful to you, as well as any suggestions you have for further improving this course. Thank you, and I

### Perform a LOPA (Layers of Protection Analysis) of your local living area or work location. Remember to get permission from security.

Perform a LOPA (Layers of Protection Analysis) of your local living area or work location. Remember to get permission from security.

### 4/18/24, 11:38 AM Assignment Information 1/3 IT 200 Project Two The IT Professional Guidelines and Rubric Competency In this project, you will

4/18/24, 11:38 AM Assignment Information 1/3 IT 200 Project Two The IT Professional Guidelines and Rubric Competency In this project, you will demonstrate your mastery of the following competency: Articulate the roles and functions of the information technology professional Scenario Whether you are just beginning your career in information technology

### Lab Assignment #9 Confirmatory Factor Analysis using AMOS Goal of Exercise:  The goal of this exercise is to introduce how to operationalize the CFA

Lab Assignment #9 Confirmatory Factor Analysis using AMOS Goal of Exercise:  The goal of this exercise is to introduce how to operationalize the CFA using AMOS. The exercise allows students to learn how to check if the measurement model has acceptable levels of goodness-of-fit and evidence of construct validity.

### Lab – Configure IPv6 Addresses on Network Devices Lab – Configure IPv6 Addresses on Network Devices Topology Addressing

Lab – Configure IPv6 Addresses on Network Devices Lab – Configure IPv6 Addresses on Network Devices Topology Addressing Table Device Interface IPv6 Address Prefix Length Default Gateway R1 G0/0/0 2001:db8:acad:a::1 64 N/A R1 G0/0/1 2001:db8:acad:1::1 64 N/A S1 VLAN 1 2001:db8:acad:1::b 64 N/A PC-A NIC 2001:db8:acad:1::3 64 fe80::1 PC-B NIC

### Assignment 5 Due Saturday 11:59 pm (Week 12) Part 1 (40 points) This dataset contains State-by-state data on COVID-19 vaccinations in the United

Assignment 5 Due Saturday 11:59 pm (Week 12) Part 1 (40 points) This dataset contains State-by-state data on COVID-19 vaccinations in the United States from 1/2/2021 to 8/2/2021. You will be required to answer the following questions by timeseries analysis. * For vaccines that require multiple doses, each individual dose

,, I will upload more information about it to know better about the material Hi all, the instructions for the final project are attached. You are allowed to finish the project within 2 days at most. you can choose and tell me which option is easy and fast you

### file attached Read “Case 14.3: AI at Airbnb” and write an essay that answers the following questions: 1. How has Airbnb’s

file attached Read “Case 14.3: AI at Airbnb” and write an essay that answers the following questions: 1. How has Airbnb’s business model transformed the travel industry? 2. How does Airbnb use sentiment analysis to improve its services? 3. How does text mining help Airbnb gain insights from guest reviews?

### Prepare First, download and install CrypTool. If using a Windows® PC, install CrypTool 1.  If using a MAC PC, install JCrypTool. Note: In order for

Prepare First, download and install CrypTool. If using a Windows® PC, install CrypTool 1.  If using a MAC PC, install JCrypTool. Note: In order for the CrypTool program to function, you must first OPEN a text file. Only then will items on the toolbar become enabled. Additional information for this

### Why is an update/patch process crucial for any organization to have and follow?  Discuss some issues that may arise when patching and updating

Why is an update/patch process crucial for any organization to have and follow?  Discuss some issues that may arise when patching and updating machines.

Tasks may not be submitted as cloud links, such as links to Google Docs, Google Slides, OneDrive, etc., unless specified in the task requirements. All other submissions must be file types that are uploaded and submitted as attachments (e.g., .docx, .pdf, .ppt). A.  Address ethical issues for cybersecurity by

### The Cybersecurity Analyst’s Toolbox (Required/Graded) Discussion Topic During job interviews, employers often ask if you are

The Cybersecurity Analyst’s Toolbox (Required/Graded) Discussion Topic During job interviews, employers often ask if you are familiar with cybersecurity software. For this reason, it is a good idea to become familiar with commonly used software, including capabilities and limitations. These software products are the tools for conducting your day-to-day duties.

### Explain the differences between desktop and laptop architecture.  What features are specific to laptops and laptop displays? Describe the evolution of

Explain the differences between desktop and laptop architecture.  What features are specific to laptops and laptop displays? Describe the evolution of laptops into other mobile devices.

### I’m working on a WebApp platform React project. I have a small requiement that needs to be done. Enabling file upload option for a text field. I have

I’m working on a WebApp platform React project. I have a small requiement that needs to be done. Enabling file upload option for a text field. I have added a screenshot to understand the requirement better.