# Chapter 5 Exercise 5

In Chapter 4, we used logisitc regression to predict the probability of “default” using “income” and “balance” on the “Default” data set. We will now estimate the test error of this logistic regression model using the validation set approach. Do not forget to set a random seed before beginning your analysis.

• Fit a logistic regression model that uses “income” and “balance” to predict “default”.
• Using the validation set approach, estimate the test error of this model. In order to do this, you must perform the following steps:
• Split the sample set into a training set and a validation set.
• Fit a multiple logistic regression model using only the training observations.
• Obtain a prediction of default status for each individual in the validation set by computing the posterior probability of default for that individual, and classifying the individual to the “default” category if the posterior probability is greater than 0.5.
• Compute the validation set error, which is the fraction of the observations in the validation set that are misclassified.
• Repeat the process in (b) three times, using three different splits of the observations into a training set and a validation set. Comment on the results obtained.
• Now consider a logistic regression model that predicts the probability of “default” using “income”, “balance”, and a dummy variable for “student”. Estimate the test error for this model using the validation set approach. Comment on whether or not including a dummy variable for “student” leads to a reduction in the test error rate.

Don't use plagiarized sources. Get Your Custom Essay on
Logisitc Regression
Just from \$13/Page
ORDER NOW »»

and taste our undisputed quality.