Question: Please answer part (h), thank you! 13. This question should be answered using the Weekly data set, which is part of the ISLR2 package. This

Please answer part (h), thank you!
13. This question should be answered using the Weekly data set, which is part of the ISLR2 package. This data is similar in nature to the Smarket data from this chapter's lab, except that it contains 1,089 weekly returns for 21 years, from the beginning of 1990 to the end of 2010. (b) Use the full data set to perform a logistic regression with Direction as the response and the five lag variables plus Volume as predictors. Use the summary function to print the results. Do any of the predictors appear to be statistically significant? If so, which ones? (d) Now fit the logistic regression model using a training data period from 1990 to 2008, with Lag2 as 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). h) Repeat (d) using naive Bayes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
