Cluster Analysis

Srishti Puri

4/15/2021

Question: Using the given data set, develop a cluster analysis. Remember to keep out the left variable from the cluster analysis, and to convert salary to a numerical variable.

Exploring Data

##  satisfaction_level last_evaluation  number_project  average_montly_hours
##  Min.   :0.0900     Min.   :0.3600   Min.   :2.000   Min.   : 96.0       
##  1st Qu.:0.4400     1st Qu.:0.5600   1st Qu.:3.000   1st Qu.:156.0       
##  Median :0.6400     Median :0.7200   Median :4.000   Median :200.0       
##  Mean   :0.6128     Mean   :0.7161   Mean   :3.803   Mean   :201.1       
##  3rd Qu.:0.8200     3rd Qu.:0.8700   3rd Qu.:5.000   3rd Qu.:245.0       
##  Max.   :1.0000     Max.   :1.0000   Max.   :7.000   Max.   :310.0       
##  time_spend_company Work_accident         left        promotion_last_5years
##  Min.   : 2.000     Min.   :0.0000   Min.   :0.0000   Min.   :0.00000      
##  1st Qu.: 3.000     1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.00000      
##  Median : 3.000     Median :0.0000   Median :0.0000   Median :0.00000      
##  Mean   : 3.498     Mean   :0.1446   Mean   :0.2381   Mean   :0.02127      
##  3rd Qu.: 4.000     3rd Qu.:0.0000   3rd Qu.:0.0000   3rd Qu.:0.00000      
##  Max.   :10.000     Max.   :1.0000   Max.   :1.0000   Max.   :1.00000      
##     sales              salary         
##  Length:14999       Length:14999      
##  Class :character   Class :character  
##  Mode  :character   Mode  :character  
##                                       
##                                       
## 

Analyzing continous variables:

Analyzing categorical variables:

Profile

Characterizing loyal employees:

Pre process data and selecting similarity measure.

Creating New Data Set for Cluster Analysis

## tibble [14,999 × 8] (S3: tbl_df/tbl/data.frame)
##  $ satisfaction_level   : num [1:14999] 0.38 0.8 0.11 0.72 0.37 0.41 0.1 0.92 0.89 0.42 ...
##  $ last_evaluation      : num [1:14999] 0.53 0.86 0.88 0.87 0.52 0.5 0.77 0.85 1 0.53 ...
##  $ number_project       : num [1:14999] 2 5 7 5 2 2 6 5 5 2 ...
##  $ average_montly_hours : num [1:14999] 157 262 272 223 159 153 247 259 224 142 ...
##  $ time_spend_company   : num [1:14999] 3 6 4 5 3 3 4 5 5 3 ...
##  $ Work_accident        : num [1:14999] 0 0 0 0 0 0 0 0 0 0 ...
##  $ promotion_last_5years: num [1:14999] 0 0 0 0 0 0 0 0 0 0 ...
##  $ salary_num           : num [1:14999] 10 20 20 10 10 10 10 10 10 10 ...

Creating Clusters using K-means clustering

Profiling and Plotting:

cluster left n salary_num satisfaction_level last_evaluation number_project average_montly_hours time_spend_company Work_accident promotion_last_5years
1 0.4540094 848 21.47406 0.1907193 0.7869458 5.547170 241.8939 4.386793 0.0353774 0.0117925
2 0.0841321 939 15.77210 0.5868584 0.5753142 3.512247 173.5857 3.441959 1.0000000 0.0212993
3 0.5172414 1624 15.97291 0.7596921 0.8370628 4.240148 225.7642 6.288793 0.0455665 0.0369458
4 0.5773116 2574 14.61150 0.4358003 0.5298368 2.418803 148.3745 3.149184 0.0000000 0.0139860
5 0.0174752 3834 21.91967 0.7351878 0.7329734 3.764215 203.9484 2.852895 0.0000000 0.0315597
6 0.0468320 1089 16.22590 0.7253260 0.8222130 3.887052 217.9128 3.109275 1.0000000 0.0477502
7 0.0292016 3219 10.00000 0.7394284 0.7419882 3.802112 204.2022 2.870146 0.0000000 0.0052811
8 0.6525229 872 10.00000 0.1545872 0.8211009 5.761468 254.9335 4.169725 0.0424312 0.0034404

Analysis

Cluster 8 has the maximum observations which left.

Cluster 5 has the highest number of observations.

Cluster 5 is paid the highest salary.

Cluster 8 does a maximum number of projects.

Cluster 8 spends the maximum number of hours on an average on a monthly basis.

Clusters 2 and 6 suffer the most accidents at work.

Cluster 3 has the highest level of satisfaction.

Cluster 3 spends most time with the company.

Cluster 6 has experienced highest number of promotions in the last five years.

Cluster 3 has received the highest number of last evaluations.