library(caret)
## Loading required package: lattice
## Loading required package: ggplot2
data(GermanCredit)
head(GermanCredit)
##   Duration Amount InstallmentRatePercentage ResidenceDuration Age
## 1        6   1169                         4                 4  67
## 2       48   5951                         2                 2  22
## 3       12   2096                         2                 3  49
## 4       42   7882                         2                 4  45
## 5       24   4870                         3                 4  53
## 6       36   9055                         2                 4  35
##   NumberExistingCredits NumberPeopleMaintenance Telephone ForeignWorker
## 1                     2                       1         0             1
## 2                     1                       1         1             1
## 3                     1                       2         1             1
## 4                     1                       2         1             1
## 5                     2                       2         1             1
## 6                     1                       2         0             1
##   Class CheckingAccountStatus.lt.0 CheckingAccountStatus.0.to.200
## 1  Good                          1                              0
## 2   Bad                          0                              1
## 3  Good                          0                              0
## 4  Good                          1                              0
## 5   Bad                          1                              0
## 6  Good                          0                              0
##   CheckingAccountStatus.gt.200 CheckingAccountStatus.none
## 1                            0                          0
## 2                            0                          0
## 3                            0                          1
## 4                            0                          0
## 5                            0                          0
## 6                            0                          1
##   CreditHistory.NoCredit.AllPaid CreditHistory.ThisBank.AllPaid
## 1                              0                              0
## 2                              0                              0
## 3                              0                              0
## 4                              0                              0
## 5                              0                              0
## 6                              0                              0
##   CreditHistory.PaidDuly CreditHistory.Delay CreditHistory.Critical
## 1                      0                   0                      1
## 2                      1                   0                      0
## 3                      0                   0                      1
## 4                      1                   0                      0
## 5                      0                   1                      0
## 6                      1                   0                      0
##   Purpose.NewCar Purpose.UsedCar Purpose.Furniture.Equipment
## 1              0               0                           0
## 2              0               0                           0
## 3              0               0                           0
## 4              0               0                           1
## 5              1               0                           0
## 6              0               0                           0
##   Purpose.Radio.Television Purpose.DomesticAppliance Purpose.Repairs
## 1                        1                         0               0
## 2                        1                         0               0
## 3                        0                         0               0
## 4                        0                         0               0
## 5                        0                         0               0
## 6                        0                         0               0
##   Purpose.Education Purpose.Vacation Purpose.Retraining Purpose.Business
## 1                 0                0                  0                0
## 2                 0                0                  0                0
## 3                 1                0                  0                0
## 4                 0                0                  0                0
## 5                 0                0                  0                0
## 6                 1                0                  0                0
##   Purpose.Other SavingsAccountBonds.lt.100 SavingsAccountBonds.100.to.500
## 1             0                          0                              0
## 2             0                          1                              0
## 3             0                          1                              0
## 4             0                          1                              0
## 5             0                          1                              0
## 6             0                          0                              0
##   SavingsAccountBonds.500.to.1000 SavingsAccountBonds.gt.1000
## 1                               0                           0
## 2                               0                           0
## 3                               0                           0
## 4                               0                           0
## 5                               0                           0
## 6                               0                           0
##   SavingsAccountBonds.Unknown EmploymentDuration.lt.1
## 1                           1                       0
## 2                           0                       0
## 3                           0                       0
## 4                           0                       0
## 5                           0                       0
## 6                           1                       0
##   EmploymentDuration.1.to.4 EmploymentDuration.4.to.7
## 1                         0                         0
## 2                         1                         0
## 3                         0                         1
## 4                         0                         1
## 5                         1                         0
## 6                         1                         0
##   EmploymentDuration.gt.7 EmploymentDuration.Unemployed
## 1                       1                             0
## 2                       0                             0
## 3                       0                             0
## 4                       0                             0
## 5                       0                             0
## 6                       0                             0
##   Personal.Male.Divorced.Seperated Personal.Female.NotSingle
## 1                                0                         0
## 2                                0                         1
## 3                                0                         0
## 4                                0                         0
## 5                                0                         0
## 6                                0                         0
##   Personal.Male.Single Personal.Male.Married.Widowed
## 1                    1                             0
## 2                    0                             0
## 3                    1                             0
## 4                    1                             0
## 5                    1                             0
## 6                    1                             0
##   Personal.Female.Single OtherDebtorsGuarantors.None
## 1                      0                           1
## 2                      0                           1
## 3                      0                           1
## 4                      0                           0
## 5                      0                           1
## 6                      0                           1
##   OtherDebtorsGuarantors.CoApplicant OtherDebtorsGuarantors.Guarantor
## 1                                  0                                0
## 2                                  0                                0
## 3                                  0                                0
## 4                                  0                                1
## 5                                  0                                0
## 6                                  0                                0
##   Property.RealEstate Property.Insurance Property.CarOther
## 1                   1                  0                 0
## 2                   1                  0                 0
## 3                   1                  0                 0
## 4                   0                  1                 0
## 5                   0                  0                 0
## 6                   0                  0                 0
##   Property.Unknown OtherInstallmentPlans.Bank OtherInstallmentPlans.Stores
## 1                0                          0                            0
## 2                0                          0                            0
## 3                0                          0                            0
## 4                0                          0                            0
## 5                1                          0                            0
## 6                1                          0                            0
##   OtherInstallmentPlans.None Housing.Rent Housing.Own Housing.ForFree
## 1                          1            0           1               0
## 2                          1            0           1               0
## 3                          1            0           1               0
## 4                          1            0           0               1
## 5                          1            0           0               1
## 6                          1            0           0               1
##   Job.UnemployedUnskilled Job.UnskilledResident Job.SkilledEmployee
## 1                       0                     0                   1
## 2                       0                     0                   1
## 3                       0                     1                   0
## 4                       0                     0                   1
## 5                       0                     0                   1
## 6                       0                     1                   0
##   Job.Management.SelfEmp.HighlyQualified
## 1                                      0
## 2                                      0
## 3                                      0
## 4                                      0
## 5                                      0
## 6                                      0
summary(GermanCredit)
##     Duration        Amount      InstallmentRatePercentage
##  Min.   : 4.0   Min.   :  250   Min.   :1.000            
##  1st Qu.:12.0   1st Qu.: 1366   1st Qu.:2.000            
##  Median :18.0   Median : 2320   Median :3.000            
##  Mean   :20.9   Mean   : 3271   Mean   :2.973            
##  3rd Qu.:24.0   3rd Qu.: 3972   3rd Qu.:4.000            
##  Max.   :72.0   Max.   :18424   Max.   :4.000            
##  ResidenceDuration      Age        NumberExistingCredits
##  Min.   :1.000     Min.   :19.00   Min.   :1.000        
##  1st Qu.:2.000     1st Qu.:27.00   1st Qu.:1.000        
##  Median :3.000     Median :33.00   Median :1.000        
##  Mean   :2.845     Mean   :35.55   Mean   :1.407        
##  3rd Qu.:4.000     3rd Qu.:42.00   3rd Qu.:2.000        
##  Max.   :4.000     Max.   :75.00   Max.   :4.000        
##  NumberPeopleMaintenance   Telephone     ForeignWorker    Class    
##  Min.   :1.000           Min.   :0.000   Min.   :0.000   Bad :300  
##  1st Qu.:1.000           1st Qu.:0.000   1st Qu.:1.000   Good:700  
##  Median :1.000           Median :1.000   Median :1.000             
##  Mean   :1.155           Mean   :0.596   Mean   :0.963             
##  3rd Qu.:1.000           3rd Qu.:1.000   3rd Qu.:1.000             
##  Max.   :2.000           Max.   :1.000   Max.   :1.000             
##  CheckingAccountStatus.lt.0 CheckingAccountStatus.0.to.200
##  Min.   :0.000              Min.   :0.000                 
##  1st Qu.:0.000              1st Qu.:0.000                 
##  Median :0.000              Median :0.000                 
##  Mean   :0.274              Mean   :0.269                 
##  3rd Qu.:1.000              3rd Qu.:1.000                 
##  Max.   :1.000              Max.   :1.000                 
##  CheckingAccountStatus.gt.200 CheckingAccountStatus.none
##  Min.   :0.000                Min.   :0.000             
##  1st Qu.:0.000                1st Qu.:0.000             
##  Median :0.000                Median :0.000             
##  Mean   :0.063                Mean   :0.394             
##  3rd Qu.:0.000                3rd Qu.:1.000             
##  Max.   :1.000                Max.   :1.000             
##  CreditHistory.NoCredit.AllPaid CreditHistory.ThisBank.AllPaid
##  Min.   :0.00                   Min.   :0.000                 
##  1st Qu.:0.00                   1st Qu.:0.000                 
##  Median :0.00                   Median :0.000                 
##  Mean   :0.04                   Mean   :0.049                 
##  3rd Qu.:0.00                   3rd Qu.:0.000                 
##  Max.   :1.00                   Max.   :1.000                 
##  CreditHistory.PaidDuly CreditHistory.Delay CreditHistory.Critical
##  Min.   :0.00           Min.   :0.000       Min.   :0.000         
##  1st Qu.:0.00           1st Qu.:0.000       1st Qu.:0.000         
##  Median :1.00           Median :0.000       Median :0.000         
##  Mean   :0.53           Mean   :0.088       Mean   :0.293         
##  3rd Qu.:1.00           3rd Qu.:0.000       3rd Qu.:1.000         
##  Max.   :1.00           Max.   :1.000       Max.   :1.000         
##  Purpose.NewCar  Purpose.UsedCar Purpose.Furniture.Equipment
##  Min.   :0.000   Min.   :0.000   Min.   :0.000              
##  1st Qu.:0.000   1st Qu.:0.000   1st Qu.:0.000              
##  Median :0.000   Median :0.000   Median :0.000              
##  Mean   :0.234   Mean   :0.103   Mean   :0.181              
##  3rd Qu.:0.000   3rd Qu.:0.000   3rd Qu.:0.000              
##  Max.   :1.000   Max.   :1.000   Max.   :1.000              
##  Purpose.Radio.Television Purpose.DomesticAppliance Purpose.Repairs
##  Min.   :0.00             Min.   :0.000             Min.   :0.000  
##  1st Qu.:0.00             1st Qu.:0.000             1st Qu.:0.000  
##  Median :0.00             Median :0.000             Median :0.000  
##  Mean   :0.28             Mean   :0.012             Mean   :0.022  
##  3rd Qu.:1.00             3rd Qu.:0.000             3rd Qu.:0.000  
##  Max.   :1.00             Max.   :1.000             Max.   :1.000  
##  Purpose.Education Purpose.Vacation Purpose.Retraining Purpose.Business
##  Min.   :0.00      Min.   :0        Min.   :0.000      Min.   :0.000   
##  1st Qu.:0.00      1st Qu.:0        1st Qu.:0.000      1st Qu.:0.000   
##  Median :0.00      Median :0        Median :0.000      Median :0.000   
##  Mean   :0.05      Mean   :0        Mean   :0.009      Mean   :0.097   
##  3rd Qu.:0.00      3rd Qu.:0        3rd Qu.:0.000      3rd Qu.:0.000   
##  Max.   :1.00      Max.   :0        Max.   :1.000      Max.   :1.000   
##  Purpose.Other   SavingsAccountBonds.lt.100 SavingsAccountBonds.100.to.500
##  Min.   :0.000   Min.   :0.000              Min.   :0.000                 
##  1st Qu.:0.000   1st Qu.:0.000              1st Qu.:0.000                 
##  Median :0.000   Median :1.000              Median :0.000                 
##  Mean   :0.012   Mean   :0.603              Mean   :0.103                 
##  3rd Qu.:0.000   3rd Qu.:1.000              3rd Qu.:0.000                 
##  Max.   :1.000   Max.   :1.000              Max.   :1.000                 
##  SavingsAccountBonds.500.to.1000 SavingsAccountBonds.gt.1000
##  Min.   :0.000                   Min.   :0.000              
##  1st Qu.:0.000                   1st Qu.:0.000              
##  Median :0.000                   Median :0.000              
##  Mean   :0.063                   Mean   :0.048              
##  3rd Qu.:0.000                   3rd Qu.:0.000              
##  Max.   :1.000                   Max.   :1.000              
##  SavingsAccountBonds.Unknown EmploymentDuration.lt.1
##  Min.   :0.000               Min.   :0.000          
##  1st Qu.:0.000               1st Qu.:0.000          
##  Median :0.000               Median :0.000          
##  Mean   :0.183               Mean   :0.172          
##  3rd Qu.:0.000               3rd Qu.:0.000          
##  Max.   :1.000               Max.   :1.000          
##  EmploymentDuration.1.to.4 EmploymentDuration.4.to.7
##  Min.   :0.000             Min.   :0.000            
##  1st Qu.:0.000             1st Qu.:0.000            
##  Median :0.000             Median :0.000            
##  Mean   :0.339             Mean   :0.174            
##  3rd Qu.:1.000             3rd Qu.:0.000            
##  Max.   :1.000             Max.   :1.000            
##  EmploymentDuration.gt.7 EmploymentDuration.Unemployed
##  Min.   :0.000           Min.   :0.000                
##  1st Qu.:0.000           1st Qu.:0.000                
##  Median :0.000           Median :0.000                
##  Mean   :0.253           Mean   :0.062                
##  3rd Qu.:1.000           3rd Qu.:0.000                
##  Max.   :1.000           Max.   :1.000                
##  Personal.Male.Divorced.Seperated Personal.Female.NotSingle
##  Min.   :0.00                     Min.   :0.00             
##  1st Qu.:0.00                     1st Qu.:0.00             
##  Median :0.00                     Median :0.00             
##  Mean   :0.05                     Mean   :0.31             
##  3rd Qu.:0.00                     3rd Qu.:1.00             
##  Max.   :1.00                     Max.   :1.00             
##  Personal.Male.Single Personal.Male.Married.Widowed Personal.Female.Single
##  Min.   :0.000        Min.   :0.000                 Min.   :0             
##  1st Qu.:0.000        1st Qu.:0.000                 1st Qu.:0             
##  Median :1.000        Median :0.000                 Median :0             
##  Mean   :0.548        Mean   :0.092                 Mean   :0             
##  3rd Qu.:1.000        3rd Qu.:0.000                 3rd Qu.:0             
##  Max.   :1.000        Max.   :1.000                 Max.   :0             
##  OtherDebtorsGuarantors.None OtherDebtorsGuarantors.CoApplicant
##  Min.   :0.000               Min.   :0.000                     
##  1st Qu.:1.000               1st Qu.:0.000                     
##  Median :1.000               Median :0.000                     
##  Mean   :0.907               Mean   :0.041                     
##  3rd Qu.:1.000               3rd Qu.:0.000                     
##  Max.   :1.000               Max.   :1.000                     
##  OtherDebtorsGuarantors.Guarantor Property.RealEstate Property.Insurance
##  Min.   :0.000                    Min.   :0.000       Min.   :0.000     
##  1st Qu.:0.000                    1st Qu.:0.000       1st Qu.:0.000     
##  Median :0.000                    Median :0.000       Median :0.000     
##  Mean   :0.052                    Mean   :0.282       Mean   :0.232     
##  3rd Qu.:0.000                    3rd Qu.:1.000       3rd Qu.:0.000     
##  Max.   :1.000                    Max.   :1.000       Max.   :1.000     
##  Property.CarOther Property.Unknown OtherInstallmentPlans.Bank
##  Min.   :0.000     Min.   :0.000    Min.   :0.000             
##  1st Qu.:0.000     1st Qu.:0.000    1st Qu.:0.000             
##  Median :0.000     Median :0.000    Median :0.000             
##  Mean   :0.332     Mean   :0.154    Mean   :0.139             
##  3rd Qu.:1.000     3rd Qu.:0.000    3rd Qu.:0.000             
##  Max.   :1.000     Max.   :1.000    Max.   :1.000             
##  OtherInstallmentPlans.Stores OtherInstallmentPlans.None  Housing.Rent  
##  Min.   :0.000                Min.   :0.000              Min.   :0.000  
##  1st Qu.:0.000                1st Qu.:1.000              1st Qu.:0.000  
##  Median :0.000                Median :1.000              Median :0.000  
##  Mean   :0.047                Mean   :0.814              Mean   :0.179  
##  3rd Qu.:0.000                3rd Qu.:1.000              3rd Qu.:0.000  
##  Max.   :1.000                Max.   :1.000              Max.   :1.000  
##   Housing.Own    Housing.ForFree Job.UnemployedUnskilled
##  Min.   :0.000   Min.   :0.000   Min.   :0.000          
##  1st Qu.:0.000   1st Qu.:0.000   1st Qu.:0.000          
##  Median :1.000   Median :0.000   Median :0.000          
##  Mean   :0.713   Mean   :0.108   Mean   :0.022          
##  3rd Qu.:1.000   3rd Qu.:0.000   3rd Qu.:0.000          
##  Max.   :1.000   Max.   :1.000   Max.   :1.000          
##  Job.UnskilledResident Job.SkilledEmployee
##  Min.   :0.0           Min.   :0.00       
##  1st Qu.:0.0           1st Qu.:0.00       
##  Median :0.0           Median :1.00       
##  Mean   :0.2           Mean   :0.63       
##  3rd Qu.:0.0           3rd Qu.:1.00       
##  Max.   :1.0           Max.   :1.00       
##  Job.Management.SelfEmp.HighlyQualified
##  Min.   :0.000                         
##  1st Qu.:0.000                         
##  Median :0.000                         
##  Mean   :0.148                         
##  3rd Qu.:0.000                         
##  Max.   :1.000
# Converting Class variable from Bad/Good to 0/1

GermanCredit$Class=ifelse(GermanCredit$Class=="Bad",0,1)
GermanCredit$Class[1:5]
## [1] 1 0 1 1 0
# We will split our dataset into Train and Test data. The Train dataset will be used to build the model and the Test dataset will used to validate how well our model is performing.

set.seed(1234)
inTrain=createDataPartition(GermanCredit$Class, p=0.7, list=FALSE)
Training=GermanCredit[inTrain,]
Testing=GermanCredit[-inTrain,]
dim(Training)
## [1] 700  62
dim(Testing)
## [1] 300  62
summary(Training$Class)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  1.0000  0.7129  1.0000  1.0000
sum(Training$Class)
## [1] 499
sum(Testing$Class)
## [1] 201
# Multicollinearity
#install.packages("usdm")
library(usdm)
## Loading required package: sp
## Loading required package: raster
vifstep(GermanCredit[,-10], th=2)
## Warning in cor(x): the standard deviation is zero
## 18 variables from the 61 input variables have collinearity problem: 
##  
## CheckingAccountStatus.lt.0 CreditHistory.NoCredit.AllPaid Purpose.NewCar SavingsAccountBonds.lt.100 EmploymentDuration.lt.1 Personal.Male.Divorced.Seperated OtherDebtorsGuarantors.None Property.RealEstate OtherInstallmentPlans.Bank Housing.Rent Job.UnemployedUnskilled Job.SkilledEmployee CreditHistory.PaidDuly Personal.Male.Single Property.Unknown Amount EmploymentDuration.gt.7 Housing.ForFree 
## 
## After excluding the collinear variables, the linear correlation coefficients ranges between: 
## min correlation ( Job.UnskilledResident ~ Purpose.Education ):  -4.622937e-20 
## max correlation ( CreditHistory.Critical ~ NumberExistingCredits ):  0.5013637 
## 
## ---------- VIFs of the remained variables -------- 
##                                 Variables      VIF
## 1                                Duration 1.225011
## 2               InstallmentRatePercentage 1.113307
## 3                       ResidenceDuration 1.273785
## 4                                     Age 1.329414
## 5                   NumberExistingCredits 1.548107
## 6                 NumberPeopleMaintenance 1.172584
## 7                               Telephone 1.308563
## 8                           ForeignWorker 1.104606
## 9          CheckingAccountStatus.0.to.200 1.656867
## 10           CheckingAccountStatus.gt.200 1.222174
## 11             CheckingAccountStatus.none 1.777892
## 12         CreditHistory.ThisBank.AllPaid 1.159764
## 13                    CreditHistory.Delay 1.226545
## 14                 CreditHistory.Critical 1.634337
## 15                        Purpose.UsedCar 1.442965
## 16            Purpose.Furniture.Equipment 1.581951
## 17               Purpose.Radio.Television 1.743976
## 18              Purpose.DomesticAppliance 1.068103
## 19                        Purpose.Repairs 1.107263
## 20                      Purpose.Education 1.200363
## 21                       Purpose.Vacation      NaN
## 22                     Purpose.Retraining 1.081052
## 23                       Purpose.Business 1.414600
## 24                          Purpose.Other 1.158997
## 25         SavingsAccountBonds.100.to.500 1.134471
## 26        SavingsAccountBonds.500.to.1000 1.106008
## 27            SavingsAccountBonds.gt.1000 1.082737
## 28            SavingsAccountBonds.Unknown 1.183178
## 29              EmploymentDuration.1.to.4 1.296049
## 30              EmploymentDuration.4.to.7 1.229966
## 31          EmploymentDuration.Unemployed 1.215688
## 32              Personal.Female.NotSingle 1.245660
## 33          Personal.Male.Married.Widowed 1.185783
## 34                 Personal.Female.Single      NaN
## 35     OtherDebtorsGuarantors.CoApplicant 1.068171
## 36       OtherDebtorsGuarantors.Guarantor 1.121070
## 37                     Property.Insurance 1.319299
## 38                      Property.CarOther 1.403230
## 39           OtherInstallmentPlans.Stores 1.336079
## 40             OtherInstallmentPlans.None 1.433362
## 41                            Housing.Own 1.326080
## 42                  Job.UnskilledResident 1.206739
## 43 Job.Management.SelfEmp.HighlyQualified 1.398976
fit0=glm(Class~ Duration+InstallmentRatePercentage+ResidenceDuration+Age+NumberExistingCredits+
           NumberPeopleMaintenance+Telephone+ForeignWorker+CheckingAccountStatus.0.to.200+
           CheckingAccountStatus.gt.200+CheckingAccountStatus.none+CreditHistory.ThisBank.AllPaid+
           CreditHistory.Delay+CreditHistory.Critical+Purpose.UsedCar+Purpose.Furniture.Equipment+
           Purpose.Radio.Television+Purpose.DomesticAppliance+Purpose.Repairs+Purpose.Education+
           Purpose.Retraining+Purpose.Business+ Purpose.Other+SavingsAccountBonds.100.to.500+
           SavingsAccountBonds.500.to.1000+SavingsAccountBonds.gt.1000+SavingsAccountBonds.Unknown+
           EmploymentDuration.1.to.4+EmploymentDuration.4.to.7+
           EmploymentDuration.Unemployed+Personal.Female.NotSingle+Personal.Male.Married.Widowed+
           OtherDebtorsGuarantors.CoApplicant+OtherDebtorsGuarantors.Guarantor+Property.Insurance+
           Property.CarOther+OtherInstallmentPlans.Stores+OtherInstallmentPlans.None+
           Housing.Own+Job.UnskilledResident+Job.Management.SelfEmp.HighlyQualified,
         data=Training,family=binomial(link="logit"))

summary(fit0)
## 
## Call:
## glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     ResidenceDuration + Age + NumberExistingCredits + NumberPeopleMaintenance + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Delay + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.CoApplicant + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.Stores + 
##     OtherInstallmentPlans.None + Housing.Own + Job.UnskilledResident + 
##     Job.Management.SelfEmp.HighlyQualified, family = binomial(link = "logit"), 
##     data = Training)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.7705  -0.6805   0.3391   0.6875   1.8435  
## 
## Coefficients:
##                                        Estimate Std. Error z value
## (Intercept)                             1.46054    1.09793   1.330
## Duration                               -0.05112    0.00942  -5.427
## InstallmentRatePercentage              -0.30268    0.09838  -3.077
## ResidenceDuration                       0.05227    0.09968   0.524
## Age                                     0.01727    0.01081   1.597
## NumberExistingCredits                  -0.42642    0.23156  -1.842
## NumberPeopleMaintenance                -0.05504    0.30057  -0.183
## Telephone                              -0.40828    0.24717  -1.652
## ForeignWorker                          -0.72148    0.70701  -1.020
## CheckingAccountStatus.0.to.200          0.34034    0.26629   1.278
## CheckingAccountStatus.gt.200            0.94507    0.45605   2.072
## CheckingAccountStatus.none              1.51489    0.27546   5.500
## CreditHistory.ThisBank.AllPaid         -0.50373    0.46427  -1.085
## CreditHistory.Delay                     0.21291    0.38252   0.557
## CreditHistory.Critical                  0.97655    0.30181   3.236
## Purpose.UsedCar                         1.67679    0.46622   3.597
## Purpose.Furniture.Equipment             0.81315    0.32469   2.504
## Purpose.Radio.Television                1.01608    0.30585   3.322
## Purpose.DomesticAppliance               0.65373    0.90153   0.725
## Purpose.Repairs                        -0.53074    0.64572  -0.822
## Purpose.Education                      -0.21093    0.45916  -0.459
## Purpose.Retraining                      1.94465    1.25080   1.555
## Purpose.Business                        0.48122    0.37881   1.270
## Purpose.Other                           0.98019    0.83278   1.177
## SavingsAccountBonds.100.to.500          0.41569    0.34634   1.200
## SavingsAccountBonds.500.to.1000         0.92693    0.56373   1.644
## SavingsAccountBonds.gt.1000             1.69968    0.63991   2.656
## SavingsAccountBonds.Unknown             1.34022    0.32782   4.088
## EmploymentDuration.1.to.4               0.15077    0.23977   0.629
## EmploymentDuration.4.to.7               1.14649    0.33965   3.375
## EmploymentDuration.Unemployed           0.18378    0.44937   0.409
## Personal.Female.NotSingle              -0.43426    0.24380  -1.781
## Personal.Male.Married.Widowed          -0.24003    0.37694  -0.637
## OtherDebtorsGuarantors.CoApplicant      0.16775    0.49994   0.336
## OtherDebtorsGuarantors.Guarantor        1.06300    0.57038   1.864
## Property.Insurance                     -0.39873    0.28272  -1.410
## Property.CarOther                      -0.43117    0.25405  -1.697
## OtherInstallmentPlans.Stores           -0.05727    0.51655  -0.111
## OtherInstallmentPlans.None              0.34832    0.28343   1.229
## Housing.Own                             0.51547    0.25710   2.005
## Job.UnskilledResident                   0.11775    0.29178   0.404
## Job.Management.SelfEmp.HighlyQualified -0.30495    0.33501  -0.910
##                                        Pr(>|z|)    
## (Intercept)                            0.183429    
## Duration                               5.74e-08 ***
## InstallmentRatePercentage              0.002093 ** 
## ResidenceDuration                      0.600013    
## Age                                    0.110183    
## NumberExistingCredits                  0.065545 .  
## NumberPeopleMaintenance                0.854713    
## Telephone                              0.098572 .  
## ForeignWorker                          0.307510    
## CheckingAccountStatus.0.to.200         0.201229    
## CheckingAccountStatus.gt.200           0.038239 *  
## CheckingAccountStatus.none             3.81e-08 ***
## CreditHistory.ThisBank.AllPaid         0.277920    
## CreditHistory.Delay                    0.577801    
## CreditHistory.Critical                 0.001214 ** 
## Purpose.UsedCar                        0.000322 ***
## Purpose.Furniture.Equipment            0.012265 *  
## Purpose.Radio.Television               0.000893 ***
## Purpose.DomesticAppliance              0.468367    
## Purpose.Repairs                        0.411114    
## Purpose.Education                      0.645965    
## Purpose.Retraining                     0.120011    
## Purpose.Business                       0.203955    
## Purpose.Other                          0.239190    
## SavingsAccountBonds.100.to.500         0.230042    
## SavingsAccountBonds.500.to.1000        0.100119    
## SavingsAccountBonds.gt.1000            0.007904 ** 
## SavingsAccountBonds.Unknown            4.35e-05 ***
## EmploymentDuration.1.to.4              0.529455    
## EmploymentDuration.4.to.7              0.000737 ***
## EmploymentDuration.Unemployed          0.682554    
## Personal.Female.NotSingle              0.074877 .  
## Personal.Male.Married.Widowed          0.524259    
## OtherDebtorsGuarantors.CoApplicant     0.737218    
## OtherDebtorsGuarantors.Guarantor       0.062365 .  
## Property.Insurance                     0.158444    
## Property.CarOther                      0.089663 .  
## OtherInstallmentPlans.Stores           0.911722    
## OtherInstallmentPlans.None             0.219091    
## Housing.Own                            0.044967 *  
## Job.UnskilledResident                  0.686540    
## Job.Management.SelfEmp.HighlyQualified 0.362670    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 839.4  on 699  degrees of freedom
## Residual deviance: 608.3  on 658  degrees of freedom
## AIC: 692.3
## 
## Number of Fisher Scoring iterations: 5
#Select the model obtained from VIF for stepwise
library(MASS)
## 
## Attaching package: 'MASS'
## The following objects are masked from 'package:raster':
## 
##     area, select
step=stepAIC(fit0, direction="both")
## Start:  AIC=692.3
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + NumberPeopleMaintenance + Telephone + 
##     ForeignWorker + CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.CoApplicant + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.Stores + 
##     OtherInstallmentPlans.None + Housing.Own + Job.UnskilledResident + 
##     Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - OtherInstallmentPlans.Stores            1   608.32 690.32
## - NumberPeopleMaintenance                 1   608.34 690.34
## - OtherDebtorsGuarantors.CoApplicant      1   608.42 690.42
## - Job.UnskilledResident                   1   608.47 690.47
## - EmploymentDuration.Unemployed           1   608.47 690.47
## - Purpose.Education                       1   608.51 690.51
## - ResidenceDuration                       1   608.58 690.58
## - CreditHistory.Delay                     1   608.62 690.62
## - EmploymentDuration.1.to.4               1   608.70 690.70
## - Personal.Male.Married.Widowed           1   608.70 690.70
## - Purpose.DomesticAppliance               1   608.83 690.83
## - Purpose.Repairs                         1   608.98 690.98
## - Job.Management.SelfEmp.HighlyQualified  1   609.13 691.13
## - ForeignWorker                           1   609.47 691.47
## - CreditHistory.ThisBank.AllPaid          1   609.49 691.49
## - Purpose.Other                           1   609.72 691.72
## - SavingsAccountBonds.100.to.500          1   609.78 691.78
## - OtherInstallmentPlans.None              1   609.80 691.80
## - Purpose.Business                        1   609.94 691.94
## - CheckingAccountStatus.0.to.200          1   609.94 691.94
## - Property.Insurance                      1   610.29 692.29
## <none>                                        608.30 692.30
## - Age                                     1   610.91 692.91
## - Telephone                               1   611.07 693.07
## - Property.CarOther                       1   611.20 693.20
## - Purpose.Retraining                      1   611.40 693.40
## - SavingsAccountBonds.500.to.1000         1   611.40 693.40
## - Personal.Female.NotSingle               1   611.48 693.48
## - NumberExistingCredits                   1   611.75 693.75
## - OtherDebtorsGuarantors.Guarantor        1   612.26 694.26
## - Housing.Own                             1   612.33 694.33
## - CheckingAccountStatus.gt.200            1   612.89 694.89
## - Purpose.Furniture.Equipment             1   614.70 696.70
## - SavingsAccountBonds.gt.1000             1   617.21 699.21
## - InstallmentRatePercentage               1   618.08 700.08
## - CreditHistory.Critical                  1   619.32 701.32
## - Purpose.Radio.Television                1   619.64 701.64
## - EmploymentDuration.4.to.7               1   620.66 702.66
## - Purpose.UsedCar                         1   623.01 705.01
## - SavingsAccountBonds.Unknown             1   627.14 709.14
## - Duration                                1   639.71 721.71
## - CheckingAccountStatus.none              1   640.48 722.48
## 
## Step:  AIC=690.32
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + NumberPeopleMaintenance + Telephone + 
##     ForeignWorker + CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.CoApplicant + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.UnskilledResident + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - NumberPeopleMaintenance                 1   608.35 688.35
## - OtherDebtorsGuarantors.CoApplicant      1   608.43 688.43
## - Job.UnskilledResident                   1   608.47 688.47
## - EmploymentDuration.Unemployed           1   608.48 688.48
## - Purpose.Education                       1   608.53 688.53
## - ResidenceDuration                       1   608.59 688.59
## - CreditHistory.Delay                     1   608.62 688.62
## - EmploymentDuration.1.to.4               1   608.70 688.70
## - Personal.Male.Married.Widowed           1   608.71 688.71
## - Purpose.DomesticAppliance               1   608.85 688.85
## - Purpose.Repairs                         1   609.00 689.00
## - Job.Management.SelfEmp.HighlyQualified  1   609.14 689.14
## - ForeignWorker                           1   609.49 689.49
## - CreditHistory.ThisBank.AllPaid          1   609.55 689.55
## - Purpose.Other                           1   609.74 689.74
## - SavingsAccountBonds.100.to.500          1   609.80 689.80
## - Purpose.Business                        1   609.96 689.96
## - CheckingAccountStatus.0.to.200          1   609.96 689.96
## - OtherInstallmentPlans.None              1   610.21 690.21
## - Property.Insurance                      1   610.29 690.29
## <none>                                        608.32 690.32
## - Age                                     1   610.93 690.93
## - Telephone                               1   611.07 691.07
## - Property.CarOther                       1   611.22 691.22
## - SavingsAccountBonds.500.to.1000         1   611.41 691.41
## - Purpose.Retraining                      1   611.43 691.43
## - Personal.Female.NotSingle               1   611.49 691.49
## - NumberExistingCredits                   1   611.75 691.75
## + OtherInstallmentPlans.Stores            1   608.30 692.30
## - OtherDebtorsGuarantors.Guarantor        1   612.31 692.31
## - Housing.Own                             1   612.33 692.33
## - CheckingAccountStatus.gt.200            1   612.90 692.90
## - Purpose.Furniture.Equipment             1   614.70 694.70
## - SavingsAccountBonds.gt.1000             1   617.21 697.21
## - InstallmentRatePercentage               1   618.20 698.20
## - CreditHistory.Critical                  1   619.32 699.32
## - Purpose.Radio.Television                1   619.67 699.67
## - EmploymentDuration.4.to.7               1   620.73 700.73
## - Purpose.UsedCar                         1   623.02 703.02
## - SavingsAccountBonds.Unknown             1   627.25 707.25
## - Duration                                1   639.85 719.85
## - CheckingAccountStatus.none              1   640.49 720.49
## 
## Step:  AIC=688.35
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + Telephone + ForeignWorker + 
##     CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.CoApplicant + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.UnskilledResident + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - OtherDebtorsGuarantors.CoApplicant      1   608.47 686.47
## - Job.UnskilledResident                   1   608.49 686.49
## - EmploymentDuration.Unemployed           1   608.51 686.51
## - Purpose.Education                       1   608.56 686.56
## - ResidenceDuration                       1   608.62 686.62
## - CreditHistory.Delay                     1   608.65 686.65
## - Personal.Male.Married.Widowed           1   608.72 686.72
## - EmploymentDuration.1.to.4               1   608.73 686.73
## - Purpose.DomesticAppliance               1   608.90 686.90
## - Purpose.Repairs                         1   609.02 687.02
## - Job.Management.SelfEmp.HighlyQualified  1   609.15 687.15
## - ForeignWorker                           1   609.52 687.52
## - CreditHistory.ThisBank.AllPaid          1   609.60 687.60
## - Purpose.Other                           1   609.79 687.79
## - SavingsAccountBonds.100.to.500          1   609.82 687.82
## - CheckingAccountStatus.0.to.200          1   610.00 688.00
## - Purpose.Business                        1   610.01 688.01
## - OtherInstallmentPlans.None              1   610.24 688.24
## - Property.Insurance                      1   610.33 688.33
## <none>                                        608.35 688.35
## - Age                                     1   610.94 688.94
## - Telephone                               1   611.10 689.10
## - Property.CarOther                       1   611.26 689.26
## - Purpose.Retraining                      1   611.48 689.48
## - SavingsAccountBonds.500.to.1000         1   611.48 689.48
## - Personal.Female.NotSingle               1   611.57 689.57
## - NumberExistingCredits                   1   611.87 689.87
## + NumberPeopleMaintenance                 1   608.32 690.32
## - OtherDebtorsGuarantors.Guarantor        1   612.33 690.33
## + OtherInstallmentPlans.Stores            1   608.34 690.34
## - Housing.Own                             1   612.39 690.39
## - CheckingAccountStatus.gt.200            1   612.96 690.96
## - Purpose.Furniture.Equipment             1   614.88 692.88
## - SavingsAccountBonds.gt.1000             1   617.21 695.21
## - InstallmentRatePercentage               1   618.22 696.22
## - CreditHistory.Critical                  1   619.44 697.44
## - Purpose.Radio.Television                1   619.87 697.87
## - EmploymentDuration.4.to.7               1   620.76 698.76
## - Purpose.UsedCar                         1   623.13 701.13
## - SavingsAccountBonds.Unknown             1   627.30 705.30
## - Duration                                1   639.86 717.86
## - CheckingAccountStatus.none              1   640.69 718.69
## 
## Step:  AIC=686.47
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + Telephone + ForeignWorker + 
##     CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.UnskilledResident + 
##     Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Job.UnskilledResident                   1   608.60 684.60
## - EmploymentDuration.Unemployed           1   608.65 684.65
## - Purpose.Education                       1   608.70 684.70
## - ResidenceDuration                       1   608.73 684.73
## - CreditHistory.Delay                     1   608.77 684.77
## - Personal.Male.Married.Widowed           1   608.83 684.83
## - EmploymentDuration.1.to.4               1   608.84 684.84
## - Purpose.DomesticAppliance               1   609.00 685.00
## - Purpose.Repairs                         1   609.15 685.15
## - Job.Management.SelfEmp.HighlyQualified  1   609.27 685.27
## - CreditHistory.ThisBank.AllPaid          1   609.66 685.66
## - ForeignWorker                           1   609.69 685.69
## - SavingsAccountBonds.100.to.500          1   609.89 685.89
## - Purpose.Other                           1   610.01 686.01
## - CheckingAccountStatus.0.to.200          1   610.07 686.07
## - Purpose.Business                        1   610.12 686.12
## - Property.Insurance                      1   610.44 686.44
## - OtherInstallmentPlans.None              1   610.45 686.45
## <none>                                        608.47 686.47
## - Age                                     1   611.09 687.09
## - Telephone                               1   611.18 687.18
## - Property.CarOther                       1   611.40 687.40
## - SavingsAccountBonds.500.to.1000         1   611.54 687.54
## - Purpose.Retraining                      1   611.56 687.56
## - Personal.Female.NotSingle               1   611.73 687.73
## - NumberExistingCredits                   1   612.00 688.00
## + OtherDebtorsGuarantors.CoApplicant      1   608.35 688.35
## - OtherDebtorsGuarantors.Guarantor        1   612.37 688.37
## + NumberPeopleMaintenance                 1   608.43 688.43
## + OtherInstallmentPlans.Stores            1   608.46 688.46
## - Housing.Own                             1   612.46 688.46
## - CheckingAccountStatus.gt.200            1   613.01 689.01
## - Purpose.Furniture.Equipment             1   615.03 691.03
## - SavingsAccountBonds.gt.1000             1   617.25 693.25
## - InstallmentRatePercentage               1   618.36 694.36
## - CreditHistory.Critical                  1   619.57 695.57
## - Purpose.Radio.Television                1   619.96 695.96
## - EmploymentDuration.4.to.7               1   620.82 696.82
## - Purpose.UsedCar                         1   623.13 699.13
## - SavingsAccountBonds.Unknown             1   627.32 703.32
## - Duration                                1   640.03 716.03
## - CheckingAccountStatus.none              1   640.74 716.74
## 
## Step:  AIC=684.6
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + Telephone + ForeignWorker + 
##     CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + EmploymentDuration.Unemployed + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - EmploymentDuration.Unemployed           1   608.75 682.75
## - Purpose.Education                       1   608.86 682.86
## - ResidenceDuration                       1   608.89 682.89
## - CreditHistory.Delay                     1   608.91 682.91
## - Personal.Male.Married.Widowed           1   608.95 682.95
## - EmploymentDuration.1.to.4               1   608.97 682.97
## - Purpose.DomesticAppliance               1   609.12 683.12
## - Purpose.Repairs                         1   609.27 683.27
## - Job.Management.SelfEmp.HighlyQualified  1   609.48 683.48
## - CreditHistory.ThisBank.AllPaid          1   609.74 683.74
## - ForeignWorker                           1   609.86 683.86
## - SavingsAccountBonds.100.to.500          1   610.07 684.07
## - Purpose.Other                           1   610.16 684.16
## - CheckingAccountStatus.0.to.200          1   610.22 684.22
## - Purpose.Business                        1   610.23 684.23
## - OtherInstallmentPlans.None              1   610.53 684.53
## - Property.Insurance                      1   610.60 684.60
## <none>                                        608.60 684.60
## - Telephone                               1   611.18 685.18
## - Age                                     1   611.43 685.43
## - SavingsAccountBonds.500.to.1000         1   611.61 685.61
## - Property.CarOther                       1   611.68 685.68
## - Purpose.Retraining                      1   611.80 685.80
## - Personal.Female.NotSingle               1   611.93 685.93
## - NumberExistingCredits                   1   612.24 686.24
## - OtherDebtorsGuarantors.Guarantor        1   612.45 686.45
## + Job.UnskilledResident                   1   608.47 686.47
## + OtherDebtorsGuarantors.CoApplicant      1   608.49 686.49
## + NumberPeopleMaintenance                 1   608.58 686.58
## + OtherInstallmentPlans.Stores            1   608.59 686.59
## - Housing.Own                             1   612.70 686.70
## - CheckingAccountStatus.gt.200            1   613.08 687.08
## - Purpose.Furniture.Equipment             1   615.06 689.06
## - SavingsAccountBonds.gt.1000             1   617.27 691.27
## - InstallmentRatePercentage               1   618.60 692.60
## - CreditHistory.Critical                  1   619.70 693.70
## - Purpose.Radio.Television                1   619.99 693.99
## - EmploymentDuration.4.to.7               1   620.99 694.99
## - Purpose.UsedCar                         1   623.16 697.16
## - SavingsAccountBonds.Unknown             1   627.32 701.32
## - CheckingAccountStatus.none              1   640.79 714.79
## - Duration                                1   641.37 715.37
## 
## Step:  AIC=682.75
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + Telephone + ForeignWorker + 
##     CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Purpose.Education                       1   609.03 681.03
## - ResidenceDuration                       1   609.03 681.03
## - EmploymentDuration.1.to.4               1   609.05 681.05
## - CreditHistory.Delay                     1   609.06 681.06
## - Personal.Male.Married.Widowed           1   609.07 681.07
## - Purpose.DomesticAppliance               1   609.29 681.29
## - Purpose.Repairs                         1   609.36 681.36
## - Job.Management.SelfEmp.HighlyQualified  1   609.51 681.51
## - CreditHistory.ThisBank.AllPaid          1   609.83 681.83
## - ForeignWorker                           1   609.95 681.95
## - SavingsAccountBonds.100.to.500          1   610.26 682.26
## - CheckingAccountStatus.0.to.200          1   610.34 682.34
## - Purpose.Business                        1   610.36 682.36
## - Purpose.Other                           1   610.45 682.45
## <none>                                        608.75 682.75
## - OtherInstallmentPlans.None              1   610.77 682.77
## - Property.Insurance                      1   610.77 682.77
## - Telephone                               1   611.27 683.27
## - Age                                     1   611.63 683.63
## - SavingsAccountBonds.500.to.1000         1   611.76 683.76
## - Property.CarOther                       1   611.83 683.83
## - Purpose.Retraining                      1   611.91 683.91
## - Personal.Female.NotSingle               1   612.00 684.00
## - NumberExistingCredits                   1   612.37 684.37
## - OtherDebtorsGuarantors.Guarantor        1   612.55 684.55
## + EmploymentDuration.Unemployed           1   608.60 684.60
## + OtherDebtorsGuarantors.CoApplicant      1   608.62 684.62
## + Job.UnskilledResident                   1   608.65 684.65
## + NumberPeopleMaintenance                 1   608.73 684.73
## + OtherInstallmentPlans.Stores            1   608.74 684.74
## - Housing.Own                             1   612.77 684.77
## - CheckingAccountStatus.gt.200            1   613.11 685.11
## - Purpose.Furniture.Equipment             1   615.23 687.23
## - SavingsAccountBonds.gt.1000             1   617.33 689.33
## - InstallmentRatePercentage               1   618.96 690.96
## - CreditHistory.Critical                  1   619.88 691.88
## - Purpose.Radio.Television                1   620.05 692.05
## - EmploymentDuration.4.to.7               1   621.01 693.01
## - Purpose.UsedCar                         1   623.27 695.27
## - SavingsAccountBonds.Unknown             1   627.55 699.55
## - CheckingAccountStatus.none              1   640.82 712.82
## - Duration                                1   641.53 713.53
## 
## Step:  AIC=681.03
## Class ~ Duration + InstallmentRatePercentage + ResidenceDuration + 
##     Age + NumberExistingCredits + Telephone + ForeignWorker + 
##     CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.ThisBank.AllPaid + 
##     CreditHistory.Delay + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Retraining + 
##     Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - ResidenceDuration                       1   609.30 679.30
## - CreditHistory.Delay                     1   609.31 679.31
## - EmploymentDuration.1.to.4               1   609.31 679.31
## - Personal.Male.Married.Widowed           1   609.32 679.32
## - Purpose.Repairs                         1   609.54 679.54
## - Purpose.DomesticAppliance               1   609.64 679.64
## - Job.Management.SelfEmp.HighlyQualified  1   609.78 679.78
## - CreditHistory.ThisBank.AllPaid          1   610.12 680.12
## - ForeignWorker                           1   610.31 680.31
## - CheckingAccountStatus.0.to.200          1   610.57 680.57
## - SavingsAccountBonds.100.to.500          1   610.58 680.58
## - Purpose.Other                           1   610.91 680.91
## <none>                                        609.03 681.03
## - OtherInstallmentPlans.None              1   611.10 681.10
## - Purpose.Business                        1   611.11 681.11
## - Property.Insurance                      1   611.18 681.18
## - Telephone                               1   611.44 681.44
## - Age                                     1   611.93 681.93
## - SavingsAccountBonds.500.to.1000         1   612.04 682.04
## - Property.CarOther                       1   612.13 682.13
## - Purpose.Retraining                      1   612.35 682.35
## - Personal.Female.NotSingle               1   612.43 682.43
## - NumberExistingCredits                   1   612.58 682.58
## + Purpose.Education                       1   608.75 682.75
## - OtherDebtorsGuarantors.Guarantor        1   612.86 682.86
## + EmploymentDuration.Unemployed           1   608.86 682.86
## + OtherDebtorsGuarantors.CoApplicant      1   608.88 682.88
## + Job.UnskilledResident                   1   608.90 682.90
## + NumberPeopleMaintenance                 1   609.01 683.01
## + OtherInstallmentPlans.Stores            1   609.02 683.02
## - CheckingAccountStatus.gt.200            1   613.30 683.30
## - Housing.Own                             1   613.32 683.32
## - Purpose.Furniture.Equipment             1   617.11 687.11
## - SavingsAccountBonds.gt.1000             1   617.57 687.57
## - InstallmentRatePercentage               1   619.35 689.35
## - CreditHistory.Critical                  1   619.99 689.99
## - EmploymentDuration.4.to.7               1   621.29 691.29
## - Purpose.Radio.Television                1   622.62 692.62
## - Purpose.UsedCar                         1   625.45 695.45
## - SavingsAccountBonds.Unknown             1   627.81 697.81
## - CheckingAccountStatus.none              1   640.92 710.92
## - Duration                                1   641.72 711.72
## 
## Step:  AIC=679.3
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Delay + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Retraining + 
##     Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.1.to.4 + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - EmploymentDuration.1.to.4               1   609.56 677.56
## - CreditHistory.Delay                     1   609.59 677.59
## - Personal.Male.Married.Widowed           1   609.61 677.61
## - Purpose.Repairs                         1   609.80 677.80
## - Purpose.DomesticAppliance               1   609.89 677.89
## - Job.Management.SelfEmp.HighlyQualified  1   610.18 678.18
## - CreditHistory.ThisBank.AllPaid          1   610.38 678.38
## - ForeignWorker                           1   610.54 678.54
## - CheckingAccountStatus.0.to.200          1   610.81 678.81
## - SavingsAccountBonds.100.to.500          1   610.89 678.89
## - Purpose.Other                           1   611.27 679.27
## - Purpose.Business                        1   611.29 679.29
## <none>                                        609.30 679.30
## - OtherInstallmentPlans.None              1   611.43 679.43
## - Property.Insurance                      1   611.47 679.47
## - Telephone                               1   611.89 679.89
## - Property.CarOther                       1   612.33 680.33
## - SavingsAccountBonds.500.to.1000         1   612.45 680.45
## - Purpose.Retraining                      1   612.65 680.65
## - Personal.Female.NotSingle               1   612.66 680.66
## - Age                                     1   612.71 680.71
## - NumberExistingCredits                   1   612.79 680.79
## + ResidenceDuration                       1   609.03 681.03
## + Purpose.Education                       1   609.03 681.03
## + EmploymentDuration.Unemployed           1   609.14 681.14
## + Job.UnskilledResident                   1   609.15 681.15
## + OtherDebtorsGuarantors.CoApplicant      1   609.16 681.16
## - OtherDebtorsGuarantors.Guarantor        1   613.21 681.21
## + NumberPeopleMaintenance                 1   609.28 681.28
## + OtherInstallmentPlans.Stores            1   609.29 681.29
## - Housing.Own                             1   613.33 681.33
## - CheckingAccountStatus.gt.200            1   613.44 681.44
## - Purpose.Furniture.Equipment             1   617.61 685.61
## - SavingsAccountBonds.gt.1000             1   617.84 685.84
## - InstallmentRatePercentage               1   619.45 687.45
## - CreditHistory.Critical                  1   620.40 688.40
## - EmploymentDuration.4.to.7               1   621.50 689.50
## - Purpose.Radio.Television                1   622.92 690.92
## - Purpose.UsedCar                         1   625.95 693.95
## - SavingsAccountBonds.Unknown             1   628.56 696.56
## - CheckingAccountStatus.none              1   640.99 708.99
## - Duration                                1   641.87 709.87
## 
## Step:  AIC=677.56
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Delay + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Retraining + 
##     Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + Personal.Male.Married.Widowed + 
##     OtherDebtorsGuarantors.Guarantor + Property.Insurance + Property.CarOther + 
##     OtherInstallmentPlans.None + Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Personal.Male.Married.Widowed           1   609.84 675.84
## - CreditHistory.Delay                     1   609.89 675.89
## - Purpose.Repairs                         1   610.08 676.08
## - Purpose.DomesticAppliance               1   610.14 676.14
## - Job.Management.SelfEmp.HighlyQualified  1   610.53 676.53
## - CreditHistory.ThisBank.AllPaid          1   610.65 676.65
## - ForeignWorker                           1   610.83 676.83
## - CheckingAccountStatus.0.to.200          1   610.96 676.96
## - SavingsAccountBonds.100.to.500          1   611.09 677.09
## - Purpose.Other                           1   611.51 677.51
## - Purpose.Business                        1   611.52 677.52
## <none>                                        609.56 677.56
## - OtherInstallmentPlans.None              1   611.65 677.65
## - Property.Insurance                      1   611.83 677.83
## - Telephone                               1   612.25 678.25
## - Property.CarOther                       1   612.63 678.63
## - Age                                     1   612.74 678.74
## - SavingsAccountBonds.500.to.1000         1   612.74 678.74
## - Purpose.Retraining                      1   612.83 678.83
## - Personal.Female.NotSingle               1   613.00 679.00
## - NumberExistingCredits                   1   613.24 679.24
## + Purpose.Education                       1   609.29 679.29
## + EmploymentDuration.1.to.4               1   609.30 679.30
## + ResidenceDuration                       1   609.31 679.31
## + Job.UnskilledResident                   1   609.41 679.41
## + OtherDebtorsGuarantors.CoApplicant      1   609.43 679.43
## + EmploymentDuration.Unemployed           1   609.47 679.47
## + NumberPeopleMaintenance                 1   609.54 679.54
## + OtherInstallmentPlans.Stores            1   609.56 679.56
## - CheckingAccountStatus.gt.200            1   613.59 679.59
## - OtherDebtorsGuarantors.Guarantor        1   613.69 679.69
## - Housing.Own                             1   613.77 679.77
## - Purpose.Furniture.Equipment             1   617.86 683.86
## - SavingsAccountBonds.gt.1000             1   618.24 684.24
## - InstallmentRatePercentage               1   619.84 685.84
## - CreditHistory.Critical                  1   620.77 686.77
## - EmploymentDuration.4.to.7               1   621.91 687.91
## - Purpose.Radio.Television                1   623.09 689.09
## - Purpose.UsedCar                         1   626.01 692.01
## - SavingsAccountBonds.Unknown             1   629.08 695.08
## - CheckingAccountStatus.none              1   641.34 707.34
## - Duration                                1   642.23 708.23
## 
## Step:  AIC=675.84
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Delay + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Retraining + 
##     Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - CreditHistory.Delay                     1   610.19 674.19
## - Purpose.Repairs                         1   610.38 674.38
## - Purpose.DomesticAppliance               1   610.39 674.39
## - Job.Management.SelfEmp.HighlyQualified  1   610.79 674.79
## - CreditHistory.ThisBank.AllPaid          1   610.86 674.86
## - ForeignWorker                           1   611.13 675.13
## - CheckingAccountStatus.0.to.200          1   611.17 675.17
## - SavingsAccountBonds.100.to.500          1   611.37 675.37
## - Purpose.Business                        1   611.76 675.76
## - Purpose.Other                           1   611.82 675.82
## <none>                                        609.84 675.84
## - OtherInstallmentPlans.None              1   611.90 675.90
## - Property.Insurance                      1   612.08 676.08
## - Telephone                               1   612.46 676.46
## - Property.CarOther                       1   612.86 676.86
## - Purpose.Retraining                      1   612.87 676.87
## - Personal.Female.NotSingle               1   613.00 677.00
## - SavingsAccountBonds.500.to.1000         1   613.05 677.05
## - Age                                     1   613.41 677.41
## - NumberExistingCredits                   1   613.46 677.46
## + Personal.Male.Married.Widowed           1   609.56 677.56
## + ResidenceDuration                       1   609.59 677.59
## + EmploymentDuration.1.to.4               1   609.61 677.61
## + Purpose.Education                       1   609.61 677.61
## + Job.UnskilledResident                   1   609.71 677.71
## + OtherDebtorsGuarantors.CoApplicant      1   609.73 677.73
## + EmploymentDuration.Unemployed           1   609.78 677.78
## + NumberPeopleMaintenance                 1   609.84 677.84
## + OtherInstallmentPlans.Stores            1   609.84 677.84
## - CheckingAccountStatus.gt.200            1   613.97 677.97
## - OtherDebtorsGuarantors.Guarantor        1   613.98 677.98
## - Housing.Own                             1   613.99 677.99
## - Purpose.Furniture.Equipment             1   618.38 682.38
## - SavingsAccountBonds.gt.1000             1   618.38 682.38
## - InstallmentRatePercentage               1   620.18 684.18
## - CreditHistory.Critical                  1   621.21 685.21
## - EmploymentDuration.4.to.7               1   622.50 686.50
## - Purpose.Radio.Television                1   623.16 687.16
## - Purpose.UsedCar                         1   626.15 690.15
## - SavingsAccountBonds.Unknown             1   629.51 693.51
## - CheckingAccountStatus.none              1   641.46 705.46
## - Duration                                1   642.35 706.35
## 
## Step:  AIC=674.19
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Retraining + 
##     Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Purpose.DomesticAppliance               1   610.71 672.71
## - Purpose.Repairs                         1   610.71 672.71
## - Job.Management.SelfEmp.HighlyQualified  1   611.21 673.21
## - CreditHistory.ThisBank.AllPaid          1   611.32 673.32
## - ForeignWorker                           1   611.43 673.43
## - CheckingAccountStatus.0.to.200          1   611.60 673.60
## - SavingsAccountBonds.100.to.500          1   611.77 673.77
## <none>                                        610.19 674.19
## - Purpose.Business                        1   612.24 674.24
## - Purpose.Other                           1   612.27 674.27
## - OtherInstallmentPlans.None              1   612.28 674.28
## - Property.Insurance                      1   612.41 674.41
## - Telephone                               1   613.02 675.02
## - Purpose.Retraining                      1   613.15 675.15
## - Property.CarOther                       1   613.24 675.24
## - SavingsAccountBonds.500.to.1000         1   613.35 675.35
## - NumberExistingCredits                   1   613.46 675.46
## - Personal.Female.NotSingle               1   613.48 675.48
## - Age                                     1   613.78 675.78
## + CreditHistory.Delay                     1   609.84 675.84
## + Personal.Male.Married.Widowed           1   609.89 675.89
## + EmploymentDuration.1.to.4               1   609.91 675.91
## + ResidenceDuration                       1   609.93 675.93
## + Purpose.Education                       1   609.98 675.98
## + Job.UnskilledResident                   1   610.04 676.04
## + OtherDebtorsGuarantors.CoApplicant      1   610.08 676.08
## + EmploymentDuration.Unemployed           1   610.13 676.13
## + NumberPeopleMaintenance                 1   610.19 676.19
## + OtherInstallmentPlans.Stores            1   610.19 676.19
## - OtherDebtorsGuarantors.Guarantor        1   614.19 676.19
## - Housing.Own                             1   614.29 676.29
## - CheckingAccountStatus.gt.200            1   614.44 676.44
## - Purpose.Furniture.Equipment             1   618.59 680.59
## - SavingsAccountBonds.gt.1000             1   618.81 680.81
## - InstallmentRatePercentage               1   620.70 682.70
## - CreditHistory.Critical                  1   621.44 683.44
## - EmploymentDuration.4.to.7               1   622.91 684.91
## - Purpose.Radio.Television                1   623.45 685.45
## - Purpose.UsedCar                         1   626.34 688.34
## - SavingsAccountBonds.Unknown             1   629.94 691.94
## - CheckingAccountStatus.none              1   642.09 704.09
## - Duration                                1   642.36 704.36
## 
## Step:  AIC=672.71
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.Repairs + Purpose.Retraining + Purpose.Business + 
##     Purpose.Other + SavingsAccountBonds.100.to.500 + SavingsAccountBonds.500.to.1000 + 
##     SavingsAccountBonds.gt.1000 + SavingsAccountBonds.Unknown + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Purpose.Repairs                         1   611.30 671.30
## - CreditHistory.ThisBank.AllPaid          1   611.78 671.78
## - Job.Management.SelfEmp.HighlyQualified  1   611.82 671.82
## - ForeignWorker                           1   611.90 671.90
## - CheckingAccountStatus.0.to.200          1   612.02 672.02
## - SavingsAccountBonds.100.to.500          1   612.35 672.35
## - Purpose.Business                        1   612.59 672.59
## <none>                                        610.71 672.71
## - Purpose.Other                           1   612.71 672.71
## - OtherInstallmentPlans.None              1   612.85 672.85
## - Property.Insurance                      1   613.04 673.04
## - Purpose.Retraining                      1   613.56 673.56
## - Telephone                               1   613.60 673.60
## - Personal.Female.NotSingle               1   613.83 673.83
## - Property.CarOther                       1   613.92 673.92
## - SavingsAccountBonds.500.to.1000         1   613.95 673.95
## - NumberExistingCredits                   1   614.06 674.06
## + Purpose.DomesticAppliance               1   610.19 674.19
## - Age                                     1   614.25 674.25
## + CreditHistory.Delay                     1   610.39 674.39
## + Purpose.Education                       1   610.44 674.44
## + EmploymentDuration.1.to.4               1   610.44 674.44
## + Personal.Male.Married.Widowed           1   610.45 674.45
## + ResidenceDuration                       1   610.47 674.47
## + Job.UnskilledResident                   1   610.58 674.58
## + OtherDebtorsGuarantors.CoApplicant      1   610.61 674.61
## + EmploymentDuration.Unemployed           1   610.63 674.63
## - OtherDebtorsGuarantors.Guarantor        1   614.64 674.64
## + NumberPeopleMaintenance                 1   610.70 674.70
## + OtherInstallmentPlans.Stores            1   610.71 674.71
## - CheckingAccountStatus.gt.200            1   614.94 674.94
## - Housing.Own                             1   615.21 675.21
## - Purpose.Furniture.Equipment             1   618.71 678.71
## - SavingsAccountBonds.gt.1000             1   619.20 679.20
## - InstallmentRatePercentage               1   621.03 681.03
## - CreditHistory.Critical                  1   621.73 681.73
## - EmploymentDuration.4.to.7               1   623.25 683.25
## - Purpose.Radio.Television                1   623.49 683.49
## - Purpose.UsedCar                         1   626.55 686.55
## - SavingsAccountBonds.Unknown             1   630.58 690.58
## - CheckingAccountStatus.none              1   642.19 702.19
## - Duration                                1   642.75 702.75
## 
## Step:  AIC=671.3
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own + Job.Management.SelfEmp.HighlyQualified
## 
##                                          Df Deviance    AIC
## - Job.Management.SelfEmp.HighlyQualified  1   612.31 670.31
## - CreditHistory.ThisBank.AllPaid          1   612.33 670.33
## - CheckingAccountStatus.0.to.200          1   612.49 670.49
## - ForeignWorker                           1   612.52 670.52
## - SavingsAccountBonds.100.to.500          1   613.09 671.09
## <none>                                        611.30 671.30
## - OtherInstallmentPlans.None              1   613.32 671.32
## - Purpose.Other                           1   613.42 671.42
## - Property.Insurance                      1   613.55 671.55
## - Purpose.Business                        1   613.55 671.55
## - Telephone                               1   614.22 672.22
## - Purpose.Retraining                      1   614.30 672.30
## - Personal.Female.NotSingle               1   614.38 672.38
## - Property.CarOther                       1   614.47 672.47
## - Age                                     1   614.65 672.65
## - SavingsAccountBonds.500.to.1000         1   614.67 672.67
## + Purpose.Repairs                         1   610.71 672.71
## + Purpose.DomesticAppliance               1   610.71 672.71
## - NumberExistingCredits                   1   614.82 672.82
## + CreditHistory.Delay                     1   611.00 673.00
## + EmploymentDuration.1.to.4               1   611.01 673.01
## + Personal.Male.Married.Widowed           1   611.02 673.02
## + ResidenceDuration                       1   611.07 673.07
## + Purpose.Education                       1   611.12 673.12
## + Job.UnskilledResident                   1   611.18 673.18
## + OtherDebtorsGuarantors.CoApplicant      1   611.20 673.20
## + EmploymentDuration.Unemployed           1   611.26 673.26
## - OtherDebtorsGuarantors.Guarantor        1   615.29 673.29
## + NumberPeopleMaintenance                 1   611.29 673.29
## + OtherInstallmentPlans.Stores            1   611.29 673.29
## - Housing.Own                             1   615.59 673.59
## - CheckingAccountStatus.gt.200            1   615.64 673.64
## - SavingsAccountBonds.gt.1000             1   619.59 677.59
## - Purpose.Furniture.Equipment             1   620.28 678.28
## - InstallmentRatePercentage               1   621.58 679.58
## - CreditHistory.Critical                  1   622.83 680.83
## - EmploymentDuration.4.to.7               1   623.87 681.87
## - Purpose.Radio.Television                1   625.58 683.58
## - Purpose.UsedCar                         1   627.99 685.99
## - SavingsAccountBonds.Unknown             1   632.00 690.00
## - CheckingAccountStatus.none              1   642.75 700.75
## - Duration                                1   643.36 701.36
## 
## Step:  AIC=670.31
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.ThisBank.AllPaid + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own
## 
##                                          Df Deviance    AIC
## - CreditHistory.ThisBank.AllPaid          1   613.45 669.45
## - CheckingAccountStatus.0.to.200          1   613.46 669.46
## - ForeignWorker                           1   613.49 669.49
## - Purpose.Other                           1   614.11 670.11
## - SavingsAccountBonds.100.to.500          1   614.16 670.16
## - OtherInstallmentPlans.None              1   614.30 670.30
## <none>                                        612.31 670.31
## - Telephone                               1   614.38 670.38
## - Purpose.Business                        1   614.52 670.52
## - Property.Insurance                      1   614.62 670.62
## + Job.Management.SelfEmp.HighlyQualified  1   611.30 671.30
## - Personal.Female.NotSingle               1   615.32 671.32
## - Age                                     1   615.33 671.33
## - Purpose.Retraining                      1   615.36 671.36
## - Property.CarOther                       1   615.46 671.46
## - NumberExistingCredits                   1   615.59 671.59
## + Purpose.DomesticAppliance               1   611.64 671.64
## + Purpose.Repairs                         1   611.82 671.82
## - SavingsAccountBonds.500.to.1000         1   615.83 671.83
## + EmploymentDuration.1.to.4               1   611.92 671.92
## + CreditHistory.Delay                     1   611.94 671.94
## + ResidenceDuration                       1   611.97 671.97
## + Personal.Male.Married.Widowed           1   612.07 672.07
## + Job.UnskilledResident                   1   612.09 672.09
## + Purpose.Education                       1   612.12 672.12
## + OtherDebtorsGuarantors.CoApplicant      1   612.24 672.24
## + EmploymentDuration.Unemployed           1   612.31 672.31
## + NumberPeopleMaintenance                 1   612.31 672.31
## + OtherInstallmentPlans.Stores            1   612.31 672.31
## - CheckingAccountStatus.gt.200            1   616.45 672.45
## - OtherDebtorsGuarantors.Guarantor        1   616.63 672.63
## - Housing.Own                             1   616.89 672.89
## - Purpose.Furniture.Equipment             1   621.17 677.17
## - SavingsAccountBonds.gt.1000             1   621.19 677.19
## - InstallmentRatePercentage               1   622.64 678.64
## - CreditHistory.Critical                  1   623.78 679.78
## - EmploymentDuration.4.to.7               1   625.21 681.21
## - Purpose.Radio.Television                1   626.71 682.71
## - Purpose.UsedCar                         1   628.20 684.20
## - SavingsAccountBonds.Unknown             1   633.18 689.18
## - CheckingAccountStatus.none              1   644.16 700.16
## - Duration                                1   645.31 701.31
## 
## Step:  AIC=669.45
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + ForeignWorker + CheckingAccountStatus.0.to.200 + 
##     CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.Critical + Purpose.UsedCar + Purpose.Furniture.Equipment + 
##     Purpose.Radio.Television + Purpose.Retraining + Purpose.Business + 
##     Purpose.Other + SavingsAccountBonds.100.to.500 + SavingsAccountBonds.500.to.1000 + 
##     SavingsAccountBonds.gt.1000 + SavingsAccountBonds.Unknown + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own
## 
##                                          Df Deviance    AIC
## - ForeignWorker                           1   614.62 668.62
## - CheckingAccountStatus.0.to.200          1   614.71 668.71
## - SavingsAccountBonds.100.to.500          1   615.16 669.16
## - Purpose.Other                           1   615.17 669.17
## <none>                                        613.45 669.45
## - Property.Insurance                      1   615.60 669.60
## - Purpose.Business                        1   615.64 669.64
## - Telephone                               1   615.70 669.70
## - Purpose.Retraining                      1   616.16 670.16
## + CreditHistory.ThisBank.AllPaid          1   612.31 670.31
## + Job.Management.SelfEmp.HighlyQualified  1   612.33 670.33
## - NumberExistingCredits                   1   616.48 670.48
## - Age                                     1   616.49 670.49
## - Property.CarOther                       1   616.50 670.50
## - OtherInstallmentPlans.None              1   616.60 670.60
## - Personal.Female.NotSingle               1   616.67 670.67
## - SavingsAccountBonds.500.to.1000         1   616.81 670.81
## + Purpose.DomesticAppliance               1   612.86 670.86
## + CreditHistory.Delay                     1   612.96 670.96
## + Purpose.Repairs                         1   613.00 671.00
## + EmploymentDuration.1.to.4               1   613.03 671.03
## + ResidenceDuration                       1   613.12 671.12
## + Purpose.Education                       1   613.25 671.25
## + Personal.Male.Married.Widowed           1   613.27 671.27
## + Job.UnskilledResident                   1   613.28 671.28
## + OtherDebtorsGuarantors.CoApplicant      1   613.42 671.42
## + EmploymentDuration.Unemployed           1   613.43 671.43
## + OtherInstallmentPlans.Stores            1   613.44 671.44
## + NumberPeopleMaintenance                 1   613.45 671.45
## - OtherDebtorsGuarantors.Guarantor        1   617.60 671.60
## - CheckingAccountStatus.gt.200            1   617.77 671.77
## - Housing.Own                             1   618.16 672.16
## - SavingsAccountBonds.gt.1000             1   622.07 676.07
## - Purpose.Furniture.Equipment             1   622.48 676.48
## - InstallmentRatePercentage               1   624.19 678.19
## - CreditHistory.Critical                  1   625.42 679.42
## - EmploymentDuration.4.to.7               1   625.99 679.99
## - Purpose.Radio.Television                1   628.09 682.09
## - Purpose.UsedCar                         1   629.24 683.24
## - SavingsAccountBonds.Unknown             1   634.04 688.04
## - CheckingAccountStatus.none              1   646.77 700.77
## - Duration                                1   646.89 700.89
## 
## Step:  AIC=668.62
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own
## 
##                                          Df Deviance    AIC
## - CheckingAccountStatus.0.to.200          1   615.82 667.82
## - SavingsAccountBonds.100.to.500          1   616.37 668.37
## - Purpose.Other                           1   616.56 668.56
## <none>                                        614.62 668.62
## - Property.Insurance                      1   616.64 668.64
## - Purpose.Business                        1   616.67 668.67
## - Telephone                               1   616.74 668.74
## - Purpose.Retraining                      1   617.22 669.22
## + ForeignWorker                           1   613.45 669.45
## + CreditHistory.ThisBank.AllPaid          1   613.49 669.49
## + Job.Management.SelfEmp.HighlyQualified  1   613.54 669.54
## - Age                                     1   617.64 669.64
## - Property.CarOther                       1   617.79 669.79
## - OtherInstallmentPlans.None              1   617.79 669.79
## - NumberExistingCredits                   1   617.90 669.90
## - SavingsAccountBonds.500.to.1000         1   617.96 669.96
## - Personal.Female.NotSingle               1   617.97 669.97
## + Purpose.DomesticAppliance               1   614.08 670.08
## + Purpose.Repairs                         1   614.14 670.14
## + EmploymentDuration.1.to.4               1   614.15 670.15
## + CreditHistory.Delay                     1   614.17 670.17
## + Purpose.Education                       1   614.35 670.35
## + ResidenceDuration                       1   614.35 670.35
## + Job.UnskilledResident                   1   614.40 670.40
## + Personal.Male.Married.Widowed           1   614.43 670.43
## + OtherDebtorsGuarantors.CoApplicant      1   614.56 670.56
## + EmploymentDuration.Unemployed           1   614.57 670.57
## + OtherInstallmentPlans.Stores            1   614.59 670.59
## + NumberPeopleMaintenance                 1   614.62 670.62
## - CheckingAccountStatus.gt.200            1   618.91 670.91
## - OtherDebtorsGuarantors.Guarantor        1   619.21 671.21
## - Housing.Own                             1   619.39 671.39
## - SavingsAccountBonds.gt.1000             1   623.22 675.22
## - Purpose.Furniture.Equipment             1   623.36 675.36
## - InstallmentRatePercentage               1   626.39 678.39
## - CreditHistory.Critical                  1   626.65 678.65
## - EmploymentDuration.4.to.7               1   627.41 679.41
## - Purpose.Radio.Television                1   628.80 680.80
## - Purpose.UsedCar                         1   630.37 682.37
## - SavingsAccountBonds.Unknown             1   635.58 687.58
## - CheckingAccountStatus.none              1   648.28 700.28
## - Duration                                1   649.58 701.58
## 
## Step:  AIC=667.82
## Class ~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
##     Telephone + CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
##     CreditHistory.Critical + Purpose.UsedCar + Purpose.Furniture.Equipment + 
##     Purpose.Radio.Television + Purpose.Retraining + Purpose.Business + 
##     Purpose.Other + SavingsAccountBonds.100.to.500 + SavingsAccountBonds.500.to.1000 + 
##     SavingsAccountBonds.gt.1000 + SavingsAccountBonds.Unknown + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own
## 
##                                          Df Deviance    AIC
## <none>                                        615.82 667.82
## - Purpose.Other                           1   617.89 667.89
## - Property.Insurance                      1   618.12 668.12
## - Telephone                               1   618.19 668.19
## - SavingsAccountBonds.100.to.500          1   618.22 668.22
## - Purpose.Business                        1   618.37 668.37
## - Purpose.Retraining                      1   618.47 668.47
## + CreditHistory.ThisBank.AllPaid          1   614.59 668.59
## + CheckingAccountStatus.0.to.200          1   614.62 668.62
## - Age                                     1   618.69 668.69
## + ForeignWorker                           1   614.71 668.71
## + Job.Management.SelfEmp.HighlyQualified  1   614.78 668.78
## - Property.CarOther                       1   618.97 668.97
## - OtherInstallmentPlans.None              1   619.01 669.01
## - Personal.Female.NotSingle               1   619.05 669.05
## - CheckingAccountStatus.gt.200            1   619.17 669.17
## - NumberExistingCredits                   1   619.22 669.22
## + CreditHistory.Delay                     1   615.28 669.28
## + Purpose.DomesticAppliance               1   615.39 669.39
## + Purpose.Repairs                         1   615.44 669.44
## - SavingsAccountBonds.500.to.1000         1   619.45 669.45
## + EmploymentDuration.1.to.4               1   615.49 669.49
## + ResidenceDuration                       1   615.59 669.59
## + Purpose.Education                       1   615.60 669.60
## + Job.UnskilledResident                   1   615.60 669.60
## + Personal.Male.Married.Widowed           1   615.69 669.69
## + EmploymentDuration.Unemployed           1   615.77 669.77
## + OtherInstallmentPlans.Stores            1   615.79 669.79
## + OtherDebtorsGuarantors.CoApplicant      1   615.80 669.80
## + NumberPeopleMaintenance                 1   615.82 669.82
## - OtherDebtorsGuarantors.Guarantor        1   620.39 670.39
## - Housing.Own                             1   620.85 670.85
## - Purpose.Furniture.Equipment             1   624.10 674.10
## - SavingsAccountBonds.gt.1000             1   625.47 675.47
## - InstallmentRatePercentage               1   627.79 677.79
## - CreditHistory.Critical                  1   628.24 678.24
## - EmploymentDuration.4.to.7               1   628.29 678.29
## - Purpose.Radio.Television                1   630.74 680.74
## - Purpose.UsedCar                         1   631.51 681.51
## - SavingsAccountBonds.Unknown             1   637.88 687.88
## - Duration                                1   650.35 700.35
## - CheckingAccountStatus.none              1   653.04 703.04
fitA= glm(Class~ Duration + InstallmentRatePercentage + Age + NumberExistingCredits + 
            Telephone + CheckingAccountStatus.gt.200 + CheckingAccountStatus.none + 
            CreditHistory.Critical + Purpose.UsedCar + Purpose.Furniture.Equipment + 
            Purpose.Radio.Television + Purpose.Retraining + Purpose.Business + 
            Purpose.Other + SavingsAccountBonds.100.to.500 + SavingsAccountBonds.500.to.1000 + 
            SavingsAccountBonds.gt.1000 + SavingsAccountBonds.Unknown + 
            EmploymentDuration.4.to.7 + Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
            Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
            Housing.Own, data=Training,family=binomial(link="logit"))

summary(fitA)
## 
## Call:
## glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     Age + NumberExistingCredits + Telephone + CheckingAccountStatus.gt.200 + 
##     CheckingAccountStatus.none + CreditHistory.Critical + Purpose.UsedCar + 
##     Purpose.Furniture.Equipment + Purpose.Radio.Television + 
##     Purpose.Retraining + Purpose.Business + Purpose.Other + SavingsAccountBonds.100.to.500 + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.Insurance + Property.CarOther + OtherInstallmentPlans.None + 
##     Housing.Own, family = binomial(link = "logit"), data = Training)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.7004  -0.6838   0.3661   0.7156   1.8642  
## 
## Coefficients:
##                                  Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       0.86480    0.69140   1.251 0.211008    
## Duration                         -0.05135    0.00905  -5.674 1.40e-08 ***
## InstallmentRatePercentage        -0.32319    0.09542  -3.387 0.000707 ***
## Age                               0.01683    0.01004   1.676 0.093672 .  
## NumberExistingCredits            -0.39466    0.21524  -1.834 0.066712 .  
## Telephone                        -0.33576    0.21932  -1.531 0.125798    
## CheckingAccountStatus.gt.200      0.74828    0.42177   1.774 0.076040 .  
## CheckingAccountStatus.none        1.38100    0.23758   5.813 6.14e-09 ***
## CreditHistory.Critical            0.96665    0.28190   3.429 0.000606 ***
## Purpose.UsedCar                   1.62515    0.44095   3.686 0.000228 ***
## Purpose.Furniture.Equipment       0.83571    0.29503   2.833 0.004616 ** 
## Purpose.Radio.Television          1.06281    0.28166   3.773 0.000161 ***
## Purpose.Retraining                1.66602    1.15849   1.438 0.150406    
## Purpose.Business                  0.55911    0.35353   1.581 0.113768    
## Purpose.Other                     1.15128    0.80555   1.429 0.152950    
## SavingsAccountBonds.100.to.500    0.51691    0.33932   1.523 0.127674    
## SavingsAccountBonds.500.to.1000   0.98244    0.55565   1.768 0.077046 .  
## SavingsAccountBonds.gt.1000       1.67091    0.60586   2.758 0.005817 ** 
## SavingsAccountBonds.Unknown       1.40885    0.32015   4.401 1.08e-05 ***
## EmploymentDuration.4.to.7         1.06096    0.31522   3.366 0.000763 ***
## Personal.Female.NotSingle        -0.39865    0.22159  -1.799 0.072017 .  
## OtherDebtorsGuarantors.Guarantor  1.09925    0.55201   1.991 0.046443 *  
## Property.Insurance               -0.41851    0.27591  -1.517 0.129312    
## Property.CarOther                -0.44161    0.24986  -1.767 0.077157 .  
## OtherInstallmentPlans.None        0.44107    0.24605   1.793 0.073040 .  
## Housing.Own                       0.53192    0.23702   2.244 0.024817 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 839.40  on 699  degrees of freedom
## Residual deviance: 615.82  on 674  degrees of freedom
## AIC: 667.82
## 
## Number of Fisher Scoring iterations: 5
fitB=update(fitA, .~. -Property.Insurance-Pupose.Other-Purpose.Business-Purpose.Retraining-CreditHistory.ThisBank.AllPaid-Age-
              -SavingsAccountBonds.100.to.500-CheckingAccountStatus.gt.200-Purpose.Furniture.Equipment, data=Training)

summary(fitB)
## 
## Call:
## glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     NumberExistingCredits + Telephone + CheckingAccountStatus.none + 
##     CreditHistory.Critical + Purpose.UsedCar + Purpose.Radio.Television + 
##     Purpose.Other + SavingsAccountBonds.100.to.500 + SavingsAccountBonds.500.to.1000 + 
##     SavingsAccountBonds.gt.1000 + SavingsAccountBonds.Unknown + 
##     EmploymentDuration.4.to.7 + Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Property.CarOther + OtherInstallmentPlans.None + Housing.Own, 
##     family = binomial(link = "logit"), data = Training)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.7996  -0.7238   0.3846   0.7174   1.7850  
## 
## Coefficients:
##                                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       2.000048   0.565221   3.539 0.000402 ***
## Duration                         -0.051730   0.008709  -5.940 2.85e-09 ***
## InstallmentRatePercentage        -0.333306   0.093165  -3.578 0.000347 ***
## NumberExistingCredits            -0.425480   0.208022  -2.045 0.040820 *  
## Telephone                        -0.365688   0.211358  -1.730 0.083598 .  
## CheckingAccountStatus.none        1.343646   0.232668   5.775 7.70e-09 ***
## CreditHistory.Critical            0.943476   0.275107   3.429 0.000605 ***
## Purpose.UsedCar                   1.279382   0.422676   3.027 0.002471 ** 
## Purpose.Radio.Television          0.682398   0.245011   2.785 0.005350 ** 
## Purpose.Other                     0.790116   0.783547   1.008 0.313270    
## SavingsAccountBonds.100.to.500    0.340873   0.329847   1.033 0.301404    
## SavingsAccountBonds.500.to.1000   0.914177   0.544155   1.680 0.092959 .  
## SavingsAccountBonds.gt.1000       1.573564   0.599961   2.623 0.008722 ** 
## SavingsAccountBonds.Unknown       1.277667   0.307240   4.159 3.20e-05 ***
## EmploymentDuration.4.to.7         0.971311   0.305734   3.177 0.001488 ** 
## Personal.Female.NotSingle        -0.481573   0.212419  -2.267 0.023385 *  
## OtherDebtorsGuarantors.Guarantor  1.063400   0.545708   1.949 0.051336 .  
## Property.CarOther                -0.273606   0.217484  -1.258 0.208372    
## OtherInstallmentPlans.None        0.388218   0.240982   1.611 0.107183    
## Housing.Own                       0.467478   0.224874   2.079 0.037632 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 839.4  on 699  degrees of freedom
## Residual deviance: 633.3  on 680  degrees of freedom
## AIC: 673.3
## 
## Number of Fisher Scoring iterations: 5
fitC=update(fitB, .~. -Purpose.Other-SavingsAccountBonds.100.to.500-Property.CarOther-
              OtherInstallmentPlans.None , data=Training)
summary(fitC)
## 
## Call:
## glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     NumberExistingCredits + Telephone + CheckingAccountStatus.none + 
##     CreditHistory.Critical + Purpose.UsedCar + Purpose.Radio.Television + 
##     SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor + 
##     Housing.Own, family = binomial(link = "logit"), data = Training)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.7827  -0.7458   0.4047   0.7309   1.9015  
## 
## Coefficients:
##                                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       2.405175   0.522872   4.600 4.23e-06 ***
## Duration                         -0.052246   0.008615  -6.065 1.32e-09 ***
## InstallmentRatePercentage        -0.329893   0.092018  -3.585 0.000337 ***
## NumberExistingCredits            -0.468822   0.206595  -2.269 0.023251 *  
## Telephone                        -0.364564   0.208299  -1.750 0.080085 .  
## CheckingAccountStatus.none        1.350205   0.229584   5.881 4.08e-09 ***
## CreditHistory.Critical            0.979767   0.274226   3.573 0.000353 ***
## Purpose.UsedCar                   1.207966   0.420928   2.870 0.004108 ** 
## Purpose.Radio.Television          0.656753   0.241949   2.714 0.006639 ** 
## SavingsAccountBonds.500.to.1000   0.845872   0.541352   1.563 0.118166    
## SavingsAccountBonds.gt.1000       1.458072   0.590976   2.467 0.013616 *  
## SavingsAccountBonds.Unknown       1.231239   0.302749   4.067 4.76e-05 ***
## EmploymentDuration.4.to.7         0.982029   0.301118   3.261 0.001109 ** 
## Personal.Female.NotSingle        -0.497568   0.210264  -2.366 0.017962 *  
## OtherDebtorsGuarantors.Guarantor  1.167807   0.545229   2.142 0.032204 *  
## Housing.Own                       0.371740   0.217475   1.709 0.087387 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 839.40  on 699  degrees of freedom
## Residual deviance: 639.29  on 684  degrees of freedom
## AIC: 671.29
## 
## Number of Fisher Scoring iterations: 5
fitD=update(fitC, .~. -SavingsAccountBonds.500.to.1000 -Telephone -Housing.Own, data=Training)
summary(fitD)
## 
## Call:
## glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     NumberExistingCredits + CheckingAccountStatus.none + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Radio.Television + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor, 
##     family = binomial(link = "logit"), data = Training)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.8115  -0.7684   0.4072   0.7600   1.9909  
## 
## Coefficients:
##                                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       2.468812   0.456273   5.411 6.27e-08 ***
## Duration                         -0.051233   0.008419  -6.085 1.16e-09 ***
## InstallmentRatePercentage        -0.335585   0.091353  -3.674 0.000239 ***
## NumberExistingCredits            -0.484316   0.202394  -2.393 0.016714 *  
## CheckingAccountStatus.none        1.454046   0.227158   6.401 1.54e-10 ***
## CreditHistory.Critical            1.022213   0.270278   3.782 0.000156 ***
## Purpose.UsedCar                   1.177503   0.407459   2.890 0.003854 ** 
## Purpose.Radio.Television          0.681120   0.238236   2.859 0.004250 ** 
## SavingsAccountBonds.gt.1000       1.442411   0.593740   2.429 0.015125 *  
## SavingsAccountBonds.Unknown       1.215718   0.300093   4.051 5.10e-05 ***
## EmploymentDuration.4.to.7         0.994675   0.295471   3.366 0.000762 ***
## Personal.Female.NotSingle        -0.539016   0.208117  -2.590 0.009598 ** 
## OtherDebtorsGuarantors.Guarantor  1.133165   0.540434   2.097 0.036014 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 839.40  on 699  degrees of freedom
## Residual deviance: 647.97  on 687  degrees of freedom
## AIC: 673.97
## 
## Number of Fisher Scoring iterations: 5
Pred=predict(fitD, newdata=Training[,-10], type="response" )
Pred1=ifelse(Pred<0.5,0,1)
confusionMatrix(table(Training$Class,Pred1,dnn=list('actual','predicted')))
## Confusion Matrix and Statistics
## 
##       predicted
## actual   0   1
##      0  88 113
##      1  44 455
##                                          
##                Accuracy : 0.7757         
##                  95% CI : (0.743, 0.8061)
##     No Information Rate : 0.8114         
##     P-Value [Acc > NIR] : 0.9922         
##                                          
##                   Kappa : 0.3896         
##  Mcnemar's Test P-Value : 5.731e-08      
##                                          
##             Sensitivity : 0.6667         
##             Specificity : 0.8011         
##          Pos Pred Value : 0.4378         
##          Neg Pred Value : 0.9118         
##              Prevalence : 0.1886         
##          Detection Rate : 0.1257         
##    Detection Prevalence : 0.2871         
##       Balanced Accuracy : 0.7339         
##                                          
##        'Positive' Class : 0              
## 
#install.packages("ResourceSelection")
library(ResourceSelection)
## ResourceSelection 0.3-0   2016-11-04
hoslem.test(Training$Class,fitted(fitD),g=10)
## 
##  Hosmer and Lemeshow goodness of fit (GOF) test
## 
## data:  Training$Class, fitted(fitD)
## X-squared = 6.6571, df = 8, p-value = 0.574
#install.packages("survey")
library(survey)
## Loading required package: grid
## Loading required package: Matrix
## Loading required package: survival
## 
## Attaching package: 'survival'
## The following object is masked from 'package:caret':
## 
##     cluster
## 
## Attaching package: 'survey'
## The following object is masked from 'package:raster':
## 
##     cv
## The following object is masked from 'package:graphics':
## 
##     dotchart
regTermTest(fitD,"Personal.Female.NotSingle")
## Wald test for Personal.Female.NotSingle
##  in glm(formula = Class ~ Duration + InstallmentRatePercentage + 
##     NumberExistingCredits + CheckingAccountStatus.none + CreditHistory.Critical + 
##     Purpose.UsedCar + Purpose.Radio.Television + SavingsAccountBonds.gt.1000 + 
##     SavingsAccountBonds.Unknown + EmploymentDuration.4.to.7 + 
##     Personal.Female.NotSingle + OtherDebtorsGuarantors.Guarantor, 
##     family = binomial(link = "logit"), data = Training)
## F =  6.707942  on  1  and  687  df: p= 0.0098019
library(pscl)
## Classes and Methods for R developed in the
## Political Science Computational Laboratory
## Department of Political Science
## Stanford University
## Simon Jackman
## hurdle and zeroinfl functions by Achim Zeileis
pR2(fitD)
##          llh      llhNull           G2     McFadden         r2ML 
## -323.9850293 -419.7015062  191.4329539    0.2280585    0.2392691 
##         r2CU 
##    0.3425232
#install.packages("pscl")
#install.packages("InformationValue")
library(InformationValue)
## 
## Attaching package: 'InformationValue'
## The following objects are masked from 'package:caret':
## 
##     confusionMatrix, precision, sensitivity, specificity
plotROC(actuals=Training$Class,predictedScores=as.numeric(fitted(fitD)))

ks_plot(actuals=Training$Class,predictedScores=as.numeric(fitted(fitD)))

ks_stat(actuals=Training$Class,predictedScores=as.numeric(fitted(fitD)))
## [1] 0.4718