credit_default

Author

Tonatiuh Najera

library(readxl)
library(data.table)
library(tidyselect)
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.1.3
-- Attaching packages --------------------------------------- tidyverse 1.3.2 --
v ggplot2 3.3.6      v purrr   0.3.4 
v tibble  3.1.8      v dplyr   1.0.10
v tidyr   1.2.0      v stringr 1.4.0 
v readr   2.1.2      v forcats 0.5.1 
Warning: package 'ggplot2' was built under R version 4.1.3
Warning: package 'tibble' was built under R version 4.1.3
Warning: package 'dplyr' was built under R version 4.1.3
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::between()   masks data.table::between()
x dplyr::filter()    masks stats::filter()
x dplyr::first()     masks data.table::first()
x dplyr::lag()       masks stats::lag()
x dplyr::last()      masks data.table::last()
x purrr::transpose() masks data.table::transpose()
library(caret)
Warning: package 'caret' was built under R version 4.1.3
Loading required package: lattice

Attaching package: 'caret'

The following object is masked from 'package:purrr':

    lift
library(MASS)

Attaching package: 'MASS'

The following object is masked from 'package:dplyr':

    select
library(car)
Warning: package 'car' was built under R version 4.1.3
Loading required package: carData
Warning: package 'carData' was built under R version 4.1.3

Attaching package: 'car'

The following object is masked from 'package:dplyr':

    recode

The following object is masked from 'package:purrr':

    some
library(gmodels)
Warning: package 'gmodels' was built under R version 4.1.3
data<-read_excel("credit2.xlsx")
summary(data)
       id              loan_amnt          term        installment     
 Min.   :    56705   Min.   : 1000   Min.   :36.00   Min.   :  14.01  
 1st Qu.: 58983326   1st Qu.: 8000   1st Qu.:36.00   1st Qu.: 254.17  
 Median : 77486635   Median :13200   Median :36.00   Median : 379.76  
 Mean   : 88156009   Mean   :15251   Mean   :43.16   Mean   : 447.80  
 3rd Qu.:118233409   3rd Qu.:20000   3rd Qu.:60.00   3rd Qu.: 595.62  
 Max.   :141127268   Max.   :40000   Max.   :60.00   Max.   :1719.83  
                                                                      
    grade            emp_length        home_ownership       annual_inc       
 Length:1048200     Length:1048200     Length:1048200     Min.   :        0  
 Class :character   Class :character   Class :character   1st Qu.:    46000  
 Mode  :character   Mode  :character   Mode  :character   Median :    65000  
                                                          Mean   :    78277  
                                                          3rd Qu.:    94000  
                                                          Max.   :110000000  
                                                                             
 verification_status    issue_d                    loan_status       
 Length:1048200      Min.   :2015-01-01 00:00:00   Length:1048200    
 Class :character    1st Qu.:2015-09-01 00:00:00   Class :character  
 Mode  :character    Median :2016-05-01 00:00:00   Mode  :character  
                     Mean   :2016-09-07 18:28:44                     
                     3rd Qu.:2017-09-01 00:00:00                     
                     Max.   :2018-09-01 00:00:00                     
                                                                     
   purpose           addr_state             dti          delinq_2yrs     
 Length:1048200     Length:1048200     Min.   : -1.00   Min.   : 0.0000  
 Class :character   Class :character   1st Qu.: 12.20   1st Qu.: 0.0000  
 Mode  :character   Mode  :character   Median : 18.28   Median : 0.0000  
                                       Mean   : 19.33   Mean   : 0.3227  
                                       3rd Qu.: 25.15   3rd Qu.: 0.0000  
                                       Max.   :999.00   Max.   :58.0000  
                                       NA's   :856                       
 earliest_cr_line                revol_bal        total_pymnt   
 Min.   :1933-03-01 00:00:00   Min.   :      0   Min.   :    0  
 1st Qu.:1996-01-01 00:00:00   1st Qu.:   5965   1st Qu.: 4848  
 Median :2001-08-01 00:00:00   Median :  11389   Median : 9504  
 Mean   :2000-02-08 23:52:55   Mean   :  16967   Mean   :12190  
 3rd Qu.:2005-07-01 00:00:00   3rd Qu.:  20517   3rd Qu.:16960  
 Max.   :2015-08-01 00:00:00   Max.   :2904836   Max.   :61185  
                                                                
 application_type  
 Length:1048200    
 Class :character  
 Mode  :character  
                   
                   
                   
                   
str(data)
tibble [1,048,200 x 19] (S3: tbl_df/tbl/data.frame)
 $ id                 : num [1:1048200] 1.4e+08 1.4e+08 1.4e+08 1.4e+08 1.4e+08 ...
 $ loan_amnt          : num [1:1048200] 13000 8000 5000 7000 5325 ...
 $ term               : num [1:1048200] 60 36 36 36 36 36 36 36 36 36 ...
 $ installment        : num [1:1048200] 279 285 162 260 228 ...
 $ grade              : chr [1:1048200] "B" "C" "B" "D" ...
 $ emp_length         : chr [1:1048200] "10+ years" "< 1 year" "4 years" "1 year" ...
 $ home_ownership     : chr [1:1048200] "RENT" "RENT" "RENT" "RENT" ...
 $ annual_inc         : num [1:1048200] 28200 37440 28800 25000 80000 ...
 $ verification_status: chr [1:1048200] "Source Verified" "Source Verified" "Verified" "Source Verified" ...
 $ issue_d            : POSIXct[1:1048200], format: "2018-09-01" "2018-09-01" ...
 $ loan_status        : chr [1:1048200] "Current" "Current" "Current" "In Grace Period" ...
 $ purpose            : chr [1:1048200] "credit_card" "debt_consolidation" "credit_card" "credit_card" ...
 $ addr_state         : chr [1:1048200] "FL" "MO" "NY" "NY" ...
 $ dti                : num [1:1048200] 13.36 15.03 24.79 8.35 2.4 ...
 $ delinq_2yrs        : num [1:1048200] 0 0 0 0 0 0 0 0 0 0 ...
 $ earliest_cr_line   : POSIXct[1:1048200], format: "2015-08-01" "2015-08-01" ...
 $ revol_bal          : num [1:1048200] 13204 0 4284 4327 7250 ...
 $ total_pymnt        : num [1:1048200] 1668 1702 964 1362 0 ...
 $ application_type   : chr [1:1048200] "Individual" "Individual" "Individual" "Individual" ...
bd_chr<-as.data.frame(cbind(data$grade, data$emp_length, data$home_ownership, data$verification_status, data$loan_status, data$application_type))

#identificar las categorias de cada variable
factores<-function(y){
  dim<-dim(y)
  for (i in 1:dim[2]) {
    print("Categorias en la variable")
    print(unique(y[,i]))
  }
}
factores(bd_chr)
[1] "Categorias en la variable"
[1] "B" "C" "D" "G" "A" "F" "E"
[1] "Categorias en la variable"
 [1] "10+ years" "< 1 year"  "4 years"   "1 year"    "2 years"   "3 years"  
 [7] "8 years"   NA          "9 years"   "6 years"   "5 years"   "7 years"  
[1] "Categorias en la variable"
[1] "RENT"     "OWN"      "MORTGAGE" "ANY"      "NONE"    
[1] "Categorias en la variable"
[1] "Source Verified" "Verified"        "Not Verified"   
[1] "Categorias en la variable"
[1] "Current"            "In Grace Period"    "Charged Off"       
[4] "Fully Paid"         "Late (31-120 days)" "Late (16-30 days)" 
[7] "Default"           
[1] "Categorias en la variable"
[1] "Individual" "Joint App" 
f_n<-as.data.frame(matrix(nrow = dim(data)[1], ncol = 1))
for (i in 1:dim(data)[1]) {
  if (data[i,5]=="A") {
    f_n[i,1]<-1
  } else{
    if (data[i,5]=="B") {
    f_n[i,1]<-2
    } else {
      if (data[i,5]=="C") {
        f_n[i,1]<-3
        } else {
          if (data[i,5]=="D") {
            f_n[i,1]<-4
            } else {
              if (data[i,5]=="E") {
                f_n[i,1]<-5
                } else {
                  if (data[i,5]=="F") {
                    f_n[i,1]<-6
                    } else {
                      f_n[i,1]<-7
                    }
                }
            }
        }
    }
  }
}
data<-data[,!names(data) %in% c("grade")]
colnames(f_n)<-"grade"
data<-cbind(data,f_n)

str(data)
'data.frame':   1048200 obs. of  19 variables:
 $ id                 : num  1.4e+08 1.4e+08 1.4e+08 1.4e+08 1.4e+08 ...
 $ loan_amnt          : num  13000 8000 5000 7000 5325 ...
 $ term               : num  60 36 36 36 36 36 36 36 36 36 ...
 $ installment        : num  279 285 162 260 228 ...
 $ emp_length         : chr  "10+ years" "< 1 year" "4 years" "1 year" ...
 $ home_ownership     : chr  "RENT" "RENT" "RENT" "RENT" ...
 $ annual_inc         : num  28200 37440 28800 25000 80000 ...
 $ verification_status: chr  "Source Verified" "Source Verified" "Verified" "Source Verified" ...
 $ issue_d            : POSIXct, format: "2018-09-01" "2018-09-01" ...
 $ loan_status        : chr  "Current" "Current" "Current" "In Grace Period" ...
 $ purpose            : chr  "credit_card" "debt_consolidation" "credit_card" "credit_card" ...
 $ addr_state         : chr  "FL" "MO" "NY" "NY" ...
 $ dti                : num  13.36 15.03 24.79 8.35 2.4 ...
 $ delinq_2yrs        : num  0 0 0 0 0 0 0 0 0 0 ...
 $ earliest_cr_line   : POSIXct, format: "2015-08-01" "2015-08-01" ...
 $ revol_bal          : num  13204 0 4284 4327 7250 ...
 $ total_pymnt        : num  1668 1702 964 1362 0 ...
 $ application_type   : chr  "Individual" "Individual" "Individual" "Individual" ...
 $ grade              : num  2 3 2 4 7 1 2 1 2 3 ...
data2<-filter(data, data$loan_status=="Fully Paid" | data$loan_status=="Charged Off")
str(data2)
'data.frame':   611744 obs. of  19 variables:
 $ id                 : num  1.40e+08 1.40e+08 1.40e+08 1.38e+08 1.39e+08 ...
 $ loan_amnt          : num  5325 4500 1000 11000 2500 ...
 $ term               : num  36 36 36 36 36 36 60 60 36 36 ...
 $ installment        : num  228.4 158.5 42.3 402.9 78.9 ...
 $ emp_length         : chr  "1 year" "8 years" "1 year" "10+ years" ...
 $ home_ownership     : chr  "OWN" "RENT" "MORTGAGE" "RENT" ...
 $ annual_inc         : num  80000 212000 10560 62000 43000 ...
 $ verification_status: chr  "Source Verified" "Not Verified" "Verified" "Source Verified" ...
 $ issue_d            : POSIXct, format: "2018-09-01" "2018-09-01" ...
 $ loan_status        : chr  "Charged Off" "Fully Paid" "Charged Off" "Charged Off" ...
 $ purpose            : chr  "major_purchase" "debt_consolidation" "other" "debt_consolidation" ...
 $ addr_state         : chr  "MD" "WA" "LA" "MD" ...
 $ dti                : num  2.4 7.68 5.91 13.12 1.17 ...
 $ delinq_2yrs        : num  0 0 0 1 0 0 0 0 0 0 ...
 $ earliest_cr_line   : POSIXct, format: "2015-08-01" "2015-08-01" ...
 $ revol_bal          : num  7250 5326 474 7496 1836 ...
 $ total_pymnt        : num  0 4648.5 40.6 391.3 2530.1 ...
 $ application_type   : chr  "Individual" "Individual" "Individual" "Individual" ...
 $ grade              : num  7 3 6 4 1 5 4 6 3 3 ...
data2$loan_status<-ifelse(data2$loan_status=="Charged Off",1,0)
str(data2)
'data.frame':   611744 obs. of  19 variables:
 $ id                 : num  1.40e+08 1.40e+08 1.40e+08 1.38e+08 1.39e+08 ...
 $ loan_amnt          : num  5325 4500 1000 11000 2500 ...
 $ term               : num  36 36 36 36 36 36 60 60 36 36 ...
 $ installment        : num  228.4 158.5 42.3 402.9 78.9 ...
 $ emp_length         : chr  "1 year" "8 years" "1 year" "10+ years" ...
 $ home_ownership     : chr  "OWN" "RENT" "MORTGAGE" "RENT" ...
 $ annual_inc         : num  80000 212000 10560 62000 43000 ...
 $ verification_status: chr  "Source Verified" "Not Verified" "Verified" "Source Verified" ...
 $ issue_d            : POSIXct, format: "2018-09-01" "2018-09-01" ...
 $ loan_status        : num  1 0 1 1 0 0 0 0 0 0 ...
 $ purpose            : chr  "major_purchase" "debt_consolidation" "other" "debt_consolidation" ...
 $ addr_state         : chr  "MD" "WA" "LA" "MD" ...
 $ dti                : num  2.4 7.68 5.91 13.12 1.17 ...
 $ delinq_2yrs        : num  0 0 0 1 0 0 0 0 0 0 ...
 $ earliest_cr_line   : POSIXct, format: "2015-08-01" "2015-08-01" ...
 $ revol_bal          : num  7250 5326 474 7496 1836 ...
 $ total_pymnt        : num  0 4648.5 40.6 391.3 2530.1 ...
 $ application_type   : chr  "Individual" "Individual" "Individual" "Individual" ...
 $ grade              : num  7 3 6 4 1 5 4 6 3 3 ...
data2<-na.omit(data2)
unique(data2$application_type)
[1] "Individual" "Joint App" 
bd_bin<-as.data.frame(with(data2, model.matrix(~emp_length+home_ownership+verification_status+0)))
str(bd_bin)
'data.frame':   573180 obs. of  17 variables:
 $ emp_length< 1 year                : num  0 0 0 0 0 0 0 0 1 0 ...
 $ emp_length1 year                  : num  1 0 1 0 1 1 0 0 0 0 ...
 $ emp_length10+ years               : num  0 0 0 1 0 0 0 0 0 0 ...
 $ emp_length2 years                 : num  0 0 0 0 0 0 0 0 0 1 ...
 $ emp_length3 years                 : num  0 0 0 0 0 0 1 0 0 0 ...
 $ emp_length4 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length5 years                 : num  0 0 0 0 0 0 0 1 0 0 ...
 $ emp_length6 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length7 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length8 years                 : num  0 1 0 0 0 0 0 0 0 0 ...
 $ emp_length9 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipMORTGAGE            : num  0 0 1 0 0 1 0 1 0 0 ...
 $ home_ownershipNONE                : num  0 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipOWN                 : num  1 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipRENT                : num  0 1 0 1 1 0 1 0 1 1 ...
 $ verification_statusSource Verified: num  1 0 0 1 0 1 1 0 0 0 ...
 $ verification_statusVerified       : num  0 0 1 0 0 0 0 0 0 0 ...
dataf<-cbind.data.frame(data2$loan_status,data2$loan_amnt,data2$term, data2$installment, data2$grade, data2$annual_inc, data2$issue_d, data2$dti, data2$delinq_2yrs, data2$revol_bal, data2$total_pymnt, bd_bin)
colnames(dataf)[1:12]<-c("loan_status","loan_amnt","term", "installment", "grade", "annual_inc", "issue_d", "dti", "delinq_2yrs", "earliest_cr_line", "revol_bal", "total_pymnt")
str(dataf)
'data.frame':   573180 obs. of  28 variables:
 $ loan_status                       : num  1 0 1 1 0 0 0 0 0 0 ...
 $ loan_amnt                         : num  5325 4500 1000 11000 2500 ...
 $ term                              : num  36 36 36 36 36 36 60 36 36 36 ...
 $ installment                       : num  228.4 158.5 42.3 402.9 78.9 ...
 $ grade                             : num  7 3 6 4 1 5 4 3 3 1 ...
 $ annual_inc                        : num  80000 212000 10560 62000 43000 ...
 $ issue_d                           : POSIXct, format: "2018-09-01" "2018-09-01" ...
 $ dti                               : num  2.4 7.68 5.91 13.12 1.17 ...
 $ delinq_2yrs                       : num  0 0 0 1 0 0 0 0 0 0 ...
 $ earliest_cr_line                  : num  7250 5326 474 7496 1836 ...
 $ revol_bal                         : num  0 4648.5 40.6 391.3 2530.1 ...
 $ total_pymnt                       : num  0 0 0 0 0 0 0 0 1 0 ...
 $ emp_length1 year                  : num  1 0 1 0 1 1 0 0 0 0 ...
 $ emp_length10+ years               : num  0 0 0 1 0 0 0 0 0 0 ...
 $ emp_length2 years                 : num  0 0 0 0 0 0 0 0 0 1 ...
 $ emp_length3 years                 : num  0 0 0 0 0 0 1 0 0 0 ...
 $ emp_length4 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length5 years                 : num  0 0 0 0 0 0 0 1 0 0 ...
 $ emp_length6 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length7 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ emp_length8 years                 : num  0 1 0 0 0 0 0 0 0 0 ...
 $ emp_length9 years                 : num  0 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipMORTGAGE            : num  0 0 1 0 0 1 0 1 0 0 ...
 $ home_ownershipNONE                : num  0 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipOWN                 : num  1 0 0 0 0 0 0 0 0 0 ...
 $ home_ownershipRENT                : num  0 1 0 1 1 0 1 0 1 1 ...
 $ verification_statusSource Verified: num  1 0 0 1 0 1 1 0 0 0 ...
 $ verification_statusVerified       : num  0 0 1 0 0 0 0 0 0 0 ...
set.seed(111)


indexset<-sample(2, nrow(dataf), replace=T, prob=c(0.8,0.2)) 
train<-dataf[indexset==1,] 
test<-dataf[indexset==2,]
mlogit<-glm(loan_status ~ .,data=train, family="binomial") 
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(mlogit)

Call:
glm(formula = loan_status ~ ., family = "binomial", data = train)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-4.0569  -0.1399  -0.0455  -0.0002   8.4904  

Coefficients: (1 not defined because of singularities)
                                       Estimate Std. Error  z value Pr(>|z|)
(Intercept)                           4.373e+01  2.355e+01    1.857   0.0633
loan_amnt                             2.667e-03  2.186e-05  122.018  < 2e-16
term                                 -1.886e-03  3.442e-03   -0.548   0.5838
installment                           5.563e-03  4.350e-04   12.788  < 2e-16
grade                                 5.290e-01  1.235e-02   42.843  < 2e-16
annual_inc                           -1.543e-06  2.411e-07   -6.397 1.58e-10
issue_d                              -3.540e-08  5.276e-10  -67.090  < 2e-16
dti                                   1.186e-02  1.060e-03   11.193  < 2e-16
delinq_2yrs                           7.831e-02  1.079e-02    7.255 4.01e-13
earliest_cr_line                     -1.453e-07  6.776e-07   -0.214   0.8302
revol_bal                            -2.767e-03  1.658e-05 -166.873  < 2e-16
total_pymnt                           8.385e-03  6.693e-02    0.125   0.9003
`emp_length1 year`                    8.237e-02  6.837e-02    1.205   0.2283
`emp_length10+ years`                 5.539e-02  5.882e-02    0.942   0.3463
`emp_length2 years`                   1.894e-02  6.583e-02    0.288   0.7735
`emp_length3 years`                   6.330e-02  6.704e-02    0.944   0.3451
`emp_length4 years`                   5.929e-02  7.071e-02    0.839   0.4017
`emp_length5 years`                   8.530e-02  7.070e-02    1.206   0.2276
`emp_length6 years`                   1.139e-01  7.688e-02    1.482   0.1384
`emp_length7 years`                   5.875e-02  7.717e-02    0.761   0.4465
`emp_length8 years`                   7.326e-02  7.411e-02    0.989   0.3229
`emp_length9 years`                          NA         NA       NA       NA
home_ownershipMORTGAGE                3.426e+00  2.354e+01    0.146   0.8843
home_ownershipNONE                   -4.246e+00  3.256e+02   -0.013   0.9896
home_ownershipOWN                     3.566e+00  2.354e+01    0.151   0.8796
home_ownershipRENT                    3.758e+00  2.354e+01    0.160   0.8732
`verification_statusSource Verified`  3.419e-01  2.767e-02   12.359  < 2e-16
verification_statusVerified           3.216e-01  3.162e-02   10.171  < 2e-16
                                        
(Intercept)                          .  
loan_amnt                            ***
term                                    
installment                          ***
grade                                ***
annual_inc                           ***
issue_d                              ***
dti                                  ***
delinq_2yrs                          ***
earliest_cr_line                        
revol_bal                            ***
total_pymnt                             
`emp_length1 year`                      
`emp_length10+ years`                   
`emp_length2 years`                     
`emp_length3 years`                     
`emp_length4 years`                     
`emp_length5 years`                     
`emp_length6 years`                     
`emp_length7 years`                     
`emp_length8 years`                     
`emp_length9 years`                     
home_ownershipMORTGAGE                  
home_ownershipNONE                      
home_ownershipOWN                       
home_ownershipRENT                      
`verification_statusSource Verified` ***
verification_statusVerified          ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 467366  on 458080  degrees of freedom
Residual deviance:  61015  on 458054  degrees of freedom
AIC: 61069

Number of Fisher Scoring iterations: 11
mlogit<-glm(loan_status ~ .-`emp_length9 years`,data=train, family="binomial") 
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(mlogit)

Call:
glm(formula = loan_status ~ . - `emp_length9 years`, family = "binomial", 
    data = train)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-4.0569  -0.1399  -0.0455  -0.0002   8.4904  

Coefficients:
                                       Estimate Std. Error  z value Pr(>|z|)
(Intercept)                           4.373e+01  2.355e+01    1.857   0.0633
loan_amnt                             2.667e-03  2.186e-05  122.018  < 2e-16
term                                 -1.886e-03  3.442e-03   -0.548   0.5838
installment                           5.563e-03  4.350e-04   12.788  < 2e-16
grade                                 5.290e-01  1.235e-02   42.843  < 2e-16
annual_inc                           -1.543e-06  2.411e-07   -6.397 1.58e-10
issue_d                              -3.540e-08  5.276e-10  -67.090  < 2e-16
dti                                   1.186e-02  1.060e-03   11.193  < 2e-16
delinq_2yrs                           7.831e-02  1.079e-02    7.255 4.01e-13
earliest_cr_line                     -1.453e-07  6.776e-07   -0.214   0.8302
revol_bal                            -2.767e-03  1.658e-05 -166.873  < 2e-16
total_pymnt                           8.385e-03  6.693e-02    0.125   0.9003
`emp_length1 year`                    8.237e-02  6.837e-02    1.205   0.2283
`emp_length10+ years`                 5.539e-02  5.882e-02    0.942   0.3463
`emp_length2 years`                   1.894e-02  6.583e-02    0.288   0.7735
`emp_length3 years`                   6.330e-02  6.704e-02    0.944   0.3451
`emp_length4 years`                   5.929e-02  7.071e-02    0.839   0.4017
`emp_length5 years`                   8.530e-02  7.070e-02    1.206   0.2276
`emp_length6 years`                   1.139e-01  7.688e-02    1.482   0.1384
`emp_length7 years`                   5.875e-02  7.717e-02    0.761   0.4465
`emp_length8 years`                   7.326e-02  7.411e-02    0.989   0.3229
home_ownershipMORTGAGE                3.426e+00  2.354e+01    0.146   0.8843
home_ownershipNONE                   -4.246e+00  3.256e+02   -0.013   0.9896
home_ownershipOWN                     3.566e+00  2.354e+01    0.151   0.8796
home_ownershipRENT                    3.758e+00  2.354e+01    0.160   0.8732
`verification_statusSource Verified`  3.419e-01  2.767e-02   12.359  < 2e-16
verification_statusVerified           3.216e-01  3.162e-02   10.171  < 2e-16
                                        
(Intercept)                          .  
loan_amnt                            ***
term                                    
installment                          ***
grade                                ***
annual_inc                           ***
issue_d                              ***
dti                                  ***
delinq_2yrs                          ***
earliest_cr_line                        
revol_bal                            ***
total_pymnt                             
`emp_length1 year`                      
`emp_length10+ years`                   
`emp_length2 years`                     
`emp_length3 years`                     
`emp_length4 years`                     
`emp_length5 years`                     
`emp_length6 years`                     
`emp_length7 years`                     
`emp_length8 years`                     
home_ownershipMORTGAGE                  
home_ownershipNONE                      
home_ownershipOWN                       
home_ownershipRENT                      
`verification_statusSource Verified` ***
verification_statusVerified          ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 467366  on 458080  degrees of freedom
Residual deviance:  61015  on 458054  degrees of freedom
AIC: 61069

Number of Fisher Scoring iterations: 11
mlogit2<-stepAIC(mlogit, direction="both") 
Start:  AIC=61068.84
loan_status ~ (loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + earliest_cr_line + revol_bal + 
    total_pymnt + `emp_length1 year` + `emp_length10+ years` + 
    `emp_length2 years` + `emp_length3 years` + `emp_length4 years` + 
    `emp_length5 years` + `emp_length6 years` + `emp_length7 years` + 
    `emp_length8 years` + `emp_length9 years` + home_ownershipMORTGAGE + 
    home_ownershipNONE + home_ownershipOWN + home_ownershipRENT + 
    `verification_statusSource Verified` + verification_statusVerified) - 
    `emp_length9 years`
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- home_ownershipNONE                    1    61015  61067
- earliest_cr_line                      1    61015  61067
- total_pymnt                           1    61015  61067
- home_ownershipMORTGAGE                1    61015  61067
- home_ownershipOWN                     1    61015  61067
- home_ownershipRENT                    1    61015  61067
- `emp_length2 years`                   1    61015  61067
- term                                  1    61015  61067
- `emp_length7 years`                   1    61016  61068
- `emp_length4 years`                   1    61016  61068
- `emp_length3 years`                   1    61016  61068
- `emp_length10+ years`                 1    61016  61068
- `emp_length8 years`                   1    61016  61068
- `emp_length5 years`                   1    61016  61068
- `emp_length1 year`                    1    61016  61068
<none>                                       61015  61069
- `emp_length6 years`                   1    61017  61069
- annual_inc                            1    61062  61114
- delinq_2yrs                           1    61062  61114
- verification_statusVerified           1    61118  61170
- dti                                   1    61168  61220
- `verification_statusSource Verified`  1    61170  61222
- installment                           1    61196  61248
- grade                                 1    62793  62845
- issue_d                               1    67630  67682
- loan_amnt                             1    82313  82365
- revol_bal                             1   422699 422751
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61066.84
loan_status ~ loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + earliest_cr_line + revol_bal + 
    total_pymnt + `emp_length1 year` + `emp_length10+ years` + 
    `emp_length2 years` + `emp_length3 years` + `emp_length4 years` + 
    `emp_length5 years` + `emp_length6 years` + `emp_length7 years` + 
    `emp_length8 years` + home_ownershipMORTGAGE + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- earliest_cr_line                      1    61015  61065
- total_pymnt                           1    61015  61065
- home_ownershipMORTGAGE                1    61015  61065
- home_ownershipOWN                     1    61015  61065
- home_ownershipRENT                    1    61015  61065
- `emp_length2 years`                   1    61015  61065
- term                                  1    61015  61065
- `emp_length7 years`                   1    61016  61066
- `emp_length4 years`                   1    61016  61066
- `emp_length3 years`                   1    61016  61066
- `emp_length10+ years`                 1    61016  61066
- `emp_length8 years`                   1    61016  61066
- `emp_length5 years`                   1    61016  61066
- `emp_length1 year`                    1    61016  61066
<none>                                       61015  61067
- `emp_length6 years`                   1    61017  61067
+ home_ownershipNONE                    1    61015  61069
- annual_inc                            1    61062  61112
- delinq_2yrs                           1    61062  61112
- verification_statusVerified           1    61118  61168
- dti                                   1    61168  61218
- `verification_statusSource Verified`  1    61170  61220
- installment                           1    61196  61246
- grade                                 1    62793  62843
- issue_d                               1    67630  67680
- loan_amnt                             1    82313  82363
- revol_bal                             1   422699 422749
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61064.86
loan_status ~ loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + total_pymnt + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length2 years` + `emp_length3 years` + 
    `emp_length4 years` + `emp_length5 years` + `emp_length6 years` + 
    `emp_length7 years` + `emp_length8 years` + home_ownershipMORTGAGE + 
    home_ownershipOWN + home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- total_pymnt                           1    61015  61063
- home_ownershipMORTGAGE                1    61015  61063
- home_ownershipOWN                     1    61015  61063
- home_ownershipRENT                    1    61015  61063
- `emp_length2 years`                   1    61015  61063
- term                                  1    61015  61063
- `emp_length7 years`                   1    61016  61064
- `emp_length4 years`                   1    61016  61064
- `emp_length3 years`                   1    61016  61064
- `emp_length10+ years`                 1    61016  61064
- `emp_length8 years`                   1    61016  61064
- `emp_length5 years`                   1    61016  61064
- `emp_length1 year`                    1    61016  61064
<none>                                       61015  61065
- `emp_length6 years`                   1    61017  61065
+ earliest_cr_line                      1    61015  61067
+ home_ownershipNONE                    1    61015  61067
- delinq_2yrs                           1    61063  61111
- annual_inc                            1    61064  61112
- verification_statusVerified           1    61118  61166
- `verification_statusSource Verified`  1    61170  61218
- dti                                   1    61171  61219
- installment                           1    61196  61244
- grade                                 1    62794  62842
- issue_d                               1    67633  67681
- loan_amnt                             1    82324  82372
- revol_bal                             1   422823 422871
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61062.9
loan_status ~ loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length2 years` + `emp_length3 years` + 
    `emp_length4 years` + `emp_length5 years` + `emp_length6 years` + 
    `emp_length7 years` + `emp_length8 years` + home_ownershipMORTGAGE + 
    home_ownershipOWN + home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- home_ownershipMORTGAGE                1    61015  61061
- home_ownershipOWN                     1    61015  61061
- home_ownershipRENT                    1    61015  61061
- `emp_length2 years`                   1    61015  61061
- term                                  1    61015  61061
- `emp_length7 years`                   1    61016  61062
- `emp_length4 years`                   1    61016  61062
- `emp_length3 years`                   1    61016  61062
- `emp_length8 years`                   1    61016  61062
- `emp_length10+ years`                 1    61017  61063
<none>                                       61015  61063
- `emp_length5 years`                   1    61017  61063
- `emp_length1 year`                    1    61017  61063
- `emp_length6 years`                   1    61018  61064
+ total_pymnt                           1    61015  61065
+ earliest_cr_line                      1    61015  61065
+ home_ownershipNONE                    1    61015  61065
- delinq_2yrs                           1    61063  61109
- annual_inc                            1    61065  61111
- verification_statusVerified           1    61118  61164
- `verification_statusSource Verified`  1    61170  61216
- dti                                   1    61171  61217
- installment                           1    61196  61242
- grade                                 1    62794  62840
- issue_d                               1    67637  67683
- loan_amnt                             1    82324  82370
- revol_bal                             1   422824 422870
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61060.96
loan_status ~ loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length2 years` + `emp_length3 years` + 
    `emp_length4 years` + `emp_length5 years` + `emp_length6 years` + 
    `emp_length7 years` + `emp_length8 years` + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length2 years`                   1    61015  61059
- term                                  1    61015  61059
- `emp_length7 years`                   1    61016  61060
- `emp_length4 years`                   1    61016  61060
- `emp_length3 years`                   1    61016  61060
- `emp_length8 years`                   1    61016  61060
- `emp_length10+ years`                 1    61017  61061
<none>                                       61015  61061
- `emp_length5 years`                   1    61017  61061
- `emp_length1 year`                    1    61017  61061
- `emp_length6 years`                   1    61018  61062
+ home_ownershipMORTGAGE                1    61015  61063
+ total_pymnt                           1    61015  61063
+ earliest_cr_line                      1    61015  61063
+ home_ownershipNONE                    1    61015  61063
- home_ownershipOWN                     1    61027  61071
- delinq_2yrs                           1    61063  61107
- annual_inc                            1    61065  61109
- verification_statusVerified           1    61118  61162
- `verification_statusSource Verified`  1    61170  61214
- dti                                   1    61171  61215
- home_ownershipRENT                    1    61191  61235
- installment                           1    61196  61240
- grade                                 1    62795  62839
- issue_d                               1    67637  67681
- loan_amnt                             1    82324  82368
- revol_bal                             1   422825 422869
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61059.06
loan_status ~ loan_amnt + term + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length3 years` + `emp_length4 years` + 
    `emp_length5 years` + `emp_length6 years` + `emp_length7 years` + 
    `emp_length8 years` + home_ownershipOWN + home_ownershipRENT + 
    `verification_statusSource Verified` + verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- term                                  1    61015  61057
- `emp_length7 years`                   1    61016  61058
- `emp_length4 years`                   1    61016  61058
- `emp_length8 years`                   1    61016  61058
- `emp_length3 years`                   1    61016  61058
- `emp_length10+ years`                 1    61017  61059
<none>                                       61015  61059
- `emp_length5 years`                   1    61017  61059
- `emp_length1 year`                    1    61017  61059
- `emp_length6 years`                   1    61018  61060
+ `emp_length2 years`                   1    61015  61061
+ home_ownershipMORTGAGE                1    61015  61061
+ earliest_cr_line                      1    61015  61061
+ home_ownershipNONE                    1    61015  61061
+ total_pymnt                           1    61015  61061
- home_ownershipOWN                     1    61027  61069
- delinq_2yrs                           1    61063  61105
- annual_inc                            1    61065  61107
- verification_statusVerified           1    61118  61160
- `verification_statusSource Verified`  1    61170  61212
- dti                                   1    61171  61213
- home_ownershipRENT                    1    61191  61233
- installment                           1    61196  61238
- grade                                 1    62795  62837
- issue_d                               1    67637  67679
- loan_amnt                             1    82324  82366
- revol_bal                             1   422829 422871
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61057.19
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length3 years` + `emp_length4 years` + 
    `emp_length5 years` + `emp_length6 years` + `emp_length7 years` + 
    `emp_length8 years` + home_ownershipOWN + home_ownershipRENT + 
    `verification_statusSource Verified` + verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length7 years`                   1    61016  61056
- `emp_length4 years`                   1    61016  61056
- `emp_length8 years`                   1    61016  61056
- `emp_length3 years`                   1    61017  61057
- `emp_length10+ years`                 1    61017  61057
<none>                                       61015  61057
- `emp_length5 years`                   1    61017  61057
- `emp_length1 year`                    1    61018  61058
- `emp_length6 years`                   1    61018  61058
+ term                                  1    61015  61059
+ `emp_length2 years`                   1    61015  61059
+ home_ownershipMORTGAGE                1    61015  61059
+ earliest_cr_line                      1    61015  61059
+ home_ownershipNONE                    1    61015  61059
+ total_pymnt                           1    61015  61059
- home_ownershipOWN                     1    61028  61068
- delinq_2yrs                           1    61063  61103
- annual_inc                            1    61065  61105
- verification_statusVerified           1    61118  61158
- `verification_statusSource Verified`  1    61170  61210
- dti                                   1    61171  61211
- home_ownershipRENT                    1    61192  61232
- installment                           1    61724  61764
- grade                                 1    64256  64296
- issue_d                               1    67667  67707
- loan_amnt                             1   133856 133896
- revol_bal                             1   424333 424373
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61055.86
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length3 years` + `emp_length4 years` + 
    `emp_length5 years` + `emp_length6 years` + `emp_length8 years` + 
    home_ownershipOWN + home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length4 years`                   1    61016  61054
- `emp_length3 years`                   1    61017  61055
- `emp_length8 years`                   1    61017  61055
- `emp_length10+ years`                 1    61017  61055
- `emp_length5 years`                   1    61018  61056
- `emp_length1 year`                    1    61018  61056
<none>                                       61016  61056
- `emp_length6 years`                   1    61018  61056
+ `emp_length7 years`                   1    61015  61057
+ term                                  1    61016  61058
+ total_pymnt                           1    61016  61058
+ home_ownershipMORTGAGE                1    61016  61058
+ earliest_cr_line                      1    61016  61058
+ home_ownershipNONE                    1    61016  61058
+ `emp_length2 years`                   1    61016  61058
- home_ownershipOWN                     1    61028  61066
- delinq_2yrs                           1    61064  61102
- annual_inc                            1    61065  61103
- verification_statusVerified           1    61119  61157
- `verification_statusSource Verified`  1    61171  61209
- dti                                   1    61172  61210
- home_ownershipRENT                    1    61192  61230
- installment                           1    61725  61763
- grade                                 1    64257  64295
- issue_d                               1    67673  67711
- loan_amnt                             1   133863 133901
- revol_bal                             1   424333 424371
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61054.49
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length3 years` + `emp_length5 years` + 
    `emp_length6 years` + `emp_length8 years` + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length3 years`                   1    61017  61053
- `emp_length8 years`                   1    61017  61053
- `emp_length10+ years`                 1    61017  61053
- `emp_length5 years`                   1    61018  61054
- `emp_length1 year`                    1    61018  61054
<none>                                       61016  61054
- `emp_length6 years`                   1    61019  61055
+ `emp_length4 years`                   1    61016  61056
+ `emp_length7 years`                   1    61016  61056
+ total_pymnt                           1    61016  61056
+ term                                  1    61016  61056
+ home_ownershipMORTGAGE                1    61016  61056
+ `emp_length2 years`                   1    61016  61056
+ earliest_cr_line                      1    61016  61056
+ home_ownershipNONE                    1    61016  61056
- home_ownershipOWN                     1    61029  61065
- delinq_2yrs                           1    61064  61100
- annual_inc                            1    61066  61102
- verification_statusVerified           1    61120  61156
- `verification_statusSource Verified`  1    61171  61207
- dti                                   1    61172  61208
- home_ownershipRENT                    1    61192  61228
- installment                           1    61726  61762
- grade                                 1    64257  64293
- issue_d                               1    67673  67709
- loan_amnt                             1   133864 133900
- revol_bal                             1   424334 424370
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61053.21
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length5 years` + `emp_length6 years` + 
    `emp_length8 years` + home_ownershipOWN + home_ownershipRENT + 
    `verification_statusSource Verified` + verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length8 years`                   1    61018  61052
- `emp_length10+ years`                 1    61018  61052
- `emp_length5 years`                   1    61018  61052
- `emp_length1 year`                    1    61018  61052
- `emp_length6 years`                   1    61019  61053
<none>                                       61017  61053
+ `emp_length3 years`                   1    61016  61054
+ total_pymnt                           1    61017  61055
+ `emp_length4 years`                   1    61017  61055
+ `emp_length7 years`                   1    61017  61055
+ `emp_length2 years`                   1    61017  61055
+ term                                  1    61017  61055
+ home_ownershipMORTGAGE                1    61017  61055
+ earliest_cr_line                      1    61017  61055
+ home_ownershipNONE                    1    61017  61055
- home_ownershipOWN                     1    61030  61064
- delinq_2yrs                           1    61065  61099
- annual_inc                            1    61066  61100
- verification_statusVerified           1    61121  61155
- `verification_statusSource Verified`  1    61172  61206
- dti                                   1    61173  61207
- home_ownershipRENT                    1    61193  61227
- installment                           1    61726  61760
- grade                                 1    64258  64292
- issue_d                               1    67673  67707
- loan_amnt                             1   133864 133898
- revol_bal                             1   424335 424369
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61051.79
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length10+ years` + `emp_length5 years` + `emp_length6 years` + 
    home_ownershipOWN + home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length10+ years`                 1    61018  61050
- `emp_length5 years`                   1    61019  61051
- `emp_length1 year`                    1    61019  61051
- `emp_length6 years`                   1    61020  61052
<none>                                       61018  61052
+ total_pymnt                           1    61017  61053
+ `emp_length8 years`                   1    61017  61053
+ `emp_length3 years`                   1    61017  61053
+ `emp_length2 years`                   1    61017  61053
+ `emp_length4 years`                   1    61018  61054
+ `emp_length7 years`                   1    61018  61054
+ term                                  1    61018  61054
+ home_ownershipMORTGAGE                1    61018  61054
+ earliest_cr_line                      1    61018  61054
+ home_ownershipNONE                    1    61018  61054
- home_ownershipOWN                     1    61030  61062
- delinq_2yrs                           1    61065  61097
- annual_inc                            1    61067  61099
- verification_statusVerified           1    61121  61153
- `verification_statusSource Verified`  1    61173  61205
- dti                                   1    61174  61206
- home_ownershipRENT                    1    61193  61225
- installment                           1    61727  61759
- grade                                 1    64259  64291
- issue_d                               1    67687  67719
- loan_amnt                             1   133878 133910
- revol_bal                             1   424336 424368
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61050.17
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length5 years` + `emp_length6 years` + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length5 years`                   1    61019  61049
- `emp_length1 year`                    1    61019  61049
- `emp_length6 years`                   1    61020  61050
<none>                                       61018  61050
+ total_pymnt                           1    61017  61051
+ `emp_length2 years`                   1    61018  61052
+ `emp_length10+ years`                 1    61018  61052
+ `emp_length8 years`                   1    61018  61052
+ `emp_length3 years`                   1    61018  61052
+ term                                  1    61018  61052
+ `emp_length4 years`                   1    61018  61052
+ `emp_length7 years`                   1    61018  61052
+ home_ownershipMORTGAGE                1    61018  61052
+ earliest_cr_line                      1    61018  61052
+ home_ownershipNONE                    1    61018  61052
- home_ownershipOWN                     1    61030  61060
- delinq_2yrs                           1    61066  61096
- annual_inc                            1    61067  61097
- verification_statusVerified           1    61122  61152
- `verification_statusSource Verified`  1    61173  61203
- dti                                   1    61175  61205
- home_ownershipRENT                    1    61195  61225
- installment                           1    61727  61757
- grade                                 1    64259  64289
- issue_d                               1    67687  67717
- loan_amnt                             1   133904 133934
- revol_bal                             1   424361 424391
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61048.9
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length1 year` + 
    `emp_length6 years` + home_ownershipOWN + home_ownershipRENT + 
    `verification_statusSource Verified` + verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length1 year`                    1    61020  61048
- `emp_length6 years`                   1    61020  61048
<none>                                       61019  61049
+ total_pymnt                           1    61018  61050
+ `emp_length5 years`                   1    61018  61050
+ `emp_length2 years`                   1    61018  61050
+ `emp_length8 years`                   1    61019  61051
+ `emp_length3 years`                   1    61019  61051
+ `emp_length10+ years`                 1    61019  61051
+ term                                  1    61019  61051
+ home_ownershipMORTGAGE                1    61019  61051
+ `emp_length4 years`                   1    61019  61051
+ `emp_length7 years`                   1    61019  61051
+ earliest_cr_line                      1    61019  61051
+ home_ownershipNONE                    1    61019  61051
- home_ownershipOWN                     1    61031  61059
- delinq_2yrs                           1    61067  61095
- annual_inc                            1    61068  61096
- verification_statusVerified           1    61123  61151
- `verification_statusSource Verified`  1    61174  61202
- dti                                   1    61175  61203
- home_ownershipRENT                    1    61196  61224
- installment                           1    61728  61756
- grade                                 1    64260  64288
- issue_d                               1    67688  67716
- loan_amnt                             1   133904 133932
- revol_bal                             1   424361 424389
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61047.64
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + `emp_length6 years` + 
    home_ownershipOWN + home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
- `emp_length6 years`                   1    61021  61047
<none>                                       61020  61048
+ total_pymnt                           1    61018  61048
+ `emp_length2 years`                   1    61019  61049
+ `emp_length1 year`                    1    61019  61049
+ `emp_length5 years`                   1    61019  61049
+ `emp_length8 years`                   1    61019  61049
+ `emp_length3 years`                   1    61020  61050
+ term                                  1    61020  61050
+ home_ownershipMORTGAGE                1    61020  61050
+ `emp_length10+ years`                 1    61020  61050
+ `emp_length4 years`                   1    61020  61050
+ `emp_length7 years`                   1    61020  61050
+ earliest_cr_line                      1    61020  61050
+ home_ownershipNONE                    1    61020  61050
- home_ownershipOWN                     1    61032  61058
- delinq_2yrs                           1    61067  61093
- annual_inc                            1    61069  61095
- verification_statusVerified           1    61123  61149
- `verification_statusSource Verified`  1    61175  61201
- dti                                   1    61176  61202
- home_ownershipRENT                    1    61200  61226
- installment                           1    61729  61755
- grade                                 1    64262  64288
- issue_d                               1    67688  67714
- loan_amnt                             1   133906 133932
- revol_bal                             1   424374 424400
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Step:  AIC=61046.91
loan_status ~ loan_amnt + installment + grade + annual_inc + 
    issue_d + dti + delinq_2yrs + revol_bal + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified
Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred

Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
                                       Df Deviance    AIC
<none>                                       61021  61047
+ total_pymnt                           1    61019  61047
+ `emp_length6 years`                   1    61020  61048
+ `emp_length2 years`                   1    61020  61048
+ `emp_length1 year`                    1    61020  61048
+ `emp_length5 years`                   1    61020  61048
+ `emp_length8 years`                   1    61021  61049
+ term                                  1    61021  61049
+ `emp_length3 years`                   1    61021  61049
+ home_ownershipMORTGAGE                1    61021  61049
+ earliest_cr_line                      1    61021  61049
+ home_ownershipNONE                    1    61021  61049
+ `emp_length7 years`                   1    61021  61049
+ `emp_length4 years`                   1    61021  61049
+ `emp_length10+ years`                 1    61021  61049
- home_ownershipOWN                     1    61033  61057
- delinq_2yrs                           1    61069  61093
- annual_inc                            1    61070  61094
- verification_statusVerified           1    61125  61149
- `verification_statusSource Verified`  1    61176  61200
- dti                                   1    61177  61201
- home_ownershipRENT                    1    61201  61225
- installment                           1    61730  61754
- grade                                 1    64264  64288
- issue_d                               1    67688  67712
- loan_amnt                             1   133906 133930
- revol_bal                             1   424376 424400
summary(mlogit2)

Call:
glm(formula = loan_status ~ loan_amnt + installment + grade + 
    annual_inc + issue_d + dti + delinq_2yrs + revol_bal + home_ownershipOWN + 
    home_ownershipRENT + `verification_statusSource Verified` + 
    verification_statusVerified, family = "binomial", data = train)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-4.0680  -0.1399  -0.0455  -0.0002   8.4904  

Coefficients:
                                       Estimate Std. Error  z value Pr(>|z|)
(Intercept)                           4.718e+01  7.576e-01   62.275  < 2e-16
loan_amnt                             2.660e-03  1.764e-05  150.795  < 2e-16
installment                           5.766e-03  2.290e-04   25.181  < 2e-16
grade                                 5.246e-01  9.201e-03   57.012  < 2e-16
annual_inc                           -1.540e-06  2.347e-07   -6.562 5.29e-11
issue_d                              -3.541e-08  5.263e-10  -67.282  < 2e-16
dti                                   1.184e-02  1.046e-03   11.312  < 2e-16
delinq_2yrs                           7.828e-02  1.078e-02    7.262 3.81e-13
revol_bal                            -2.767e-03  1.657e-05 -166.917  < 2e-16
home_ownershipOWN                     1.396e-01  3.826e-02    3.648 0.000264
home_ownershipRENT                    3.305e-01  2.469e-02   13.385  < 2e-16
`verification_statusSource Verified`  3.421e-01  2.766e-02   12.367  < 2e-16
verification_statusVerified           3.226e-01  3.157e-02   10.218  < 2e-16
                                        
(Intercept)                          ***
loan_amnt                            ***
installment                          ***
grade                                ***
annual_inc                           ***
issue_d                              ***
dti                                  ***
delinq_2yrs                          ***
revol_bal                            ***
home_ownershipOWN                    ***
home_ownershipRENT                   ***
`verification_statusSource Verified` ***
verification_statusVerified          ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 467366  on 458080  degrees of freedom
Residual deviance:  61021  on 458068  degrees of freedom
AIC: 61047

Number of Fisher Scoring iterations: 11
p1<-predict(mlogit2, train, type = "response")
pred1<-ifelse(p1>0.5,1,0) 
tab1<-table(Prediccion=pred1,Real=train$loan_status) 
confusionMatrix(tab1)
Confusion Matrix and Statistics

          Real
Prediccion      0      1
         0 362269   6732
         1    928  88152
                                          
               Accuracy : 0.9833          
                 95% CI : (0.9829, 0.9836)
    No Information Rate : 0.7929          
    P-Value [Acc > NIR] : < 2.2e-16       
                                          
                  Kappa : 0.9479          
                                          
 Mcnemar's Test P-Value : < 2.2e-16       
                                          
            Sensitivity : 0.9974          
            Specificity : 0.9291          
         Pos Pred Value : 0.9818          
         Neg Pred Value : 0.9896          
             Prevalence : 0.7929          
         Detection Rate : 0.7908          
   Detection Prevalence : 0.8055          
      Balanced Accuracy : 0.9632          
                                          
       'Positive' Class : 0               
                                          
p2<-predict(mlogit2, test,type="response") 
pred2<-ifelse(p2>0.5,1,0) 
tab2<-table(Prediccion=pred2,Real=test$loan_status) 
confusionMatrix(tab2)
Confusion Matrix and Statistics

          Real
Prediccion     0     1
         0 91236  1701
         1   213 21949
                                          
               Accuracy : 0.9834          
                 95% CI : (0.9826, 0.9841)
    No Information Rate : 0.7945          
    P-Value [Acc > NIR] : < 2.2e-16       
                                          
                  Kappa : 0.9479          
                                          
 Mcnemar's Test P-Value : < 2.2e-16       
                                          
            Sensitivity : 0.9977          
            Specificity : 0.9281          
         Pos Pred Value : 0.9817          
         Neg Pred Value : 0.9904          
             Prevalence : 0.7945          
         Detection Rate : 0.7927          
   Detection Prevalence : 0.8075          
      Balanced Accuracy : 0.9629          
                                          
       'Positive' Class : 0