library(blorr)
library(ggplot2)
library(magrittr)

Model

model <- glm(y ~ ., data = bank_marketing, family = binomial(link = 'logit'))

Forward Selection

Selection Summary

blr_step_aic_forward(model)
#> Forward Selection Method 
#> ------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Entered: 
#> 
#> - duration 
#> - poutcome 
#> - month 
#> - contact 
#> - housing 
#> - loan 
#> - campaign 
#> - marital 
#> - education 
#> - age 
#> 
#> No more variables to be added.
#> 
#>                   Selection Summary                   
#> -----------------------------------------------------
#> Step    Variable       AIC         BIC       Deviance 
#> -----------------------------------------------------
#> 1       duration     2674.384    2687.217    2670.384 
#> 2       poutcome     2396.014    2396.014    2396.014 
#> 3       month        2274.109    2274.109    2274.109 
#> 4       contact      2207.884    2207.884    2207.884 
#> 5       housing      2184.550    2184.550    2184.550 
#> 6       loan         2171.972    2171.972    2171.972 
#> 7       campaign     2164.164    2164.164    2164.164 
#> 8       marital      2158.524    2158.524    2158.524 
#> 9       education    2155.837    2155.837    2155.837 
#> 10      age          2154.272    2154.272    2154.272 
#> -----------------------------------------------------

Detailed Output

blr_step_aic_forward(model, details = TRUE)
#> Forward Selection Method 
#> ------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#>  Step 0: AIC = 3216.659 
#>  y ~ 1 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> duration      1    2674.384    2687.217    2670.384 
#> poutcome      1    2952.014    2977.680    2944.014 
#> month         1    3068.991    3145.988    3044.991 
#> contact       1    3096.276    3115.525    3090.276 
#> housing       1    3146.378    3159.211    3142.378 
#> job           1    3163.390    3240.388    3139.390 
#> pdays         1    3179.547    3192.380    3175.547 
#> campaign      1    3187.507    3200.340    3183.507 
#> previous      1    3187.805    3200.638    3183.805 
#> loan          1    3191.998    3204.830    3187.998 
#> education     1    3197.612    3223.278    3189.612 
#> marital       1    3198.977    3218.226    3192.977 
#> balance       1    3200.456    3213.289    3196.456 
#> default       1    3212.619    3225.452    3208.619 
#> age           1    3213.913    3226.746    3209.913 
#> day           1    3215.266    3228.099    3211.266 
#> ---------------------------------------------------
#> 
#> 
#> - duration 
#> 
#> 
#>  Step 1 : AIC = 2674.384 
#>  y ~ duration 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> poutcome      1    2396.014    2428.097    2386.014 
#> month         1    2501.687    2585.101    2475.687 
#> contact       1    2538.800    2564.466    2530.800 
#> housing       1    2598.905    2618.155    2592.905 
#> job           1    2604.187    2687.601    2578.187 
#> pdays         1    2625.686    2644.936    2619.686 
#> previous      1    2632.723    2651.973    2626.723 
#> campaign      1    2649.575    2668.824    2643.575 
#> education     1    2649.712    2681.794    2639.712 
#> loan          1    2650.927    2670.177    2644.927 
#> marital       1    2655.816    2681.482    2647.816 
#> balance       1    2665.192    2684.441    2659.192 
#> age           1    2669.825    2689.075    2663.825 
#> default       1    2671.465    2690.714    2665.465 
#> day           1    2671.945    2691.194    2665.945 
#> ---------------------------------------------------
#> 
#> - poutcome 
#> 
#> 
#>  Step 2 : AIC = 2396.014 
#>  y ~ duration + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> month         1    2274.109    2376.773    2242.109 
#> contact       1    2315.977    2360.892    2301.977 
#> housing       1    2330.897    2369.396    2318.897 
#> job           1    2360.724    2463.387    2328.724 
#> education     1    2374.980    2426.312    2358.980 
#> loan          1    2379.044    2417.543    2367.044 
#> marital       1    2381.743    2426.658    2367.743 
#> campaign      1    2383.767    2422.266    2371.767 
#> age           1    2394.129    2432.627    2382.129 
#> balance       1    2394.670    2433.169    2382.670 
#> default       1    2395.142    2433.641    2383.142 
#> pdays         1    2395.489    2433.988    2383.489 
#> day           1    2395.768    2434.267    2383.768 
#> previous      1    2397.323    2435.822    2385.323 
#> ---------------------------------------------------
#> 
#> - month 
#> 
#> 
#>  Step 3 : AIC = 2274.109 
#>  y ~ duration + poutcome + month 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> contact       1    2207.884    2323.381    2171.884 
#> housing       1    2248.264    2357.344    2214.264 
#> loan          1    2261.151    2370.231    2227.151 
#> education     1    2262.659    2384.572    2224.659 
#> marital       1    2262.944    2378.441    2226.944 
#> campaign      1    2263.636    2372.717    2229.636 
#> job           1    2268.492    2441.737    2214.492 
#> default       1    2274.291    2383.371    2240.291 
#> balance       1    2274.440    2383.520    2240.440 
#> previous      1    2275.315    2384.396    2241.315 
#> day           1    2275.696    2384.776    2241.696 
#> pdays         1    2275.699    2384.779    2241.699 
#> age           1    2276.044    2385.124    2242.044 
#> ---------------------------------------------------
#> 
#> - contact 
#> 
#> 
#>  Step 4 : AIC = 2207.884 
#>  y ~ duration + poutcome + month + contact 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> housing       1    2184.550    2306.463    2146.550 
#> loan          1    2194.028    2315.941    2156.028 
#> campaign      1    2199.390    2321.303    2161.390 
#> marital       1    2200.044    2328.374    2160.044 
#> education     1    2201.153    2335.900    2159.153 
#> job           1    2206.818    2392.896    2148.818 
#> default       1    2208.191    2330.105    2170.191 
#> balance       1    2208.199    2330.113    2170.199 
#> pdays         1    2208.994    2330.908    2170.994 
#> previous      1    2209.022    2330.935    2171.022 
#> age           1    2209.363    2331.277    2171.363 
#> day           1    2209.717    2331.630    2171.717 
#> ---------------------------------------------------
#> 
#> - housing 
#> 
#> 
#>  Step 5 : AIC = 2184.55 
#>  y ~ duration + poutcome + month + contact + housing 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> loan          1    2171.972    2300.302    2131.972 
#> campaign      1    2177.501    2305.831    2137.501 
#> marital       1    2177.790    2312.537    2135.790 
#> education     1    2178.893    2320.055    2134.893 
#> default       1    2184.500    2312.830    2144.500 
#> previous      1    2185.704    2314.034    2145.704 
#> balance       1    2185.723    2314.053    2145.723 
#> pdays         1    2186.347    2314.677    2146.347 
#> day           1    2186.533    2314.863    2146.533 
#> age           1    2186.538    2314.868    2146.538 
#> job           1    2187.688    2380.183    2127.688 
#> ---------------------------------------------------
#> 
#> - loan 
#> 
#> 
#>  Step 6 : AIC = 2171.972 
#>  y ~ duration + poutcome + month + contact + housing + loan 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> campaign      1    2164.164    2298.910    2122.164 
#> marital       1    2165.935    2307.098    2121.935 
#> education     1    2167.741    2315.320    2121.741 
#> default       1    2172.581    2307.328    2130.581 
#> previous      1    2172.993    2307.739    2130.993 
#> balance       1    2173.517    2308.263    2131.517 
#> pdays         1    2173.705    2308.451    2131.705 
#> day           1    2173.949    2308.695    2131.949 
#> age           1    2173.949    2308.696    2131.949 
#> job           1    2175.333    2374.244    2113.333 
#> ---------------------------------------------------
#> 
#> - campaign 
#> 
#> 
#>  Step 7 : AIC = 2164.164 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> marital       1    2158.524    2306.103    2112.524 
#> education     1    2159.748    2313.744    2111.748 
#> default       1    2164.942    2306.105    2120.942 
#> previous      1    2165.522    2306.685    2121.522 
#> balance       1    2165.643    2306.806    2121.643 
#> pdays         1    2165.931    2307.094    2121.931 
#> day           1    2165.994    2307.156    2121.994 
#> age           1    2166.153    2307.316    2122.153 
#> job           1    2168.292    2373.619    2104.292 
#> ---------------------------------------------------
#> 
#> - marital 
#> 
#> 
#>  Step 8 : AIC = 2158.524 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> education     1    2155.837    2322.666    2103.837 
#> age           1    2157.894    2311.890    2109.894 
#> default       1    2159.199    2313.195    2111.199 
#> balance       1    2159.872    2313.868    2111.872 
#> previous      1    2159.890    2313.885    2111.890 
#> day           1    2160.324    2314.320    2112.324 
#> pdays         1    2160.358    2314.353    2112.358 
#> job           1    2161.946    2380.107    2093.946 
#> ---------------------------------------------------
#> 
#> - education 
#> 
#> 
#>  Step 9 : AIC = 2155.837 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital + education 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> age           1    2154.272    2327.517    2100.272 
#> default       1    2156.625    2329.870    2102.625 
#> previous      1    2157.299    2330.544    2103.299 
#> balance       1    2157.538    2330.783    2103.538 
#> day           1    2157.550    2330.795    2103.550 
#> pdays         1    2157.730    2330.976    2103.730 
#> job           1    2159.754    2397.164    2085.754 
#> ---------------------------------------------------
#> 
#> - age 
#> 
#> 
#>  Step 10 : AIC = 2154.272 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital + education + age 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> default       1    2155.132    2334.794    2099.132 
#> previous      1    2155.627    2335.289    2099.627 
#> day           1    2155.942    2335.603    2099.942 
#> balance       1    2156.105    2335.767    2100.105 
#> pdays         1    2156.185    2335.847    2100.185 
#> job           1    2160.639    2404.465    2084.639 
#> ---------------------------------------------------
#> 
#> 
#> No more variables to be added.
#> 
#> Variables Entered: 
#> 
#> - duration 
#> - poutcome 
#> - month 
#> - contact 
#> - housing 
#> - loan 
#> - campaign 
#> - marital 
#> - education 
#> - age 
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#>                   Selection Summary                   
#> -----------------------------------------------------
#> Step    Variable       AIC         BIC       Deviance 
#> -----------------------------------------------------
#> 1       duration     2674.384    2687.217    2670.384 
#> 2       poutcome     2396.014    2396.014    2396.014 
#> 3       month        2274.109    2274.109    2274.109 
#> 4       contact      2207.884    2207.884    2207.884 
#> 5       housing      2184.550    2184.550    2184.550 
#> 6       loan         2171.972    2171.972    2171.972 
#> 7       campaign     2164.164    2164.164    2164.164 
#> 8       marital      2158.524    2158.524    2158.524 
#> 9       education    2155.837    2155.837    2155.837 
#> 10      age          2154.272    2154.272    2154.272 
#> -----------------------------------------------------

Plot

model %>%
  blr_step_aic_forward() %>%
  plot()
#> Forward Selection Method 
#> ------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Entered: 
#> 
#> - duration 
#> - poutcome 
#> - month 
#> - contact 
#> - housing 
#> - loan 
#> - campaign 
#> - marital 
#> - education 
#> - age 
#> 
#> No more variables to be added.

Backward Elimination

Selection Summary

blr_step_aic_backward(model)
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Removed: 
#> 
#> - job 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default
#> 
#> 
#>           Backward Elimination Summary          
#> ----------------------------------------------
#> Variable        AIC         BIC       Deviance 
#> ----------------------------------------------
#> Full Model    2168.379    2444.288    2082.379 
#> job           2161.974    2367.301    2097.974 
#> balance       2160.081    2358.992    2098.081 
#> pdays         2158.198    2350.692    2098.198 
#> day           2156.520    2342.598    2098.520 
#> previous      2155.132    2334.794    2099.132 
#> default       2154.272    2327.517    2100.272 
#> ----------------------------------------------

Detailed Output

blr_step_aic_backward(model, details = TRUE)
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#>  Step 0: AIC = 2168.379 
#>  y ~ age + job + marital + education + default + balance + housing + loan + contact + day + month + duration + campaign + pdays + previous + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> job          1     2161.974    2367.301    2097.974 
#> balance      1     2166.454    2435.946    2082.454 
#> pdays        1     2166.524    2436.016    2082.524 
#> day          1     2166.672    2436.164    2082.672 
#> previous     1     2167.064    2436.556    2083.064 
#> default      1     2167.404    2436.896    2083.404 
#> age          1     2167.426    2436.918    2083.426 
#> education    1     2170.473    2427.133    2090.473 
#> marital      1     2174.410    2437.486    2092.410 
#> campaign     1     2175.158    2444.651    2091.158 
#> loan         1     2178.932    2448.425    2094.932 
#> housing      1     2182.756    2452.249    2098.756 
#> contact      1     2223.027    2486.103    2141.027 
#> month        1     2225.989    2431.317    2161.989 
#> poutcome     1     2315.414    2572.074    2235.414 
#> duration     1     2750.857    3020.350    2666.857 
#> ---------------------------------------------------
#> 
#> 
#> - job 
#> 
#> 
#>   Step 1 : AIC = 2161.974 
#>  y ~ age + marital + education + default + balance + housing + loan + contact + day + month + duration + campaign + pdays + previous + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> balance      1     2160.081    2358.992    2098.081 
#> pdays        1     2160.086    2358.997    2098.086 
#> day          1     2160.271    2359.182    2098.271 
#> previous     1     2160.619    2359.530    2098.619 
#> default      1     2161.041    2359.952    2099.041 
#> age          1     2163.482    2362.393    2101.482 
#> education    1     2165.150    2351.228    2107.150 
#> campaign     1     2169.477    2368.389    2107.477 
#> marital      1     2169.513    2362.008    2109.513 
#> loan         1     2172.155    2371.066    2110.155 
#> housing      1     2176.398    2375.309    2114.398 
#> contact      1     2218.720    2411.215    2158.720 
#> month        1     2225.363    2360.110    2183.363 
#> poutcome     1     2313.283    2499.361    2255.283 
#> duration     1     2737.119    2936.030    2675.119 
#> ---------------------------------------------------
#> 
#> - balance 
#> 
#> 
#>   Step 2 : AIC = 2160.081 
#>  y ~ age + marital + education + default + housing + loan + contact + day + month + duration + campaign + pdays + previous + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> pdays        1     2158.198    2350.692    2098.198 
#> day          1     2158.392    2350.887    2098.392 
#> previous     1     2158.733    2351.228    2098.733 
#> default      1     2159.178    2351.672    2099.178 
#> age          1     2161.701    2354.196    2101.701 
#> education    1     2163.533    2343.195    2107.533 
#> campaign     1     2167.570    2360.065    2107.570 
#> marital      1     2167.622    2353.700    2109.622 
#> loan         1     2170.407    2362.901    2110.407 
#> housing      1     2174.712    2367.207    2114.712 
#> contact      1     2216.841    2402.919    2158.841 
#> month        1     2223.804    2352.133    2183.804 
#> poutcome     1     2312.874    2492.535    2256.874 
#> duration     1     2738.964    2931.458    2678.964 
#> ---------------------------------------------------
#> 
#> - pdays 
#> 
#> 
#>   Step 3 : AIC = 2158.198 
#>  y ~ age + marital + education + default + housing + loan + contact + day + month + duration + campaign + previous + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> day          1     2156.520    2342.598    2098.520 
#> previous     1     2156.801    2342.879    2098.801 
#> default      1     2157.307    2343.385    2099.307 
#> age          1     2159.837    2345.915    2101.837 
#> education    1     2161.730    2334.975    2107.730 
#> campaign     1     2165.740    2351.818    2107.740 
#> marital      1     2165.804    2345.466    2109.804 
#> loan         1     2168.467    2354.546    2110.467 
#> housing      1     2173.210    2359.288    2115.210 
#> contact      1     2214.841    2394.503    2158.841 
#> month        1     2221.861    2343.775    2183.861 
#> poutcome     1     2317.460    2490.705    2263.460 
#> duration     1     2736.979    2923.057    2678.979 
#> ---------------------------------------------------
#> 
#> - day 
#> 
#> 
#>   Step 4 : AIC = 2156.52 
#>  y ~ age + marital + education + default + housing + loan + contact + month + duration + campaign + previous + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> previous     1     2155.132    2334.794    2099.132 
#> default      1     2155.627    2335.289    2099.627 
#> age          1     2158.118    2337.780    2102.118 
#> education    1     2159.940    2326.768    2107.940 
#> campaign     1     2163.740    2343.402    2107.740 
#> marital      1     2164.069    2337.314    2110.069 
#> loan         1     2167.123    2346.784    2111.123 
#> housing      1     2171.891    2351.553    2115.891 
#> contact      1     2212.958    2386.203    2158.958 
#> month        1     2221.559    2337.056    2185.559 
#> poutcome     1     2316.222    2483.051    2264.222 
#> duration     1     2734.987    2914.649    2678.987 
#> ---------------------------------------------------
#> 
#> - previous 
#> 
#> 
#>   Step 5 : AIC = 2155.132 
#>  y ~ age + marital + education + default + housing + loan + contact + month + duration + campaign + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> default      1     2154.272    2327.517    2100.272 
#> age          1     2156.625    2329.870    2102.625 
#> education    1     2158.621    2319.034    2108.621 
#> marital      1     2162.584    2329.413    2110.584 
#> campaign     1     2162.680    2335.925    2108.680 
#> loan         1     2165.637    2338.883    2111.637 
#> housing      1     2170.521    2343.766    2116.521 
#> contact      1     2211.460    2378.289    2159.460 
#> month        1     2219.833    2328.914    2185.833 
#> poutcome     1     2328.851    2489.263    2278.851 
#> duration     1     2733.745    2906.990    2679.745 
#> ---------------------------------------------------
#> 
#> - default 
#> 
#> 
#>   Step 6 : AIC = 2154.272 
#>  y ~ age + marital + education + housing + loan + contact + month + duration + campaign + poutcome 
#> 
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> age          1     2155.837    2322.666    2103.837 
#> education    1     2157.894    2311.890    2109.894 
#> marital      1     2161.646    2322.059    2111.646 
#> campaign     1     2161.983    2328.812    2109.983 
#> loan         1     2165.333    2332.162    2113.333 
#> housing      1     2169.510    2336.339    2117.510 
#> contact      1     2210.770    2371.183    2160.770 
#> month        1     2219.654    2322.318    2187.654 
#> poutcome     1     2328.640    2482.636    2280.640 
#> duration     1     2733.878    2900.707    2681.878 
#> ---------------------------------------------------
#> 
#> No more variables to be removed.
#> 
#> Variables Removed: 
#> 
#> - job 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default 
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#> 
#>           Backward Elimination Summary          
#> ----------------------------------------------
#> Variable        AIC         BIC       Deviance 
#> ----------------------------------------------
#> Full Model    2168.379    2444.288    2082.379 
#> job           2161.974    2367.301    2097.974 
#> balance       2160.081    2358.992    2098.081 
#> pdays         2158.198    2350.692    2098.198 
#> day           2156.520    2342.598    2098.520 
#> previous      2155.132    2334.794    2099.132 
#> default       2154.272    2327.517    2100.272 
#> ----------------------------------------------

Plot

model %>%
  blr_step_aic_backward() %>%
  plot()
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Removed: 
#> 
#> - job 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default
#> Warning: Removed 2 rows containing missing values (geom_path).
#> Warning: Removed 2 rows containing missing values (geom_point).
#> Warning: Removed 2 rows containing missing values (geom_text).

Stepwise Selection

Selection Summary

blr_step_aic_both(model)
#> Stepwise Selection Method 
#> -------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Entered/Removed: 
#> 
#> - duration added 
#> - poutcome added 
#> - month added 
#> - contact added 
#> - housing added 
#> - loan added 
#> - campaign added 
#> - marital added 
#> - education added 
#> - age added 
#> 
#> No more variables to be added or removed.
#> 
#> 
#>                      Stepwise Summary                      
#> ---------------------------------------------------------
#> Variable      Method       AIC         BIC       Deviance 
#> ---------------------------------------------------------
#> duration     addition    2674.384    2687.217    2670.384 
#> poutcome     addition    2396.014    2428.097    2386.014 
#> month        addition    2274.109    2376.773    2242.109 
#> contact      addition    2207.884    2323.381    2171.884 
#> housing      addition    2184.550    2306.463    2146.550 
#> loan         addition    2171.972    2300.302    2131.972 
#> campaign     addition    2164.164    2298.910    2122.164 
#> marital      addition    2158.524    2306.103    2112.524 
#> education    addition    2155.837    2322.666    2103.837 
#> age          addition    2154.272    2327.517    2100.272 
#> ---------------------------------------------------------

Detailed Output

blr_step_aic_both(model, details = TRUE)
#> Stepwise Selection Method 
#> -------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#>  Step 0: AIC = 3216.659 
#>  y ~ 1 
#> 
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> duration      1    2674.384    2687.217    2670.384 
#> poutcome      1    2952.014    2977.680    2944.014 
#> month         1    3068.991    3145.988    3044.991 
#> contact       1    3096.276    3115.525    3090.276 
#> housing       1    3146.378    3159.211    3142.378 
#> job           1    3163.390    3240.388    3139.390 
#> pdays         1    3179.547    3192.380    3175.547 
#> campaign      1    3187.507    3200.340    3183.507 
#> previous      1    3187.805    3200.638    3183.805 
#> loan          1    3191.998    3204.830    3187.998 
#> education     1    3197.612    3223.278    3189.612 
#> marital       1    3198.977    3218.226    3192.977 
#> balance       1    3200.456    3213.289    3196.456 
#> default       1    3212.619    3225.452    3208.619 
#> age           1    3213.913    3226.746    3209.913 
#> day           1    3215.266    3228.099    3211.266 
#> ---------------------------------------------------
#> 
#> - duration added 
#> 
#> 
#>  Step 1 : AIC = 2674.384 
#>  y ~ duration 
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> poutcome      1    2396.014    2428.097    2386.014 
#> month         1    2501.687    2585.101    2475.687 
#> contact       1    2538.800    2564.466    2530.800 
#> housing       1    2598.905    2618.155    2592.905 
#> job           1    2604.187    2687.601    2578.187 
#> pdays         1    2625.686    2644.936    2619.686 
#> previous      1    2632.723    2651.973    2626.723 
#> campaign      1    2649.575    2668.824    2643.575 
#> education     1    2649.712    2681.794    2639.712 
#> loan          1    2650.927    2670.177    2644.927 
#> marital       1    2655.816    2681.482    2647.816 
#> balance       1    2665.192    2684.441    2659.192 
#> age           1    2669.825    2689.075    2663.825 
#> default       1    2671.465    2690.714    2665.465 
#> day           1    2671.945    2691.194    2665.945 
#> ---------------------------------------------------
#> 
#> - poutcome added 
#> 
#> 
#>  Step 2 : AIC = 2396.014 
#>  y ~ duration + poutcome 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> poutcome      1    2674.384    2687.217    2670.384 
#> duration      1    2952.014    2977.680    2944.014 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> month         1    2274.109    2376.773    2242.109 
#> contact       1    2315.977    2360.892    2301.977 
#> housing       1    2330.897    2369.396    2318.897 
#> job           1    2360.724    2463.387    2328.724 
#> education     1    2374.980    2426.312    2358.980 
#> loan          1    2379.044    2417.543    2367.044 
#> marital       1    2381.743    2426.658    2367.743 
#> campaign      1    2383.767    2422.266    2371.767 
#> age           1    2394.129    2432.627    2382.129 
#> balance       1    2394.670    2433.169    2382.670 
#> default       1    2395.142    2433.641    2383.142 
#> pdays         1    2395.489    2433.988    2383.489 
#> day           1    2395.768    2434.267    2383.768 
#> previous      1    2397.323    2435.822    2385.323 
#> ---------------------------------------------------
#> 
#> - month added 
#> 
#> 
#>  Step 3 : AIC = 2274.109 
#>  y ~ duration + poutcome + month 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> month         1    2396.014    2428.097    2386.014 
#> poutcome      1    2501.687    2585.101    2475.687 
#> duration      1    2849.726    2945.973    2819.726 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> contact       1    2207.884    2323.381    2171.884 
#> housing       1    2248.264    2357.344    2214.264 
#> loan          1    2261.151    2370.231    2227.151 
#> education     1    2262.659    2384.572    2224.659 
#> marital       1    2262.944    2378.441    2226.944 
#> campaign      1    2263.636    2372.717    2229.636 
#> job           1    2268.492    2441.737    2214.492 
#> default       1    2274.291    2383.371    2240.291 
#> balance       1    2274.440    2383.520    2240.440 
#> previous      1    2275.315    2384.396    2241.315 
#> day           1    2275.696    2384.776    2241.696 
#> pdays         1    2275.699    2384.779    2241.699 
#> age           1    2276.044    2385.124    2242.044 
#> ---------------------------------------------------
#> 
#> - contact added 
#> 
#> 
#>  Step 4 : AIC = 2207.884 
#>  y ~ duration + poutcome + month + contact 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> contact       1    2274.109    2376.773    2242.109 
#> month         1    2315.977    2360.892    2301.977 
#> poutcome      1    2398.847    2495.094    2368.847 
#> duration      1    2791.323    2900.403    2757.323 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> housing       1    2184.550    2306.463    2146.550 
#> loan          1    2194.028    2315.941    2156.028 
#> campaign      1    2199.390    2321.303    2161.390 
#> marital       1    2200.044    2328.374    2160.044 
#> education     1    2201.153    2335.900    2159.153 
#> job           1    2206.818    2392.896    2148.818 
#> default       1    2208.191    2330.105    2170.191 
#> balance       1    2208.199    2330.113    2170.199 
#> pdays         1    2208.994    2330.908    2170.994 
#> previous      1    2209.022    2330.935    2171.022 
#> age           1    2209.363    2331.277    2171.363 
#> day           1    2209.717    2331.630    2171.717 
#> ---------------------------------------------------
#> 
#> - housing added 
#> 
#> 
#>  Step 5 : AIC = 2184.55 
#>  y ~ duration + poutcome + month + contact + housing 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> housing       1    2207.884    2323.381    2171.884 
#> contact       1    2248.264    2357.344    2214.264 
#> month         1    2272.371    2323.703    2256.371 
#> poutcome      1    2368.613    2471.277    2336.613 
#> duration      1    2764.395    2879.892    2728.395 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> loan          1    2171.972    2300.302    2131.972 
#> campaign      1    2177.501    2305.831    2137.501 
#> marital       1    2177.790    2312.537    2135.790 
#> education     1    2178.893    2320.055    2134.893 
#> default       1    2184.500    2312.830    2144.500 
#> previous      1    2185.704    2314.034    2145.704 
#> balance       1    2185.723    2314.053    2145.723 
#> pdays         1    2186.347    2314.677    2146.347 
#> day           1    2186.533    2314.863    2146.533 
#> age           1    2186.538    2314.868    2146.538 
#> job           1    2187.688    2380.183    2127.688 
#> ---------------------------------------------------
#> 
#> - loan added 
#> 
#> 
#>  Step 6 : AIC = 2171.972 
#>  y ~ duration + poutcome + month + contact + housing + loan 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> loan          1    2184.550    2306.463    2146.550 
#> housing       1    2194.028    2315.941    2156.028 
#> contact       1    2236.449    2351.946    2200.449 
#> month         1    2254.571    2312.320    2236.571 
#> poutcome      1    2352.384    2461.464    2318.384 
#> duration      1    2749.734    2871.647    2711.734 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> campaign      1    2164.164    2298.910    2122.164 
#> marital       1    2165.935    2307.098    2121.935 
#> education     1    2167.741    2315.320    2121.741 
#> default       1    2172.581    2307.328    2130.581 
#> previous      1    2172.993    2307.739    2130.993 
#> balance       1    2173.517    2308.263    2131.517 
#> pdays         1    2173.705    2308.451    2131.705 
#> day           1    2173.949    2308.695    2131.949 
#> age           1    2173.949    2308.696    2131.949 
#> job           1    2175.333    2374.244    2113.333 
#> ---------------------------------------------------
#> 
#> - campaign added 
#> 
#> 
#>  Step 7 : AIC = 2164.164 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> campaign      1    2171.972    2300.302    2131.972 
#> loan          1    2177.501    2305.831    2137.501 
#> housing       1    2184.780    2313.109    2144.780 
#> contact       1    2226.786    2348.699    2188.786 
#> month         1    2240.156    2304.321    2220.156 
#> poutcome      1    2339.886    2455.383    2303.886 
#> duration      1    2739.030    2867.360    2699.030 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> marital       1    2158.524    2306.103    2112.524 
#> education     1    2159.748    2313.744    2111.748 
#> default       1    2164.942    2306.105    2120.942 
#> previous      1    2165.522    2306.685    2121.522 
#> balance       1    2165.643    2306.806    2121.643 
#> pdays         1    2165.931    2307.094    2121.931 
#> day           1    2165.994    2307.156    2121.994 
#> age           1    2166.153    2307.316    2122.153 
#> job           1    2168.292    2373.619    2104.292 
#> ---------------------------------------------------
#> 
#> - marital added 
#> 
#> 
#>  Step 8 : AIC = 2158.524 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> marital       1    2164.164    2298.910    2122.164 
#> campaign      1    2165.935    2307.098    2121.935 
#> loan          1    2171.156    2312.319    2127.156 
#> housing       1    2178.493    2319.655    2134.493 
#> contact       1    2217.559    2352.305    2175.559 
#> month         1    2231.188    2308.185    2207.188 
#> poutcome      1    2333.422    2461.752    2293.422 
#> duration      1    2734.162    2875.325    2690.162 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> education     1    2155.837    2322.666    2103.837 
#> age           1    2157.894    2311.890    2109.894 
#> default       1    2159.199    2313.195    2111.199 
#> balance       1    2159.872    2313.868    2111.872 
#> previous      1    2159.890    2313.885    2111.890 
#> day           1    2160.324    2314.320    2112.324 
#> pdays         1    2160.358    2314.353    2112.358 
#> job           1    2161.946    2380.107    2093.946 
#> ---------------------------------------------------
#> 
#> - education added 
#> 
#> 
#>  Step 9 : AIC = 2155.837 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital + education 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> education     1    2158.524    2306.103    2112.524 
#> marital       1    2159.748    2313.744    2111.748 
#> campaign      1    2163.512    2323.925    2113.512 
#> loan          1    2167.139    2327.552    2117.139 
#> housing       1    2174.888    2335.301    2124.888 
#> contact       1    2211.259    2365.255    2163.259 
#> month         1    2225.317    2321.564    2195.317 
#> poutcome      1    2331.650    2479.229    2285.650 
#> duration      1    2735.698    2896.111    2685.698 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> age           1    2154.272    2327.517    2100.272 
#> default       1    2156.625    2329.870    2102.625 
#> previous      1    2157.299    2330.544    2103.299 
#> balance       1    2157.538    2330.783    2103.538 
#> day           1    2157.550    2330.795    2103.550 
#> pdays         1    2157.730    2330.976    2103.730 
#> job           1    2159.754    2397.164    2085.754 
#> ---------------------------------------------------
#> 
#> - age added 
#> 
#> 
#>  Step 10 : AIC = 2154.272 
#>  y ~ duration + poutcome + month + contact + housing + loan + campaign + marital + education + age 
#> 
#>              Remove Existing Variables             
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> age           1    2155.837    2322.666    2103.837 
#> education     1    2157.894    2311.890    2109.894 
#> marital       1    2161.646    2322.059    2111.646 
#> campaign      1    2161.983    2328.812    2109.983 
#> loan          1    2165.333    2332.162    2113.333 
#> housing       1    2169.510    2336.339    2117.510 
#> contact       1    2210.770    2371.183    2160.770 
#> month         1    2219.654    2322.318    2187.654 
#> poutcome      1    2328.640    2482.636    2280.640 
#> duration      1    2733.878    2900.707    2681.878 
#> ---------------------------------------------------
#> 
#>                  Enter New Variables               
#> ---------------------------------------------------
#> Variable     DF      AIC         BIC       Deviance 
#> ---------------------------------------------------
#> default       1    2155.132    2334.794    2099.132 
#> previous      1    2155.627    2335.289    2099.627 
#> day           1    2155.942    2335.603    2099.942 
#> balance       1    2156.105    2335.767    2100.105 
#> pdays         1    2156.185    2335.847    2100.185 
#> job           1    2160.639    2404.465    2084.639 
#> ---------------------------------------------------
#> 
#> 
#> No more variables to be added or removed.
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#> 
#>                      Stepwise Summary                      
#> ---------------------------------------------------------
#> Variable      Method       AIC         BIC       Deviance 
#> ---------------------------------------------------------
#> duration     addition    2674.384    2687.217    2670.384 
#> poutcome     addition    2396.014    2428.097    2386.014 
#> month        addition    2274.109    2376.773    2242.109 
#> contact      addition    2207.884    2323.381    2171.884 
#> housing      addition    2184.550    2306.463    2146.550 
#> loan         addition    2171.972    2300.302    2131.972 
#> campaign     addition    2164.164    2298.910    2122.164 
#> marital      addition    2158.524    2306.103    2112.524 
#> education    addition    2155.837    2322.666    2103.837 
#> age          addition    2154.272    2327.517    2100.272 
#> ---------------------------------------------------------

Plot

model %>%
  blr_step_aic_both() %>%
  plot()
#> Stepwise Selection Method 
#> -------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> 
#> Variables Entered/Removed: 
#> 
#> - duration added 
#> - poutcome added 
#> - month added 
#> - contact added 
#> - housing added 
#> - loan added 
#> - campaign added 
#> - marital added 
#> - education added 
#> - age added 
#> 
#> No more variables to be added or removed.

Forward Selection

Selection Summary

blr_step_p_forward(model)
#> Forward Selection Method    
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> Variables Entered: 
#> 
#> - duration 
#> - poutcome 
#> - month 
#> - contact 
#> - housing 
#> - loan 
#> - campaign 
#> - marital 
#> - education 
#> - age 
#> - job 
#> 
#> No more variables to be added.
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#>                    Selection Summary                     
#> --------------------------------------------------------
#>         Variable                                            
#> Step     Entered        AIC          BIC       Deviance     
#> --------------------------------------------------------
#>    1    duration     2674.3838    2687.2168    2670.3838    
#>    2    poutcome     2396.0143    2428.0968    2386.0143    
#>    3    month        2274.1092    2376.7730    2242.1092    
#>    4    contact      2207.8841    2323.3809    2171.8841    
#>    5    housing      2184.5501    2306.4634    2146.5501    
#>    6    loan         2171.9722    2300.3020    2131.9722    
#>    7    campaign     2164.1639    2298.9102    2122.1639    
#>    8    marital      2158.5237    2306.1029    2112.5237    
#>    9    education    2155.8369    2322.6656    2103.8369    
#>   10    age          2154.2718    2327.5170    2100.2718    
#>   11    job          2160.6387    2404.4652    2084.6387    
#> --------------------------------------------------------

Detailed Output

blr_step_p_forward(model, details = TRUE)
#> Forward Selection Method    
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> 
#> Forward Selection: Step 1 
#> 
#> - duration 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4519           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                    Maximum Likelihood Estimates                    
#> ------------------------------------------------------------------
#>  Parameter     DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ------------------------------------------------------------------
#> (Intercept)    1     -3.2978        0.0858    -38.4526      0.0000 
#>  duration      1      0.0037         2e-04     20.8847      0.0000 
#> ------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8181          Somers' D        0.6379   
#> % Discordant          0.1809          Gamma            0.6372   
#> % Tied                0.0010          Tau-a            0.1291   
#> Pairs                2070068          c                0.8186   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 2 
#> 
#> - poutcome 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4516           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                      
#> ----------------------------------------------------------------------
#>    Parameter       DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ----------------------------------------------------------------------
#>   (Intercept)      1     -3.7304        0.1036    -36.0223      0.0000 
#>    duration        1      0.0039         2e-04     20.8282      0.0000 
#> poutcomefailure    1      0.4597        0.1662      2.7658      0.0057 
#>  poutcomeother     1      0.9144        0.2289      3.9955       1e-04 
#> poutcomesuccess    1      3.3439        0.2027     16.4967      0.0000 
#> ----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8606          Somers' D        0.7219   
#> % Discordant          0.1390          Gamma            0.7216   
#> % Tied                5e-04           Tau-a            0.1462   
#> Pairs                2070068          c                0.8608   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 3 
#> 
#> - month 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4505           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                      
#> ----------------------------------------------------------------------
#>    Parameter       DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ----------------------------------------------------------------------
#>   (Intercept)      1     -4.4977        0.1634    -27.5205      0.0000 
#>    duration        1      0.0041         2e-04     20.9764      0.0000 
#> poutcomefailure    1      0.2289        0.1802      1.2704      0.2039 
#>  poutcomeother     1      0.7266        0.2434      2.9851      0.0028 
#> poutcomesuccess    1      3.1614        0.2114     14.9534      0.0000 
#>    monthjun        1      0.7262        0.2107      3.4457       6e-04 
#>    monthjul        1      0.6399        0.1998      3.2024      0.0014 
#>    monthaug        1      0.8630        0.1996      4.3238      0.0000 
#>    monthoct        1      2.5665        0.3144      8.1627      0.0000 
#>    monthnov        1      0.6606        0.2256      2.9278      0.0034 
#>    monthdec        1      2.1451        0.7506      2.8578      0.0043 
#>    monthjan        1      0.3876        0.3335      1.1621      0.2452 
#>    monthfeb        1      1.3033        0.2288      5.6964      0.0000 
#>    monthmar        1      2.7631        0.3727      7.4144      0.0000 
#>    monthapr        1      0.9654        0.2273      4.2480      0.0000 
#>    monthsep        1      2.7023        0.3513      7.6917      0.0000 
#> ----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8935          Somers' D        0.7870   
#> % Discordant          0.1065          Gamma            0.7870   
#> % Tied                0.0000          Tau-a            0.1594   
#> Pairs                2070068          c                0.8935   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 4 
#> 
#> - contact 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4503           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -5.5654        0.2425    -22.9480      0.0000 
#>     duration        1      0.0042         2e-04     20.9910      0.0000 
#> poutcomefailure     1     -0.1050        0.1823     -0.5759      0.5647 
#>  poutcomeother      1      0.3955        0.2444      1.6182      0.1056 
#> poutcomesuccess     1      2.8860        0.2146     13.4492      0.0000 
#>     monthjun        1      1.3006        0.2362      5.5070      0.0000 
#>     monthjul        1     -0.1192        0.2160     -0.5521      0.5809 
#>     monthaug        1      0.1103        0.2128      0.5184      0.6042 
#>     monthoct        1      2.0192        0.3187      6.3356      0.0000 
#>     monthnov        1     -0.0239        0.2344     -0.1018      0.9189 
#>     monthdec        1      1.5531        0.7546      2.0582      0.0396 
#>     monthjan        1     -0.2942        0.3389     -0.8681      0.3853 
#>     monthfeb        1      0.6446        0.2367      2.7233      0.0065 
#>     monthmar        1      2.0912        0.3783      5.5285      0.0000 
#>     monthapr        1      0.3072        0.2340      1.3125      0.1893 
#>     monthsep        1      2.2170        0.3625      6.1152      0.0000 
#> contactcellular     1      1.8567        0.2338      7.9423      0.0000 
#> contacttelephone    1      1.5399        0.3153      4.8844      0.0000 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9016          Somers' D        0.8032   
#> % Discordant          0.0984          Gamma            0.8032   
#> % Tied                0.0000          Tau-a            0.1627   
#> Pairs                2070068          c                0.9016   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 5 
#> 
#> - housing 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4502           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -5.6760        0.2452    -23.1446      0.0000 
#>     duration        1      0.0043         2e-04     20.8730      0.0000 
#> poutcomefailure     1     -0.0518        0.1838     -0.2816      0.7783 
#>  poutcomeother      1      0.4490        0.2475      1.8144      0.0696 
#> poutcomesuccess     1      2.8664        0.2168     13.2208      0.0000 
#>     monthjun        1      0.9695        0.2463      3.9363       1e-04 
#>     monthjul        1     -0.3280        0.2211     -1.4838      0.1379 
#>     monthaug        1     -0.3194        0.2303     -1.3871      0.1654 
#>     monthoct        1      1.6413        0.3263      5.0305      0.0000 
#>     monthnov        1     -0.2138        0.2408     -0.8881      0.3745 
#>     monthdec        1      1.1017        0.7773      1.4174      0.1564 
#>     monthjan        1     -0.6787        0.3519     -1.9287      0.0538 
#>     monthfeb        1      0.3840        0.2450      1.5675      0.1170 
#>     monthmar        1      1.7452        0.3884      4.4938      0.0000 
#>     monthapr        1      0.2601        0.2353      1.1054      0.2690 
#>     monthsep        1      1.8475        0.3744      4.9345      0.0000 
#> contactcellular     1      1.8156        0.2342      7.7534      0.0000 
#> contacttelephone    1      1.4055        0.3171      4.4318      0.0000 
#>    housingno        1      0.6643        0.1331      4.9895      0.0000 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9068          Somers' D        0.8137   
#> % Discordant          0.0931          Gamma            0.8137   
#> % Tied                0.0000          Tau-a            0.1649   
#> Pairs                2070068          c                0.9069   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 6 
#> 
#> - loan 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4501           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.3293        0.3120    -20.2832      0.0000 
#>     duration        1      0.0042         2e-04     20.7811      0.0000 
#> poutcomefailure     1     -0.0535        0.1841     -0.2906      0.7714 
#>  poutcomeother      1      0.4863        0.2484      1.9577      0.0503 
#> poutcomesuccess     1      2.8391        0.2176     13.0491      0.0000 
#>     monthjun        1      0.9747        0.2469      3.9479       1e-04 
#>     monthjul        1     -0.2046        0.2232     -0.9168      0.3592 
#>     monthaug        1     -0.3488        0.2307     -1.5119      0.1306 
#>     monthoct        1      1.6098        0.3267      4.9271      0.0000 
#>     monthnov        1     -0.1809        0.2409     -0.7510      0.4526 
#>     monthdec        1      1.1086        0.7861      1.4103      0.1585 
#>     monthjan        1     -0.6682        0.3538     -1.8884      0.0590 
#>     monthfeb        1      0.4145        0.2453      1.6893      0.0912 
#>     monthmar        1      1.7041        0.3899      4.3708      0.0000 
#>     monthapr        1      0.2712        0.2357      1.1503      0.2500 
#>     monthsep        1      1.8237        0.3755      4.8568      0.0000 
#> contactcellular     1      1.8250        0.2349      7.7696      0.0000 
#> contacttelephone    1      1.3811        0.3181      4.3415      0.0000 
#>    housingno        1      0.6489        0.1334      4.8659      0.0000 
#>      loanno         1      0.7245        0.2010      3.6036       3e-04 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9078          Somers' D        0.8156   
#> % Discordant          0.0922          Gamma            0.8156   
#> % Tied                0.0000          Tau-a            0.1652   
#> Pairs                2070068          c                0.9078   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 7 
#> 
#> - campaign 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4500           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.1334        0.3178    -19.2999      0.0000 
#>     duration        1      0.0043         2e-04     20.6910      0.0000 
#> poutcomefailure     1     -0.0755        0.1836     -0.4112      0.6809 
#>  poutcomeother      1      0.4827        0.2486      1.9418      0.0522 
#> poutcomesuccess     1      2.7964        0.2178     12.8371      0.0000 
#>     monthjun        1      0.9922        0.2470      4.0167       1e-04 
#>     monthjul        1     -0.1316        0.2241     -0.5873      0.5570 
#>     monthaug        1     -0.2420        0.2332     -1.0378      0.2994 
#>     monthoct        1      1.5741        0.3278      4.8022      0.0000 
#>     monthnov        1     -0.1844        0.2402     -0.7674      0.4429 
#>     monthdec        1      1.0838        0.7741      1.4000      0.1615 
#>     monthjan        1     -0.7119        0.3547     -2.0072      0.0447 
#>     monthfeb        1      0.4247        0.2457      1.7286      0.0839 
#>     monthmar        1      1.6952        0.3912      4.3332      0.0000 
#>     monthapr        1      0.2480        0.2358      1.0518      0.2929 
#>     monthsep        1      1.8103        0.3753      4.8239      0.0000 
#> contactcellular     1      1.7993        0.2341      7.6856      0.0000 
#> contacttelephone    1      1.4005        0.3181      4.4020      0.0000 
#>    housingno        1      0.6303        0.1335      4.7206      0.0000 
#>      loanno         1      0.7440        0.2015      3.6913       2e-04 
#>     campaign        1     -0.0872        0.0305     -2.8597      0.0042 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9078          Somers' D        0.8157   
#> % Discordant          0.0922          Gamma            0.8157   
#> % Tied                0.0000          Tau-a            0.1653   
#> Pairs                2070068          c                0.9078   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 8 
#> 
#> - marital 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4498           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.2166        0.3232    -19.2362      0.0000 
#>     duration        1      0.0043         2e-04     20.6977      0.0000 
#> poutcomefailure     1     -0.0618        0.1840     -0.3358      0.7370 
#>  poutcomeother      1      0.4844        0.2484      1.9502      0.0512 
#> poutcomesuccess     1      2.7988        0.2186     12.8055      0.0000 
#>     monthjun        1      1.0072        0.2480      4.0613      0.0000 
#>     monthjul        1     -0.1173        0.2242     -0.5233      0.6008 
#>     monthaug        1     -0.1957        0.2343     -0.8353      0.4036 
#>     monthoct        1      1.5696        0.3278      4.7882      0.0000 
#>     monthnov        1     -0.1667        0.2413     -0.6909      0.4896 
#>     monthdec        1      1.1235        0.7726      1.4541      0.1459 
#>     monthjan        1     -0.6885        0.3536     -1.9472      0.0515 
#>     monthfeb        1      0.4190        0.2461      1.7027      0.0886 
#>     monthmar        1      1.6821        0.3913      4.2987      0.0000 
#>     monthapr        1      0.2403        0.2364      1.0167      0.3093 
#>     monthsep        1      1.7938        0.3768      4.7608      0.0000 
#> contactcellular     1      1.7598        0.2347      7.4973      0.0000 
#> contacttelephone    1      1.4023        0.3183      4.4051      0.0000 
#>    housingno        1      0.6240        0.1341      4.6540      0.0000 
#>      loanno         1      0.7328        0.2029      3.6122       3e-04 
#>     campaign        1     -0.0848        0.0303     -2.8016      0.0051 
#>  maritalsingle      1      0.3566        0.1256      2.8387      0.0045 
#> maritaldivorced     1     -0.1138        0.2031     -0.5603      0.5753 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9074          Somers' D        0.8148   
#> % Discordant          0.0926          Gamma            0.8148   
#> % Tied                0.0000          Tau-a            0.1651   
#> Pairs                2070068          c                0.9074   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 9 
#> 
#> - education 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4495           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -5.9983        0.3447    -17.4009      0.0000 
#>      duration         1      0.0043         2e-04     20.6767      0.0000 
#>  poutcomefailure      1     -0.0483        0.1844     -0.2619      0.7934 
#>   poutcomeother       1      0.5010        0.2493      2.0096      0.0445 
#>  poutcomesuccess      1      2.8168        0.2190     12.8614      0.0000 
#>      monthjun         1      0.9698        0.2485      3.9021       1e-04 
#>      monthjul         1     -0.1035        0.2247     -0.4606      0.6451 
#>      monthaug         1     -0.2130        0.2348     -0.9069      0.3645 
#>      monthoct         1      1.5774        0.3282      4.8063      0.0000 
#>      monthnov         1     -0.1724        0.2420     -0.7123      0.4763 
#>      monthdec         1      1.1275        0.7682      1.4677      0.1422 
#>      monthjan         1     -0.6652        0.3520     -1.8901      0.0587 
#>      monthfeb         1      0.4108        0.2475      1.6598      0.0970 
#>      monthmar         1      1.6334        0.3911      4.1765      0.0000 
#>      monthapr         1      0.2538        0.2365      1.0730      0.2833 
#>      monthsep         1      1.7658        0.3796      4.6515      0.0000 
#>  contactcellular      1      1.7250        0.2365      7.2926      0.0000 
#>  contacttelephone     1      1.3868        0.3196      4.3396      0.0000 
#>     housingno         1      0.6103        0.1339      4.5565      0.0000 
#>       loanno          1      0.7056        0.2043      3.4536       6e-04 
#>      campaign         1     -0.0858        0.0302     -2.8450      0.0044 
#>   maritalsingle       1      0.3269        0.1270      2.5736      0.0101 
#>  maritaldivorced      1     -0.1032        0.2032     -0.5081      0.6114 
#> educationsecondary    1     -0.2625        0.1312     -2.0002      0.0455 
#>  educationunknown     1      0.3202        0.2793      1.1465      0.2516 
#>  educationprimary     1     -0.3637        0.1929     -1.8851      0.0594 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9075          Somers' D        0.8151   
#> % Discordant          0.0924          Gamma            0.8151   
#> % Tied                0.0000          Tau-a            0.1651   
#> Pairs                2070068          c                0.9075   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 10 
#> 
#> - age 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Forward Selection: Step 11 
#> 
#> - job 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> No more variables to be added.
#> 
#> Variables Entered: 
#> 
#> + duration 
#> + poutcome 
#> + month 
#> + contact 
#> + housing 
#> + loan 
#> + campaign 
#> + marital 
#> + education 
#> + age 
#> + job 
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#>                    Selection Summary                     
#> --------------------------------------------------------
#>         Variable                                            
#> Step     Entered        AIC          BIC       Deviance     
#> --------------------------------------------------------
#>    1    duration     2674.3838    2687.2168    2670.3838    
#>    2    poutcome     2396.0143    2428.0968    2386.0143    
#>    3    month        2274.1092    2376.7730    2242.1092    
#>    4    contact      2207.8841    2323.3809    2171.8841    
#>    5    housing      2184.5501    2306.4634    2146.5501    
#>    6    loan         2171.9722    2300.3020    2131.9722    
#>    7    campaign     2164.1639    2298.9102    2122.1639    
#>    8    marital      2158.5237    2306.1029    2112.5237    
#>    9    education    2155.8369    2322.6656    2103.8369    
#>   10    age          2154.2718    2327.5170    2100.2718    
#>   11    job          2160.6387    2404.4652    2084.6387    
#> --------------------------------------------------------

Plot

model %>%
  blr_step_p_forward() %>%
  plot()
#> Forward Selection Method    
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> Variables Entered: 
#> 
#> - duration 
#> - poutcome 
#> - month 
#> - contact 
#> - housing 
#> - loan 
#> - campaign 
#> - marital 
#> - education 
#> - age 
#> - job 
#> 
#> No more variables to be added.
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------

Backward Elimination

Selection Summary

blr_step_p_backward(model)
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> We are eliminating variables based on p value...
#> 
#> Variables Removed: 
#> 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default 
#> 
#> No more variables satisfy the condition of p value = 0.3
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#>                   Elimination Summary                   
#> -------------------------------------------------------
#>         Variable                                           
#> Step    Removed        AIC          BIC       Deviance     
#> -------------------------------------------------------
#>    1    balance      2166.454     2435.947    2082.4539    
#>    2    pdays        2164.602     2427.678    2082.6016    
#>    3    day          2162.913     2419.573    2082.9134    
#>    4    previous     2161.552     2411.795    2083.5518    
#>    5    default      2160.639     2404.465    2084.6387    
#> -------------------------------------------------------

Detailed Output

blr_step_p_backward(model, details = TRUE)
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> We are eliminating variables based on p value...
#> 
#> - balance 
#> 
#> Backward Elimination: Step 1 
#> 
#>  Variable balance Removed 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4479           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3716        0.4726    -13.4832      0.0000 
#>        age            1      0.0076        0.0072      1.0491      0.2941 
#>   jobtechnician       1      9e-04         0.2082      0.0042      0.9967 
#>  jobentrepreneur      1     -0.3824        0.3825     -0.9998      0.3174 
#>   jobblue-collar      1     -0.0868        0.2417     -0.3589      0.7196 
#>     jobunknown        1     -0.9179        0.9546     -0.9616      0.3363 
#>     jobretired        1      0.4564        0.3117      1.4644      0.1431 
#>     jobadmin.         1      0.4093        0.2409      1.6989      0.0893 
#>    jobservices        1      0.2528        0.2684      0.9419      0.3463 
#>  jobself-employed     1     -0.0249        0.3136     -0.0794      0.9367 
#>   jobunemployed       1     -0.3872        0.3796     -1.0198      0.3078 
#>    jobhousemaid       1     -0.4960        0.4282     -1.1584      0.2467 
#>     jobstudent        1      0.0250        0.3804      0.0657      0.9476 
#>   maritalsingle       1      0.4203        0.1445      2.9091      0.0036 
#>  maritaldivorced      1     -0.1565        0.2071     -0.7556      0.4499 
#> educationsecondary    1     -0.3448        0.1715     -2.0109      0.0443 
#>  educationunknown     1      0.3062        0.3043      1.0063      0.3143 
#>  educationprimary     1     -0.4081        0.2437     -1.6746      0.0940 
#>     defaultyes        1     -0.6471        0.6846     -0.9452      0.3445 
#>     housingno         1      0.5703        0.1409      4.0488       1e-04 
#>       loanno          1      0.6978        0.2065      3.3793       7e-04 
#>  contactcellular      1      1.7317        0.2393      7.2374      0.0000 
#>  contacttelephone     1      1.3527        0.3277      4.1280      0.0000 
#>        day            1      0.0046        0.0083      0.5510      0.5817 
#>      monthjun         1      0.9839        0.2528      3.8919       1e-04 
#>      monthjul         1     -0.1276        0.2308     -0.5528      0.5804 
#>      monthaug         1     -0.2286        0.2393     -0.9554      0.3394 
#>      monthoct         1      1.4855        0.3380      4.3947      0.0000 
#>      monthnov         1     -0.2033        0.2513     -0.8090      0.4185 
#>      monthdec         1      0.9870        0.7692      1.2832      0.1994 
#>      monthjan         1     -0.7564        0.3795     -1.9929      0.0463 
#>      monthfeb         1      0.4341        0.2567      1.6910      0.0908 
#>      monthmar         1      1.4993        0.3960      3.7861       2e-04 
#>      monthapr         1      0.1874        0.2413      0.7769      0.4372 
#>      monthsep         1      1.6614        0.3925      4.2327      0.0000 
#>      duration         1      0.0044         2e-04     20.7329      0.0000 
#>      campaign         1     -0.0838        0.0308     -2.7237      0.0065 
#>       pdays           1      -4e-04        0.0010     -0.3838      0.7011 
#>      previous         1     -0.0328        0.0403     -0.8148      0.4152 
#>  poutcomefailure      1      0.1079        0.3201      0.3370      0.7361 
#>   poutcomeother       1      0.6909        0.3679      1.8782      0.0603 
#>  poutcomesuccess      1      2.9570        0.3203      9.2323      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8199   
#> % Discordant          0.0900          Gamma            0.8199   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> - pdays 
#> 
#> Backward Elimination: Step 2 
#> 
#>  Variable pdays Removed 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4480           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3725        0.4726    -13.4848      0.0000 
#>        age            1      0.0076        0.0072      1.0488      0.2943 
#>   jobtechnician       1      -2e-04        0.2081     -0.0010      0.9992 
#>  jobentrepreneur      1     -0.3814        0.3824     -0.9974      0.3186 
#>   jobblue-collar      1     -0.0898        0.2416     -0.3716      0.7102 
#>     jobunknown        1     -0.9166        0.9527     -0.9621      0.3360 
#>     jobretired        1      0.4613        0.3113      1.4817      0.1384 
#>     jobadmin.         1      0.4071        0.2409      1.6899      0.0911 
#>    jobservices        1      0.2494        0.2684      0.9289      0.3529 
#>  jobself-employed     1     -0.0293        0.3135     -0.0936      0.9255 
#>   jobunemployed       1     -0.3853        0.3794     -1.0155      0.3099 
#>    jobhousemaid       1     -0.4899        0.4276     -1.1457      0.2519 
#>     jobstudent        1      0.0319        0.3799      0.0839      0.9331 
#>   maritalsingle       1      0.4208        0.1445      2.9129      0.0036 
#>  maritaldivorced      1     -0.1576        0.2071     -0.7608      0.4467 
#> educationsecondary    1     -0.3464        0.1714     -2.0212      0.0433 
#>  educationunknown     1      0.3037        0.3042      0.9984      0.3181 
#>  educationprimary     1     -0.4109        0.2436     -1.6870      0.0916 
#>     defaultyes        1     -0.6502        0.6846     -0.9497      0.3422 
#>     housingno         1      0.5741        0.1405      4.0850      0.0000 
#>       loanno          1      0.6956        0.2064      3.3698       8e-04 
#>  contactcellular      1      1.7281        0.2392      7.2234      0.0000 
#>  contacttelephone     1      1.3482        0.3275      4.1167      0.0000 
#>        day            1      0.0047        0.0083      0.5585      0.5765 
#>      monthjun         1      0.9904        0.2525      3.9218       1e-04 
#>      monthjul         1     -0.1211        0.2302     -0.5260      0.5989 
#>      monthaug         1     -0.2202        0.2384     -0.9239      0.3555 
#>      monthoct         1      1.4926        0.3373      4.4250      0.0000 
#>      monthnov         1     -0.1883        0.2483     -0.7582      0.4483 
#>      monthdec         1      0.9844        0.7718      1.2754      0.2022 
#>      monthjan         1     -0.7475        0.3786     -1.9745      0.0483 
#>      monthfeb         1      0.4420        0.2560      1.7264      0.0843 
#>      monthmar         1      1.5032        0.3958      3.7979       1e-04 
#>      monthapr         1      0.1879        0.2412      0.7789      0.4360 
#>      monthsep         1      1.6694        0.3919      4.2599      0.0000 
#>      duration         1      0.0044         2e-04     20.7284      0.0000 
#>      campaign         1     -0.0840        0.0308     -2.7300      0.0063 
#>      previous         1     -0.0313        0.0401     -0.7808      0.4349 
#>  poutcomefailure      1      0.0160        0.2140      0.0748      0.9404 
#>   poutcomeother       1      0.6007        0.2839      2.1156      0.0344 
#>  poutcomesuccess      1      2.8839        0.2571     11.2151      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> - day 
#> 
#> Backward Elimination: Step 3 
#> 
#>  Variable day Removed 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4481           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3043        0.4562    -13.8180      0.0000 
#>        age            1      0.0075        0.0072      1.0444      0.2963 
#>   jobtechnician       1      0.0078        0.2076      0.0376      0.9700 
#>  jobentrepreneur      1     -0.3772        0.3826     -0.9859      0.3242 
#>   jobblue-collar      1     -0.0871        0.2416     -0.3604      0.7185 
#>     jobunknown        1     -0.9183        0.9530     -0.9635      0.3353 
#>     jobretired        1      0.4672        0.3110      1.5023      0.1330 
#>     jobadmin.         1      0.4062        0.2410      1.6853      0.0919 
#>    jobservices        1      0.2545        0.2683      0.9483      0.3430 
#>  jobself-employed     1     -0.0314        0.3132     -0.1002      0.9202 
#>   jobunemployed       1     -0.3800        0.3797     -1.0006      0.3170 
#>    jobhousemaid       1     -0.4949        0.4281     -1.1559      0.2477 
#>     jobstudent        1      0.0492        0.3785      0.1299      0.8967 
#>   maritalsingle       1      0.4180        0.1444      2.8947      0.0038 
#>  maritaldivorced      1     -0.1590        0.2071     -0.7676      0.4427 
#> educationsecondary    1     -0.3489        0.1714     -2.0352      0.0418 
#>  educationunknown     1      0.2950        0.3037      0.9715      0.3313 
#>  educationprimary     1     -0.4105        0.2437     -1.6849      0.0920 
#>     defaultyes        1     -0.6503        0.6850     -0.9493      0.3425 
#>     housingno         1      0.5779        0.1404      4.1170      0.0000 
#>       loanno          1      0.7028        0.2062      3.4092       7e-04 
#>  contactcellular      1      1.7106        0.2370      7.2191      0.0000 
#>  contacttelephone     1      1.3309        0.3260      4.0831      0.0000 
#>      monthjun         1      0.9687        0.2495      3.8831       1e-04 
#>      monthjul         1     -0.1014        0.2273     -0.4460      0.6556 
#>      monthaug         1     -0.2174        0.2382     -0.9126      0.3614 
#>      monthoct         1      1.5162        0.3344      4.5340      0.0000 
#>      monthnov         1     -0.1659        0.2451     -0.6769      0.4985 
#>      monthdec         1      0.9675        0.7729      1.2517      0.2107 
#>      monthjan         1     -0.6822        0.3602     -1.8940      0.0582 
#>      monthfeb         1      0.4124        0.2502      1.6486      0.0992 
#>      monthmar         1      1.5169        0.3948      3.8417       1e-04 
#>      monthapr         1      0.2077        0.2384      0.8714      0.3835 
#>      monthsep         1      1.6648        0.3916      4.2518      0.0000 
#>      duration         1      0.0044         2e-04     20.7171      0.0000 
#>      campaign         1     -0.0812        0.0303     -2.6789      0.0074 
#>      previous         1     -0.0314        0.0401     -0.7834      0.4334 
#>  poutcomefailure      1      0.0130        0.2139      0.0608      0.9515 
#>   poutcomeother       1      0.5992        0.2839      2.1108      0.0348 
#>  poutcomesuccess      1      2.8822        0.2570     11.2167      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9101          Somers' D        0.8201   
#> % Discordant          0.0899          Gamma            0.8201   
#> % Tied                0.0000          Tau-a            0.1662   
#> Pairs                2070068          c                0.9101   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> - previous 
#> 
#> Backward Elimination: Step 4 
#> 
#>  Variable previous Removed 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4482           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.2900        0.4556    -13.8046      0.0000 
#>        age            1      0.0074        0.0072      1.0330      0.3016 
#>   jobtechnician       1      0.0091        0.2076      0.0437      0.9652 
#>  jobentrepreneur      1     -0.3737        0.3828     -0.9764      0.3288 
#>   jobblue-collar      1     -0.0863        0.2417     -0.3569      0.7212 
#>     jobunknown        1     -0.9185        0.9529     -0.9639      0.3351 
#>     jobretired        1      0.4629        0.3112      1.4875      0.1369 
#>     jobadmin.         1      0.4066        0.2408      1.6884      0.0913 
#>    jobservices        1      0.2584        0.2683      0.9634      0.3354 
#>  jobself-employed     1     -0.0320        0.3129     -0.1021      0.9186 
#>   jobunemployed       1     -0.3797        0.3801     -0.9990      0.3178 
#>    jobhousemaid       1     -0.4974        0.4276     -1.1632      0.2447 
#>     jobstudent        1      0.0528        0.3784      0.1395      0.8891 
#>   maritalsingle       1      0.4165        0.1444      2.8843      0.0039 
#>  maritaldivorced      1     -0.1558        0.2069     -0.7531      0.4514 
#> educationsecondary    1     -0.3520        0.1713     -2.0548      0.0399 
#>  educationunknown     1      0.2981        0.3033      0.9828      0.3257 
#>  educationprimary     1     -0.4083        0.2437     -1.6756      0.0938 
#>     defaultyes        1     -0.6574        0.6842     -0.9608      0.3366 
#>     housingno         1      0.5782        0.1404      4.1196      0.0000 
#>       loanno          1      0.7003        0.2060      3.3989       7e-04 
#>  contactcellular      1      1.7064        0.2367      7.2081      0.0000 
#>  contacttelephone     1      1.3177        0.3258      4.0441       1e-04 
#>      monthjun         1      0.9630        0.2493      3.8633       1e-04 
#>      monthjul         1     -0.1016        0.2274     -0.4466      0.6551 
#>      monthaug         1     -0.2126        0.2381     -0.8931      0.3718 
#>      monthoct         1      1.5166        0.3345      4.5342      0.0000 
#>      monthnov         1     -0.1617        0.2451     -0.6598      0.5094 
#>      monthdec         1      0.9666        0.7723      1.2516      0.2107 
#>      monthjan         1     -0.6776        0.3595     -1.8851      0.0594 
#>      monthfeb         1      0.4048        0.2502      1.6179      0.1057 
#>      monthmar         1      1.5149        0.3950      3.8353       1e-04 
#>      monthapr         1      0.2165        0.2381      0.9091      0.3633 
#>      monthsep         1      1.6722        0.3912      4.2751      0.0000 
#>      duration         1      0.0044         2e-04     20.7105      0.0000 
#>      campaign         1     -0.0828        0.0304     -2.7264      0.0064 
#>  poutcomefailure      1     -0.0716        0.1859     -0.3853      0.7000 
#>   poutcomeother       1      0.4949        0.2523      1.9612      0.0499 
#>  poutcomesuccess      1      2.7810        0.2214     12.5604      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8201   
#> % Discordant          0.0900          Gamma            0.8201   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> - default 
#> 
#> Backward Elimination: Step 5 
#> 
#>  Variable default Removed 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> No more variables satisfy the condition of p value = 0.3
#> 
#> 
#> Variables Removed: 
#> 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default 
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------
#> 
#> 
#>                   Elimination Summary                   
#> -------------------------------------------------------
#>         Variable                                           
#> Step    Removed        AIC          BIC       Deviance     
#> -------------------------------------------------------
#>    1    balance      2166.454     2435.947    2082.4539    
#>    2    pdays        2164.602     2427.678    2082.6016    
#>    3    day          2162.913     2419.573    2082.9134    
#>    4    previous     2161.552     2411.795    2083.5518    
#>    5    default      2160.639     2404.465    2084.6387    
#> -------------------------------------------------------

Plot

model %>%
  blr_step_p_backward() %>%
  plot()
#> Backward Elimination Method 
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1 . age 
#> 2 . job 
#> 3 . marital 
#> 4 . education 
#> 5 . default 
#> 6 . balance 
#> 7 . housing 
#> 8 . loan 
#> 9 . contact 
#> 10 . day 
#> 11 . month 
#> 12 . duration 
#> 13 . campaign 
#> 14 . pdays 
#> 15 . previous 
#> 16 . poutcome 
#> 
#> We are eliminating variables based on p value...
#> 
#> Variables Removed: 
#> 
#> - balance 
#> - pdays 
#> - day 
#> - previous 
#> - default 
#> 
#> No more variables satisfy the condition of p value = 0.3
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4483           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.3088        0.4552    -13.8591      0.0000 
#>        age            1      0.0076        0.0072      1.0578      0.2901 
#>   jobtechnician       1      0.0043        0.2075      0.0205      0.9836 
#>  jobentrepreneur      1     -0.3788        0.3822     -0.9910      0.3217 
#>   jobblue-collar      1     -0.0891        0.2413     -0.3694      0.7118 
#>     jobunknown        1     -0.9253        0.9525     -0.9714      0.3314 
#>     jobretired        1      0.4578        0.3111      1.4716      0.1411 
#>     jobadmin.         1      0.4029        0.2406      1.6745      0.0940 
#>    jobservices        1      0.2532        0.2681      0.9447      0.3448 
#>  jobself-employed     1     -0.0347        0.3126     -0.1110      0.9116 
#>   jobunemployed       1     -0.3796        0.3800     -0.9991      0.3178 
#>    jobhousemaid       1     -0.5142        0.4290     -1.1985      0.2307 
#>     jobstudent        1      0.0576        0.3785      0.1522      0.8790 
#>   maritalsingle       1      0.4132        0.1443      2.8640      0.0042 
#>  maritaldivorced      1     -0.1610        0.2071     -0.7773      0.4370 
#> educationsecondary    1     -0.3523        0.1711     -2.0585      0.0395 
#>  educationunknown     1      0.2947        0.3033      0.9718      0.3312 
#>  educationprimary     1     -0.4138        0.2434     -1.7001      0.0891 
#>     housingno         1      0.5747        0.1403      4.0970      0.0000 
#>       loanno          1      0.7109        0.2056      3.4575       5e-04 
#>  contactcellular      1      1.7099        0.2369      7.2180      0.0000 
#>  contacttelephone     1      1.3259        0.3260      4.0673      0.0000 
#>      monthjun         1      0.9644        0.2495      3.8661       1e-04 
#>      monthjul         1     -0.1080        0.2272     -0.4755      0.6345 
#>      monthaug         1     -0.2155        0.2382     -0.9049      0.3655 
#>      monthoct         1      1.5213        0.3346      4.5473      0.0000 
#>      monthnov         1     -0.1685        0.2448     -0.6885      0.4911 
#>      monthdec         1      0.9700        0.7726      1.2554      0.2093 
#>      monthjan         1     -0.6734        0.3596     -1.8725      0.0611 
#>      monthfeb         1      0.4067        0.2502      1.6255      0.1040 
#>      monthmar         1      1.5203        0.3950      3.8491       1e-04 
#>      monthapr         1      0.2207        0.2381      0.9268      0.3540 
#>      monthsep         1      1.6772        0.3913      4.2866      0.0000 
#>      duration         1      0.0044         2e-04     20.7131      0.0000 
#>      campaign         1     -0.0834        0.0304     -2.7471      0.0060 
#>  poutcomefailure      1     -0.0708        0.1860     -0.3809      0.7033 
#>   poutcomeother       1      0.4931        0.2521      1.9561      0.0505 
#>  poutcomesuccess      1      2.7862        0.2214     12.5835      0.0000 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9100          Somers' D        0.8200   
#> % Discordant          0.0900          Gamma            0.8200   
#> % Tied                0.0000          Tau-a            0.1661   
#> Pairs                2070068          c                0.9100   
#> ---------------------------------------------------------------

Stepwise Selection

Selection Summary

blr_step_p_both(model)
#> Stepwise Selection Method   
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> Variables Entered/Removed: 
#> 
#> - duration added 
#> - poutcome added 
#> - month added 
#> - contact added 
#> - housing added 
#> - loan added 
#> - campaign added 
#> - marital added 
#> - education added 
#> - age added 
#> 
#> No more variables to be added/removed.
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#>                      Stepwise Selection Summary                      
#> --------------------------------------------------------------------
#>                       Added/                                               
#> Step    Variable     Removed        AIC          BIC         C(p)       
#> --------------------------------------------------------------------
#>    1    duration     addition     2674.384     2687.217    2670.3840    
#>    2    poutcome     addition     2396.014     2428.097    2386.0140    
#>    3      month      addition     2274.109     2376.773    2242.1090    
#>    4     contact     addition     2207.884     2323.381    2171.8840    
#>    5     housing     addition     2184.550     2306.463    2146.5500    
#>    6      loan       addition     2171.972     2300.302    2131.9720    
#>    7    campaign     addition     2164.164     2298.910    2122.1640    
#>    8     marital     addition     2158.524     2306.103    2112.5240    
#>    9    education    addition     2155.837     2322.666    2103.8370    
#>   10       age       addition     2154.272     2327.517    2100.2720    
#> --------------------------------------------------------------------

Detailed Output

blr_step_p_both(model, details = TRUE)
#> Stepwise Selection Method   
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> 
#> Stepwise Selection: Step 1 
#> 
#> - duration added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4519           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                    Maximum Likelihood Estimates                    
#> ------------------------------------------------------------------
#>  Parameter     DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ------------------------------------------------------------------
#> (Intercept)    1     -3.2978        0.0858    -38.4526      0.0000 
#>  duration      1      0.0037         2e-04     20.8847      0.0000 
#> ------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8181          Somers' D        0.6379   
#> % Discordant          0.1809          Gamma            0.6372   
#> % Tied                0.0010          Tau-a            0.1291   
#> Pairs                2070068          c                0.8186   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 2 
#> 
#> - poutcome added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4516           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                      
#> ----------------------------------------------------------------------
#>    Parameter       DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ----------------------------------------------------------------------
#>   (Intercept)      1     -3.7304        0.1036    -36.0223      0.0000 
#>    duration        1      0.0039         2e-04     20.8282      0.0000 
#> poutcomefailure    1      0.4597        0.1662      2.7658      0.0057 
#>  poutcomeother     1      0.9144        0.2289      3.9955       1e-04 
#> poutcomesuccess    1      3.3439        0.2027     16.4967      0.0000 
#> ----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8606          Somers' D        0.7219   
#> % Discordant          0.1390          Gamma            0.7216   
#> % Tied                5e-04           Tau-a            0.1462   
#> Pairs                2070068          c                0.8608   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 3 
#> 
#> - month added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4505           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                      
#> ----------------------------------------------------------------------
#>    Parameter       DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> ----------------------------------------------------------------------
#>   (Intercept)      1     -4.4977        0.1634    -27.5205      0.0000 
#>    duration        1      0.0041         2e-04     20.9764      0.0000 
#> poutcomefailure    1      0.2289        0.1802      1.2704      0.2039 
#>  poutcomeother     1      0.7266        0.2434      2.9851      0.0028 
#> poutcomesuccess    1      3.1614        0.2114     14.9534      0.0000 
#>    monthjun        1      0.7262        0.2107      3.4457       6e-04 
#>    monthjul        1      0.6399        0.1998      3.2024      0.0014 
#>    monthaug        1      0.8630        0.1996      4.3238      0.0000 
#>    monthoct        1      2.5665        0.3144      8.1627      0.0000 
#>    monthnov        1      0.6606        0.2256      2.9278      0.0034 
#>    monthdec        1      2.1451        0.7506      2.8578      0.0043 
#>    monthjan        1      0.3876        0.3335      1.1621      0.2452 
#>    monthfeb        1      1.3033        0.2288      5.6964      0.0000 
#>    monthmar        1      2.7631        0.3727      7.4144      0.0000 
#>    monthapr        1      0.9654        0.2273      4.2480      0.0000 
#>    monthsep        1      2.7023        0.3513      7.6917      0.0000 
#> ----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.8935          Somers' D        0.7870   
#> % Discordant          0.1065          Gamma            0.7870   
#> % Tied                0.0000          Tau-a            0.1594   
#> Pairs                2070068          c                0.8935   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 4 
#> 
#> - contact added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4503           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -5.5654        0.2425    -22.9480      0.0000 
#>     duration        1      0.0042         2e-04     20.9910      0.0000 
#> poutcomefailure     1     -0.1050        0.1823     -0.5759      0.5647 
#>  poutcomeother      1      0.3955        0.2444      1.6182      0.1056 
#> poutcomesuccess     1      2.8860        0.2146     13.4492      0.0000 
#>     monthjun        1      1.3006        0.2362      5.5070      0.0000 
#>     monthjul        1     -0.1192        0.2160     -0.5521      0.5809 
#>     monthaug        1      0.1103        0.2128      0.5184      0.6042 
#>     monthoct        1      2.0192        0.3187      6.3356      0.0000 
#>     monthnov        1     -0.0239        0.2344     -0.1018      0.9189 
#>     monthdec        1      1.5531        0.7546      2.0582      0.0396 
#>     monthjan        1     -0.2942        0.3389     -0.8681      0.3853 
#>     monthfeb        1      0.6446        0.2367      2.7233      0.0065 
#>     monthmar        1      2.0912        0.3783      5.5285      0.0000 
#>     monthapr        1      0.3072        0.2340      1.3125      0.1893 
#>     monthsep        1      2.2170        0.3625      6.1152      0.0000 
#> contactcellular     1      1.8567        0.2338      7.9423      0.0000 
#> contacttelephone    1      1.5399        0.3153      4.8844      0.0000 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9016          Somers' D        0.8032   
#> % Discordant          0.0984          Gamma            0.8032   
#> % Tied                0.0000          Tau-a            0.1627   
#> Pairs                2070068          c                0.9016   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 5 
#> 
#> - housing added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4502           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -5.6760        0.2452    -23.1446      0.0000 
#>     duration        1      0.0043         2e-04     20.8730      0.0000 
#> poutcomefailure     1     -0.0518        0.1838     -0.2816      0.7783 
#>  poutcomeother      1      0.4490        0.2475      1.8144      0.0696 
#> poutcomesuccess     1      2.8664        0.2168     13.2208      0.0000 
#>     monthjun        1      0.9695        0.2463      3.9363       1e-04 
#>     monthjul        1     -0.3280        0.2211     -1.4838      0.1379 
#>     monthaug        1     -0.3194        0.2303     -1.3871      0.1654 
#>     monthoct        1      1.6413        0.3263      5.0305      0.0000 
#>     monthnov        1     -0.2138        0.2408     -0.8881      0.3745 
#>     monthdec        1      1.1017        0.7773      1.4174      0.1564 
#>     monthjan        1     -0.6787        0.3519     -1.9287      0.0538 
#>     monthfeb        1      0.3840        0.2450      1.5675      0.1170 
#>     monthmar        1      1.7452        0.3884      4.4938      0.0000 
#>     monthapr        1      0.2601        0.2353      1.1054      0.2690 
#>     monthsep        1      1.8475        0.3744      4.9345      0.0000 
#> contactcellular     1      1.8156        0.2342      7.7534      0.0000 
#> contacttelephone    1      1.4055        0.3171      4.4318      0.0000 
#>    housingno        1      0.6643        0.1331      4.9895      0.0000 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9068          Somers' D        0.8137   
#> % Discordant          0.0931          Gamma            0.8137   
#> % Tied                0.0000          Tau-a            0.1649   
#> Pairs                2070068          c                0.9069   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 6 
#> 
#> - loan added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4501           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.3293        0.3120    -20.2832      0.0000 
#>     duration        1      0.0042         2e-04     20.7811      0.0000 
#> poutcomefailure     1     -0.0535        0.1841     -0.2906      0.7714 
#>  poutcomeother      1      0.4863        0.2484      1.9577      0.0503 
#> poutcomesuccess     1      2.8391        0.2176     13.0491      0.0000 
#>     monthjun        1      0.9747        0.2469      3.9479       1e-04 
#>     monthjul        1     -0.2046        0.2232     -0.9168      0.3592 
#>     monthaug        1     -0.3488        0.2307     -1.5119      0.1306 
#>     monthoct        1      1.6098        0.3267      4.9271      0.0000 
#>     monthnov        1     -0.1809        0.2409     -0.7510      0.4526 
#>     monthdec        1      1.1086        0.7861      1.4103      0.1585 
#>     monthjan        1     -0.6682        0.3538     -1.8884      0.0590 
#>     monthfeb        1      0.4145        0.2453      1.6893      0.0912 
#>     monthmar        1      1.7041        0.3899      4.3708      0.0000 
#>     monthapr        1      0.2712        0.2357      1.1503      0.2500 
#>     monthsep        1      1.8237        0.3755      4.8568      0.0000 
#> contactcellular     1      1.8250        0.2349      7.7696      0.0000 
#> contacttelephone    1      1.3811        0.3181      4.3415      0.0000 
#>    housingno        1      0.6489        0.1334      4.8659      0.0000 
#>      loanno         1      0.7245        0.2010      3.6036       3e-04 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9078          Somers' D        0.8156   
#> % Discordant          0.0922          Gamma            0.8156   
#> % Tied                0.0000          Tau-a            0.1652   
#> Pairs                2070068          c                0.9078   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 7 
#> 
#> - campaign added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4500           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.1334        0.3178    -19.2999      0.0000 
#>     duration        1      0.0043         2e-04     20.6910      0.0000 
#> poutcomefailure     1     -0.0755        0.1836     -0.4112      0.6809 
#>  poutcomeother      1      0.4827        0.2486      1.9418      0.0522 
#> poutcomesuccess     1      2.7964        0.2178     12.8371      0.0000 
#>     monthjun        1      0.9922        0.2470      4.0167       1e-04 
#>     monthjul        1     -0.1316        0.2241     -0.5873      0.5570 
#>     monthaug        1     -0.2420        0.2332     -1.0378      0.2994 
#>     monthoct        1      1.5741        0.3278      4.8022      0.0000 
#>     monthnov        1     -0.1844        0.2402     -0.7674      0.4429 
#>     monthdec        1      1.0838        0.7741      1.4000      0.1615 
#>     monthjan        1     -0.7119        0.3547     -2.0072      0.0447 
#>     monthfeb        1      0.4247        0.2457      1.7286      0.0839 
#>     monthmar        1      1.6952        0.3912      4.3332      0.0000 
#>     monthapr        1      0.2480        0.2358      1.0518      0.2929 
#>     monthsep        1      1.8103        0.3753      4.8239      0.0000 
#> contactcellular     1      1.7993        0.2341      7.6856      0.0000 
#> contacttelephone    1      1.4005        0.3181      4.4020      0.0000 
#>    housingno        1      0.6303        0.1335      4.7206      0.0000 
#>      loanno         1      0.7440        0.2015      3.6913       2e-04 
#>     campaign        1     -0.0872        0.0305     -2.8597      0.0042 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9078          Somers' D        0.8157   
#> % Discordant          0.0922          Gamma            0.8157   
#> % Tied                0.0000          Tau-a            0.1653   
#> Pairs                2070068          c                0.9078   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 8 
#> 
#> - marital added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4498           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                      Maximum Likelihood Estimates                       
#> -----------------------------------------------------------------------
#>    Parameter        DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -----------------------------------------------------------------------
#>   (Intercept)       1     -6.2166        0.3232    -19.2362      0.0000 
#>     duration        1      0.0043         2e-04     20.6977      0.0000 
#> poutcomefailure     1     -0.0618        0.1840     -0.3358      0.7370 
#>  poutcomeother      1      0.4844        0.2484      1.9502      0.0512 
#> poutcomesuccess     1      2.7988        0.2186     12.8055      0.0000 
#>     monthjun        1      1.0072        0.2480      4.0613      0.0000 
#>     monthjul        1     -0.1173        0.2242     -0.5233      0.6008 
#>     monthaug        1     -0.1957        0.2343     -0.8353      0.4036 
#>     monthoct        1      1.5696        0.3278      4.7882      0.0000 
#>     monthnov        1     -0.1667        0.2413     -0.6909      0.4896 
#>     monthdec        1      1.1235        0.7726      1.4541      0.1459 
#>     monthjan        1     -0.6885        0.3536     -1.9472      0.0515 
#>     monthfeb        1      0.4190        0.2461      1.7027      0.0886 
#>     monthmar        1      1.6821        0.3913      4.2987      0.0000 
#>     monthapr        1      0.2403        0.2364      1.0167      0.3093 
#>     monthsep        1      1.7938        0.3768      4.7608      0.0000 
#> contactcellular     1      1.7598        0.2347      7.4973      0.0000 
#> contacttelephone    1      1.4023        0.3183      4.4051      0.0000 
#>    housingno        1      0.6240        0.1341      4.6540      0.0000 
#>      loanno         1      0.7328        0.2029      3.6122       3e-04 
#>     campaign        1     -0.0848        0.0303     -2.8016      0.0051 
#>  maritalsingle      1      0.3566        0.1256      2.8387      0.0045 
#> maritaldivorced     1     -0.1138        0.2031     -0.5603      0.5753 
#> -----------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9074          Somers' D        0.8148   
#> % Discordant          0.0926          Gamma            0.8148   
#> % Tied                0.0000          Tau-a            0.1651   
#> Pairs                2070068          c                0.9074   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 9 
#> 
#> - education added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4495           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -5.9983        0.3447    -17.4009      0.0000 
#>      duration         1      0.0043         2e-04     20.6767      0.0000 
#>  poutcomefailure      1     -0.0483        0.1844     -0.2619      0.7934 
#>   poutcomeother       1      0.5010        0.2493      2.0096      0.0445 
#>  poutcomesuccess      1      2.8168        0.2190     12.8614      0.0000 
#>      monthjun         1      0.9698        0.2485      3.9021       1e-04 
#>      monthjul         1     -0.1035        0.2247     -0.4606      0.6451 
#>      monthaug         1     -0.2130        0.2348     -0.9069      0.3645 
#>      monthoct         1      1.5774        0.3282      4.8063      0.0000 
#>      monthnov         1     -0.1724        0.2420     -0.7123      0.4763 
#>      monthdec         1      1.1275        0.7682      1.4677      0.1422 
#>      monthjan         1     -0.6652        0.3520     -1.8901      0.0587 
#>      monthfeb         1      0.4108        0.2475      1.6598      0.0970 
#>      monthmar         1      1.6334        0.3911      4.1765      0.0000 
#>      monthapr         1      0.2538        0.2365      1.0730      0.2833 
#>      monthsep         1      1.7658        0.3796      4.6515      0.0000 
#>  contactcellular      1      1.7250        0.2365      7.2926      0.0000 
#>  contacttelephone     1      1.3868        0.3196      4.3396      0.0000 
#>     housingno         1      0.6103        0.1339      4.5565      0.0000 
#>       loanno          1      0.7056        0.2043      3.4536       6e-04 
#>      campaign         1     -0.0858        0.0302     -2.8450      0.0044 
#>   maritalsingle       1      0.3269        0.1270      2.5736      0.0101 
#>  maritaldivorced      1     -0.1032        0.2032     -0.5081      0.6114 
#> educationsecondary    1     -0.2625        0.1312     -2.0002      0.0455 
#>  educationunknown     1      0.3202        0.2793      1.1465      0.2516 
#>  educationprimary     1     -0.3637        0.1929     -1.8851      0.0594 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9075          Somers' D        0.8151   
#> % Discordant          0.0924          Gamma            0.8151   
#> % Tied                0.0000          Tau-a            0.1651   
#> Pairs                2070068          c                0.9075   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> Stepwise Selection: Step 10 
#> 
#> - age added 
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#> 
#> 
#> 
#> No more variables to be added/removed.
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------
#> 
#>                      Stepwise Selection Summary                      
#> --------------------------------------------------------------------
#>                       Added/                                               
#> Step    Variable     Removed        AIC          BIC         C(p)       
#> --------------------------------------------------------------------
#>    1    duration     addition     2674.384     2687.217    2670.3840    
#>    2    poutcome     addition     2396.014     2428.097    2386.0140    
#>    3      month      addition     2274.109     2376.773    2242.1090    
#>    4     contact     addition     2207.884     2323.381    2171.8840    
#>    5     housing     addition     2184.550     2306.463    2146.5500    
#>    6      loan       addition     2171.972     2300.302    2131.9720    
#>    7    campaign     addition     2164.164     2298.910    2122.1640    
#>    8     marital     addition     2158.524     2306.103    2112.5240    
#>    9    education    addition     2155.837     2322.666    2103.8370    
#>   10       age       addition     2154.272     2327.517    2100.2720    
#> --------------------------------------------------------------------

Plot

model %>%
  blr_step_p_both() %>%
  plot()
#> Stepwise Selection Method   
#> ---------------------------
#> 
#> Candidate Terms: 
#> 
#> 1. age 
#> 2. job 
#> 3. marital 
#> 4. education 
#> 5. default 
#> 6. balance 
#> 7. housing 
#> 8. loan 
#> 9. contact 
#> 10. day 
#> 11. month 
#> 12. duration 
#> 13. campaign 
#> 14. pdays 
#> 15. previous 
#> 16. poutcome 
#> 
#> We are selecting variables based on p value...
#> 
#> Variables Entered/Removed: 
#> 
#> - duration added 
#> - poutcome added 
#> - month added 
#> - contact added 
#> - housing added 
#> - loan added 
#> - campaign added 
#> - marital added 
#> - education added 
#> - age added 
#> 
#> No more variables to be added/removed.
#> 
#> 
#> Final Model Output 
#> ------------------
#> 
#> - Creating model overview. 
#> - Creating response profile. 
#> - Extracting maximum likelihood estimates. 
#> - Estimating concordant and discordant pairs. 
#>                              Model Overview                              
#> ------------------------------------------------------------------------
#> Data Set    Resp Var    Obs.    Df. Model    Df. Residual    Convergence 
#> ------------------------------------------------------------------------
#>   data         y        4521      4520           4494           TRUE     
#> ------------------------------------------------------------------------
#> 
#>                     Response Summary                     
#> --------------------------------------------------------
#> Outcome        Frequency        Outcome        Frequency 
#> --------------------------------------------------------
#>    0             4004              1              517    
#> --------------------------------------------------------
#> 
#>                       Maximum Likelihood Estimates                        
#> -------------------------------------------------------------------------
#>     Parameter         DF    Estimate    Std. Error    z value     Pr(>|z|) 
#> -------------------------------------------------------------------------
#>    (Intercept)        1     -6.4500        0.4220    -15.2834      0.0000 
#>      duration         1      0.0043         2e-04     20.6728      0.0000 
#>  poutcomefailure      1     -0.0607        0.1848     -0.3286      0.7424 
#>   poutcomeother       1      0.4960        0.2501      1.9829      0.0474 
#>  poutcomesuccess      1      2.8061        0.2193     12.7976      0.0000 
#>      monthjun         1      0.9457        0.2497      3.7878       2e-04 
#>      monthjul         1     -0.1077        0.2248     -0.4791      0.6319 
#>      monthaug         1     -0.2323        0.2353     -0.9871      0.3236 
#>      monthoct         1      1.5139        0.3301      4.5867      0.0000 
#>      monthnov         1     -0.2024        0.2428     -0.8336      0.4045 
#>      monthdec         1      1.1022        0.7666      1.4377      0.1505 
#>      monthjan         1     -0.6857        0.3538     -1.9383      0.0526 
#>      monthfeb         1      0.3908        0.2481      1.5750      0.1152 
#>      monthmar         1      1.5948        0.3935      4.0524       1e-04 
#>      monthapr         1      0.2393        0.2366      1.0115      0.3118 
#>      monthsep         1      1.7156        0.3810      4.5032      0.0000 
#>  contactcellular      1      1.7353        0.2371      7.3195      0.0000 
#>  contacttelephone     1      1.3093        0.3235      4.0477       1e-04 
#>     housingno         1      0.5636        0.1364      4.1307      0.0000 
#>       loanno          1      0.6997        0.2043      3.4243       6e-04 
#>      campaign         1     -0.0861        0.0302     -2.8505      0.0044 
#>   maritalsingle       1      0.4474        0.1423      3.1449      0.0017 
#>  maritaldivorced      1     -0.1397        0.2051     -0.6809      0.4959 
#> educationsecondary    1     -0.2693        0.1313     -2.0512      0.0402 
#>  educationunknown     1      0.2768        0.2802      0.9880      0.3232 
#>  educationprimary     1     -0.4408        0.1981     -2.2251      0.0261 
#>        age            1      0.0116        0.0061      1.8920      0.0585 
#> -------------------------------------------------------------------------
#> 
#>  Association of Predicted Probabilities and Observed Responses  
#> ---------------------------------------------------------------
#> % Concordant          0.9082          Somers' D        0.8164   
#> % Discordant          0.0918          Gamma            0.8164   
#> % Tied                0.0000          Tau-a            0.1654   
#> Pairs                2070068          c                0.9082   
#> ---------------------------------------------------------------