### 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

### 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.

Linux Project programming Directions 1. Log in to (username-techballer) (Password-Starcyber55) 2. Click first box that says Rio Salado College Linux Operating System. 3. To the left stroll down and click Final Project to complete.

### I need exercise 4 and 5 ASAP lab09/noccalula-falls.bmp lab09/jaguar.jpg lab09/cheetah-family.jpg lab09/secret04.txt Reintroduction of

I need exercise 4 and 5 ASAP lab09/noccalula-falls.bmp lab09/jaguar.jpg lab09/cheetah-family.jpg lab09/secret04.txt Reintroduction of the cheetah in India involves the re-establishment of a population of cheetahs into areas where they had previously existed but were hunted into extinction during and after the Mughal Period, largely by Rajput and Maratha Indian royalty

### Create infographic on Mac Sublayer One page, landscape orientation Try to explain without defining. Try to include analogies, acronyms and real world

Create infographic on Mac Sublayer One page, landscape orientation Try to explain without defining. Try to include analogies, acronyms and real world examples Include pictures, diagrams, tables Try not use too much AI please Below is an example:

### Assignment 4 Due Saturday 11:59 pm (Week 10) In this assignment, you will be required to do research about Decision tree Regressor and other

Assignment 4 Due Saturday 11:59 pm (Week 10) In this assignment, you will be required to do research about Decision tree Regressor and other common regressions such as Ridge Regression, Lasso Regression, and Logistic Regression. Like Assignment 3, you will need to do the research about these regression models, but

### Lab – Building a Switch and Router Network Lab – Building a Switch and Router Network Topology

Lab – Building a Switch and Router Network Lab – Building a Switch and Router Network Topology Addressing Table Device Interface IP Address Subnet Mask Default Gateway R1 G0/0 192.168.0.1 255.255.255.0 N/A G0/1 192.168.1.1 255.255.255.0 N/A PC-A NIC 192.168.1.3 255.255.255.0 192.168.1.1 PC-B NIC 192.168.0.3 255.255.255.0 192.168.0.1 Objectives Part 1: Set

### Turnitin Turnitin enabledThis assignment will be submitted to Turnitin. Instructions Body paragraphs (sometimes called “discussion sections”) are

Turnitin™ Turnitin™ enabledThis assignment will be submitted to Turnitin™. Instructions Body paragraphs (sometimes called “discussion sections”) are the parts of your essay that aren’t the intro or conclusion. Each of these paragraphs will have: a leading topic sentence that states the paragraph’s focus, evidence (quotes, examples, or research), and analysis

### CSIA 413 project 3         CSIA 459 project 1 and 2 CSIA 413: Cybersecurity Policy, Plans, and Programs Project #3: IT Audit

CSIA 413 project 3         CSIA 459 project 1 and 2 CSIA 413: Cybersecurity Policy, Plans, and Programs Project #3: IT Audit Policy and Plans Company Background & Operating Environment Red Clay Renovations is an internationally recognized, awarding winning firm that specializes in the renovation and rehabilitation of residential buildings and

### 1 IT Audit project and 1 IT Risk Management project ACS | RECOGNITION OF PRIOR LEARNING INSTRUCTION DOCUMENT  2023 Page 1 ACS RECOGNTION OF

1 IT Audit project and 1 IT Risk Management project ACS | RECOGNITION OF PRIOR LEARNING INSTRUCTION DOCUMENT  2023 Page 1 ACS RECOGNTION OF PRIOR LEARNING (RPL) INSTRUCTION DOCUMENT – 2023 This document provides detailed instructions and information to assist you in completing the ACS Recognition of Prior Learning

### You are working as an analytics developer for a growing manufacturing company. The leadership team realizes that it is time to update its data

You are working as an analytics developer for a growing manufacturing company. The leadership team realizes that it is time to update its data processing systems for a variety of reasons and would like to learn more about something called a “big data architecture”.  Project: Create a digital artifact

### 4/10/24, 10:19 AM Assignment Information 1/3 IT 200 Systems Thinking Project Milestone Guidelines and Rubric Overview Thinking in systems

4/10/24, 10:19 AM Assignment Information 1/3 IT 200 Systems Thinking Project Milestone Guidelines and Rubric Overview Thinking in systems allows you to view problems as parts of a whole and gives you a tool set to address those problems. In this activity, you will use your knowledge of systems thinking

### Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass

Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass classification. It is important to realize that understanding an algorithm or technique requires understanding how it behaves under a variety of circumstances. You will go through the process of

### VIDHI PATEL

VIDHI PATEL 04.10.2024 MACHINE LEARNING : MID-TERM PROJECT 2 MULTICLASS CLASSIFICATION DATASET DESCRIPTION The wine quality dataset is intriguing due to its diverse variables, including chemical properties like acidity and pH, which affect wine quality. It offers insights into the intricate relationship between these factors and perceived quality, essential for

### Discuss a Backup and Restore product for either the Workstation or the Server.

Discuss a Backup and Restore product for either the Workstation or the Server.

### Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass

Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass classification. It is important to realize that understanding an algorithm or technique requires understanding how it behaves under a variety of circumstances. You will go through the process of

### Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass

Project 2 – Multiclass Classification In this project you will explore some techniques in solving the supervised learning task of multiclass classification. It is important to realize that understanding an algorithm or technique requires understanding how it behaves under a variety of circumstances. You will go through the process of

### assignment attached Read “Case 12.1: Allstate” and write an essay that answers the following questions: 1. How does Allstate

assignment attached Read “Case 12.1: Allstate” and write an essay that answers the following questions: 1. How does Allstate use artificial intelligence and big data in its operations? 2. What was the goal of Allstate when it collected 11,000 terabytes of data from 1.2 million people every day? 3. Why

### 1. Write the following codes and submit the files in the “Submission.” Submission: 1. A summary of the program, what does the program do 2. Screenshot

1. Write the following codes and submit the files in the “Submission.” Submission: 1. A summary of the program, what does the program do 2. Screenshot of the Running program a).  import tkinter def main():     # Create the main window widget.     main_window = tkinter.Tk()     #Enter the tkinter