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 – logistic regression for the German credit dataset

The logistic regression model will be built for credit card application scoring model and an ROC curve fit to evaluate the fit of the model.

  1. Invoke the ROCR library with library(ROCR).
  2. Get the German credit dataset in your current session with data(GC).
  3. Build the logistic regression model for good_bad with GC_LR <- glm(good_bad~.,data=GC,family=binomial()).
  4. Run summary(GC_LR) and identify the significant variables. Also answer the question of whether the model is significant?
  5. Get the predictions using the predict function:
    LR_Pred <- predict( GC_LR,type='response')
  6. Use the prediction function from the ROCR package to set up a prediction object:
    GC_pred <- prediction(LR_Pred,GC$good_bad) ...

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