Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question should be answered using theWeeklydata set, which is part of theISLRpackage. This data is similar in nature to theSmarketdata, except that it contains

This question should be answered using theWeeklydata set, which is part of theISLRpackage. This data is similar in nature to theSmarketdata, except that it contains 1,089 weekly returns for 21 years, from the beginning of 1990 to the end of 2010.

(Use R or R studio for this question. Besides answers and steps, please also provide a .R file for R script.)

The dataset named "Weekly dataset" can be found at ISLR package or Mass Library on Google, if cannot find, the dataset is also in the below link)

https://www.dropbox.com/scl/fi/1vaviala3rwku1ajquk37/Weekly-Data-Set.docx?dl=0&rlkey=s8newe8w2ut2flvqe67dgccfi

(a)Produce some numerical and graphical summaries of theWeeklydata. Do there appear to be any patterns?

(b)Use the full data set to perform a logistic regression withDirectionas the response and the five lag variables plusVolumeas predictors. Use the summary function to print the results. Does any of the predictors appear to be statistically significant? If so, which ones?

(c)Compute the confusion matrix and overall fraction of correct predictions. Explain what the confusion matrix is telling you about the types of mistakes made by logistic regression.

(d)Now fit the logistic regression model using a training data period from 1990 to 2008, withLag2as the only predictor. Compute the confusion matrix and the overall fraction of correct predictions for the held out data (that is, the data from 2009 and 2010).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Measure Theory And Integration

Authors: M M Rao, MM Rao

2nd Edition

1351991485, 9781351991483

More Books

Students also viewed these Mathematics questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago

Question

Behaviour: What am I doing?

Answered: 1 week ago