O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – ridge regression for the logistic regression model

We will use the logisticRidge function here from the ridge package to fit the ridge regression, and check if we can obtain more significant variables.

  1. Load the German credit dataset with data(German).
  2. Use the logisticRidge function to obtain GC_RLR, a small manipulation required here, by using the following line of code:
    GC_RLR<-logisticRidge(as.numeric(good_bad)-1~.,data= as.data.frame(GC), lambda = "automatic")
  3. Obtain the summaries of GC_LR and GC_RLR by using summary(GC_LR) and summary(GC_RLR).

    The detailed summary output is given in the following screenshot:

    Time for action – ridge regression for the logistic regression model

    Figure 11: Ridge regression ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required