Bank Data Project

Summary

summary(bank)
##       age          age.group     eligible           job           salary      
##  Min.   :18.00   Min.   :1.000   N: 1831   blue-collar:9732   Min.   :     0  
##  1st Qu.:33.00   1st Qu.:3.000   Y:43380   management :9458   1st Qu.: 20000  
##  Median :39.00   Median :3.000             technician :7597   Median : 60000  
##  Mean   :40.94   Mean   :3.646             admin.     :5171   Mean   : 57006  
##  3rd Qu.:48.00   3rd Qu.:4.000             services   :4154   3rd Qu.: 70000  
##  Max.   :95.00   Max.   :9.000             retired    :2264   Max.   :120000  
##                                            (Other)    :6835                   
##      marital          education              marital.education targeted   
##  divorced: 5207   primary  : 6851   married-secondary :13770   no : 8120  
##  married :27214   secondary:23202   married-tertiary  : 7038   yes:37091  
##  single  :12790   tertiary :13301   single-secondary  : 6617              
##                   unknown  : 1857   married-primary   : 5246              
##                                     single-tertiary   : 4792              
##                                     divorced-secondary: 2815              
##                                     (Other)           : 4933              
##  default        balance       housing      loan            contact     
##  no :44396   Min.   : -8019   no :20081   no :37967   cellular :29285  
##  yes:  815   1st Qu.:    72   yes:25130   yes: 7244   telephone: 2906  
##              Median :   448                           unknown  :13020  
##              Mean   :  1362                                            
##              3rd Qu.:  1428                                            
##              Max.   :102127                                            
##                                                                        
##       day            month          duration         campaign     
##  Min.   : 1.00   may    :13766   Min.   :   0.0   Min.   : 1.000  
##  1st Qu.: 8.00   jul    : 6895   1st Qu.: 103.0   1st Qu.: 1.000  
##  Median :16.00   aug    : 6247   Median : 180.0   Median : 2.000  
##  Mean   :15.81   jun    : 5341   Mean   : 258.2   Mean   : 2.764  
##  3rd Qu.:21.00   nov    : 3970   3rd Qu.: 319.0   3rd Qu.: 3.000  
##  Max.   :31.00   apr    : 2932   Max.   :4918.0   Max.   :63.000  
##                  (Other): 6060                                    
##      pdays          previous           poutcome       y            response    
##  Min.   : -1.0   Min.   :  0.0000   failure: 4901   no :39922   Min.   :0.000  
##  1st Qu.: -1.0   1st Qu.:  0.0000   other  : 1840   yes: 5289   1st Qu.:0.000  
##  Median : -1.0   Median :  0.0000   success: 1511               Median :0.000  
##  Mean   : 40.2   Mean   :  0.5803   unknown:36959               Mean   :0.117  
##  3rd Qu.: -1.0   3rd Qu.:  0.0000                               3rd Qu.:0.000  
##  Max.   :871.0   Max.   :275.0000                               Max.   :1.000  
## 

Structure

str(bank)
## 'data.frame':    45211 obs. of  23 variables:
##  $ age              : int  58 44 33 47 33 35 28 42 58 43 ...
##  $ age.group        : int  5 4 3 4 3 3 2 4 5 4 ...
##  $ eligible         : Factor w/ 2 levels "N","Y": 2 2 2 2 2 2 2 2 2 2 ...
##  $ job              : Factor w/ 12 levels "admin.","blue-collar",..: 5 10 3 2 12 5 5 3 6 10 ...
##  $ salary           : int  100000 60000 120000 20000 0 100000 100000 120000 55000 60000 ...
##  $ marital          : Factor w/ 3 levels "divorced","married",..: 2 3 2 2 3 2 3 1 2 3 ...
##  $ education        : Factor w/ 4 levels "primary","secondary",..: 3 2 2 4 4 3 3 3 1 2 ...
##  $ marital.education: Factor w/ 12 levels "divorced-primary",..: 7 10 6 8 12 7 11 3 5 10 ...
##  $ targeted         : Factor w/ 2 levels "no","yes": 2 2 2 1 1 2 1 1 2 2 ...
##  $ default          : Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 2 1 1 ...
##  $ balance          : int  2143 29 2 1506 1 231 447 2 121 593 ...
##  $ housing          : Factor w/ 2 levels "no","yes": 2 2 2 2 1 2 2 2 2 2 ...
##  $ loan             : Factor w/ 2 levels "no","yes": 1 1 2 1 1 1 2 1 1 1 ...
##  $ contact          : Factor w/ 3 levels "cellular","telephone",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ day              : int  5 5 5 5 5 5 5 5 5 5 ...
##  $ month            : Factor w/ 12 levels "apr","aug","dec",..: 9 9 9 9 9 9 9 9 9 9 ...
##  $ duration         : int  261 151 76 92 198 139 217 380 50 55 ...
##  $ campaign         : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ pdays            : int  -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
##  $ previous         : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ poutcome         : Factor w/ 4 levels "failure","other",..: 4 4 4 4 4 4 4 4 4 4 ...
##  $ y                : Factor w/ 2 levels "no","yes": 1 1 1 1 1 1 1 1 1 1 ...
##  $ response         : int  0 0 0 0 0 0 0 0 0 0 ...

Marital-Salary Plot

plot(bank$marital, bank$salary)

##Marital Plot

plot(bank$marital)

Job-Salary Plot

plot(bank$job, bank$salary)

Salary-Balance Plot

ggplot(bank, aes(x=salary, y= balance, col= as.factor(education)))+ geom_point()

Job Plot