This is a fictitious datset. There are 7 variables. Questions asked on a scale of 1 to 10 on a number line measuring 10 centimeters. Respondents were asked to mark their response on this number line. The questions were asked to the bosses about their perception on their subordinates. The sample size was 100. Their responses were measured using a scale and the result was limited to one decimal point. The variables are as follows:
X1=Finishes work on time. X2=Attends all meetings. X3=Goes by the book i.e. follows all rules and regulations. X4=Good inter-personal skills. X5=Independent thinking X6=Works well with cross functional teams X7=Multi-tasker
getwd()
## [1] "/Users/sanjayfuloria"
Employee_Data<-read.csv('HR_Analytics_Factor_Analysis.csv')
Employee_Data_df = subset(Employee_Data, select = -c(ID,X8,X9,X10,X11,X12,X13,X14) )
fit <- princomp(Employee_Data_df, cor=TRUE)
summary(fit) # print variance accounted for
## Importance of components:
## Comp.1 Comp.2 Comp.3 Comp.4 Comp.5
## Standard deviation 1.5892681 1.4561544 1.0867794 0.73564181 0.64655249
## Proportion of Variance 0.3608247 0.3029122 0.1687271 0.07730984 0.05971859
## Cumulative Proportion 0.3608247 0.6637370 0.8324640 0.90977386 0.96949244
## Comp.6 Comp.7
## Standard deviation 0.45209725 0.095712906
## Proportion of Variance 0.02919885 0.001308709
## Cumulative Proportion 0.99869129 1.000000000
loadings(fit) # pc loadings
##
## Loadings:
## Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7
## X1 0.332 0.516 0.186 0.517 0.565
## X2 -0.499 0.468 -0.494 0.530
## X3 0.435 0.257 -0.159 0.647 -0.543
## X4 -0.355 0.413 -0.416 -0.138 -0.713
## X5 -0.117 0.535 0.547 -0.631
## X6 -0.310 0.415 -0.499 0.694
## X7 -0.465 -0.185 0.747 0.436
##
## Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7
## SS loadings 1.000 1.000 1.000 1.000 1.000 1.000 1.000
## Proportion Var 0.143 0.143 0.143 0.143 0.143 0.143 0.143
## Cumulative Var 0.143 0.286 0.429 0.571 0.714 0.857 1.000
plot(fit,type="lines") # scree plot
fit$scores # the principal components
## Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6
## 1 1.496021725 -0.61015790 -0.42819874 -1.24026852 0.879276567 0.02373365
## 2 -2.524329998 -0.18361881 -1.48639553 -0.36818802 -0.041875701 0.40244074
## 3 -2.739893868 0.83929186 2.05972040 -0.45588458 0.009960772 -0.19996543
## 4 -0.012885533 -1.39530589 -1.38382026 -0.13581286 0.738244679 -0.81981155
## 5 0.846951027 3.83560718 -2.25869747 -0.67119341 0.071704213 0.07029593
## 6 -1.103226163 -1.70781169 0.56106792 1.32088650 -0.232770606 -0.45443336
## 7 -0.677543644 2.56032681 -1.28402944 0.87020856 -0.156295938 0.72712666
## 8 -1.590650036 -1.46756274 0.87492352 -0.85576232 -0.963518098 -0.17109061
## 9 1.058171875 1.34321582 0.21821354 1.14595770 0.704683354 0.54908180
## 10 -1.878576866 0.91504137 0.61857658 0.11211048 0.726813600 0.10900952
## 11 0.899304503 -0.91949366 -1.15181877 -0.16834637 -0.830257275 0.32443695
## 12 0.412886534 -0.05600384 0.25537091 1.29729542 0.145062256 0.16220196
## 13 1.492356011 -2.05040777 0.25736179 0.08289072 0.011520906 -0.29673909
## 14 0.185015466 0.76083113 -1.39183677 0.09150306 0.005160295 0.57599845
## 15 0.984432530 1.36048991 -0.91380304 0.72117994 0.028650614 -1.11641575
## 16 1.929297005 -0.35068606 0.31122317 -0.08822874 -1.149527073 -0.58461658
## 17 -1.427726948 0.21331215 1.29559488 -1.35074958 -0.172675546 0.53376324
## 18 1.534264088 -0.02852921 1.46263134 -0.36471246 0.666323240 -0.41995956
## 19 0.648463525 2.26156835 -1.16987515 0.67896621 0.271698818 0.46564167
## 20 0.984432530 1.36048991 -0.91380304 0.72117994 0.028650614 -1.11641575
## 21 1.849983432 -1.46268324 -0.25884971 0.14634981 0.110090396 -0.09937520
## 22 2.968200528 -2.62596982 -0.44255909 -0.37335034 0.189447449 0.76165239
## 23 -1.828062291 1.43811721 -0.30838516 1.00686463 -1.035216214 -0.52142721
## 24 0.002622461 -1.71460960 -0.83191104 -0.48315914 0.435516225 0.11763275
## 25 2.100793179 1.16857557 0.25215347 -1.00069361 -0.136775104 0.24143448
## 26 0.751734540 1.30191636 0.11913289 -1.08770052 -0.099256604 -0.16223708
## 27 -0.028941825 -1.73325174 -0.82039317 -0.53007003 0.474890655 0.12276291
## 28 0.710197900 2.15711027 -1.29626203 0.62263102 0.242204360 0.46048297
## 29 1.821356403 -0.45609803 1.35148346 0.46529697 -1.298945517 0.19749065
## 30 -1.831037073 0.73978579 1.24274757 -0.22665112 0.870816244 0.29825960
## 31 -1.561974078 -0.29938099 0.36819086 -0.42437369 0.470213809 0.38004236
## 32 -1.623935275 1.01030961 -0.33417116 0.83365516 -0.999175771 -0.57559914
## 33 1.499722451 1.84001370 0.44666444 -0.43876276 -0.372682380 -0.64981929
## 34 -2.012136820 0.56160619 0.45906204 -0.07733428 0.356596840 0.49312210
## 35 1.860239170 -2.85194447 0.14078966 -0.26793053 0.078807061 -0.31466289
## 36 -0.727665854 -1.48630102 0.31231987 0.14527830 -0.713182192 0.25973297
## 37 -2.241332170 0.13182836 1.36604796 0.11330737 0.843632903 -0.35634480
## 38 1.078917153 -0.05057289 -1.03835899 0.68582804 0.391902297 -0.30246634
## 39 -1.397677797 -3.08541389 -1.83743464 0.22288534 -0.423416018 -0.23486388
## 40 -0.588639673 -2.06092533 -0.15354679 0.19697777 0.820871118 0.03847694
## 41 -0.829729362 -1.27239722 0.32521287 0.23188304 -0.731202414 0.28681893
## 42 0.821671178 3.79633371 -2.27287243 -0.67442092 0.032389725 0.06950448
## 43 1.727770806 0.36977585 1.67639829 0.52561280 -0.077370435 -0.78925935
## 44 2.218498275 0.88311175 0.16603066 -1.09243778 -0.122823851 0.21212314
## 45 -0.414145299 -2.48141619 0.85547892 0.22800011 0.355025701 0.12785535
## 46 1.583798588 0.58905164 1.72859046 0.61283800 -0.136926739 -0.75743749
## 47 1.757821879 0.36568914 -0.77626373 -0.47797278 -1.689827486 0.89962348
## 48 -2.094755453 -0.21904723 1.45279094 -0.05414221 0.842206233 -0.40355544
## 49 2.180001250 0.62398110 -0.11968586 0.46455318 1.406669384 0.11235877
## 50 2.223475170 0.07684765 2.45767548 -0.35334786 0.491196899 0.34316860
## 51 1.319719240 -0.14862889 -1.42570797 -0.82604684 0.103326844 -0.69093856
## 52 -1.715643747 -0.10063800 1.48579159 1.16258672 -0.887033031 0.06296168
## 53 -2.239291104 1.59540099 1.29431958 0.11976783 0.798735357 0.40660344
## 54 -1.028457991 -1.22395226 -0.09045692 0.49648583 0.788164661 0.15195095
## 55 2.559946496 -1.77035462 -0.39098708 -0.02693139 0.117366562 0.86999623
## 56 -1.442000798 0.71538971 -1.31491206 -0.02577782 -0.170039841 -0.26991573
## 57 -2.756777565 2.78609707 0.79961372 0.89595542 0.569426336 0.26236312
## 58 0.358989960 2.02942796 0.60472021 1.21726884 0.234023053 0.08228498
## 59 1.089447611 0.62347986 0.11742978 -1.33527570 -0.041850421 -0.18013233
## 60 -1.377888937 -0.72370727 1.43559472 0.94968339 -0.872346796 -0.02342637
## 61 1.766628465 0.29296852 -0.69974575 -0.52048136 -1.645658324 0.81433360
## 62 1.601785959 1.62610990 0.43377144 -0.52536750 -0.354662159 -0.67690525
## 63 0.966509221 0.18734502 -0.99768467 0.81996413 0.292971563 -0.27577465
## 64 -1.141320350 -0.27394592 1.29550982 -1.52017721 -0.090304289 0.38443538
## 65 -1.406876408 -2.30687735 -1.52387086 1.00428223 0.251569131 0.72236698
## 66 1.282821758 -0.45107985 -0.19704180 0.52923509 0.020049229 0.04039333
## 67 -0.427274237 1.77342931 -0.87448064 0.64023407 -0.285895407 0.45834879
## 68 -1.851776785 -0.94103119 0.88918353 -0.68310718 -1.006574867 -0.02097130
## 69 2.265919867 0.46907463 1.42646142 -0.43699691 0.250967069 0.31004453
## 70 -1.216840941 -0.73472242 0.61581048 1.19382770 -0.581322323 -0.32014934
## 71 -2.944020884 1.26709945 2.08550641 -0.28267511 -0.026079671 -0.14579351
## 72 2.122243337 0.47430557 2.48145526 -0.21586760 0.472390972 0.45856127
## 73 1.786156462 0.05214385 0.37430213 0.04987199 -1.209869081 -0.46448802
## 74 1.317198263 0.80978954 0.21578844 0.87904389 0.759467471 0.40668668
## 75 -1.107801067 -0.46121611 -0.97143548 -0.23753485 0.730104066 -0.82330940
## 76 0.234081107 0.46644447 0.24683811 1.50840427 0.105616353 0.14867253
## 77 1.217655732 0.06527491 -1.41281496 -0.73944210 0.085306623 -0.66385260
## 78 2.025483419 -0.88390563 1.32569746 0.29208749 -1.262905074 0.14331873
## 79 -1.273290353 -2.55750625 -1.49978797 0.92991652 0.272934871 0.75864365
## 80 1.277561531 0.10429376 0.48868319 0.43782620 0.396205049 -0.16148866
## 81 2.180329623 0.79497253 1.37701140 -0.30465608 0.228092174 0.42321182
## 82 -3.324631693 2.50558295 -0.28517609 -1.81255296 -0.354687186 -0.03234724
## 83 -2.320202983 -0.61142641 -1.51218153 -0.54139749 -0.005835258 0.34826882
## 84 -0.954600860 -0.63080465 0.64577703 0.07621277 -0.778600152 0.06742547
## 85 -0.529593126 0.07404197 -0.39976971 0.07378734 -0.946133790 -0.36077575
## 86 -0.908821250 -1.48345722 0.84671413 0.65588436 0.260855623 0.26105978
## 87 -0.452809467 -0.17913530 -0.42683767 -0.01604491 -0.967428056 -0.38865316
## 88 -0.750473845 -1.05861225 0.61999102 -0.09699671 -0.742559708 0.01325355
## 89 -0.217012549 -0.96749829 -1.35803425 0.03739662 0.702204236 -0.76563963
## 90 -0.487429034 1.98196113 -0.90088681 0.72621834 -0.262379547 0.48069885
## 91 -1.671449402 1.04855660 -1.25480726 0.10953228 -0.202674826 -0.14804246
## 92 1.636327596 -0.24243301 1.44973834 -0.45131720 0.684343462 -0.44704552
## 93 -2.891097812 1.68924122 -0.32257314 -2.15574439 -0.243291811 -0.13989964
## 94 -1.536360736 -2.02949835 -0.05584910 -0.81267922 0.695208328 0.17509245
## 95 1.683519879 -0.99332005 -0.40051062 -1.40963001 0.913095417 -0.02491093
## 96 -0.656446049 -3.61463953 -1.70972119 -0.18173530 0.099867911 -0.42272505
## 97 1.835540215 1.32666572 -0.15784189 0.81422375 1.336086639 0.27631252
## 98 -1.692336344 -1.68306130 -0.04656133 -0.63107870 0.664734996 0.28709966
## 99 -1.368772218 -0.09132412 -0.94830657 -0.11446377 0.694123564 -0.76479876
## 100 0.669897638 -0.53095954 -1.14020772 0.00163559 -0.905612206 0.37781743
## Comp.7
## 1 -1.044432e-01
## 2 -1.092350e-01
## 3 3.914201e-02
## 4 -9.104105e-03
## 5 7.347404e-02
## 6 -2.941596e-02
## 7 8.533110e-03
## 8 -4.747858e-02
## 9 1.193880e-02
## 10 4.294471e-02
## 11 -4.497565e-02
## 12 9.714492e-03
## 13 -6.362459e-02
## 14 -1.178084e-01
## 15 1.594843e-02
## 16 -3.024796e-03
## 17 4.264147e-02
## 18 -6.697974e-02
## 19 3.473081e-02
## 20 1.594843e-02
## 21 -6.566185e-02
## 22 4.848351e-01
## 23 4.982313e-02
## 24 -2.692445e-02
## 25 -5.521089e-02
## 26 -3.373726e-02
## 27 -2.771047e-02
## 28 3.212768e-02
## 29 2.910456e-02
## 30 -5.705636e-03
## 31 -2.823199e-02
## 32 4.076216e-02
## 33 -5.462523e-02
## 34 3.447624e-02
## 35 -8.292609e-02
## 36 9.108844e-03
## 37 8.809838e-02
## 38 3.110455e-03
## 39 -1.134139e-01
## 40 1.141288e-02
## 41 1.363933e-02
## 42 3.044232e-02
## 43 4.871841e-03
## 44 2.464619e-02
## 45 -1.563603e-01
## 46 5.398861e-02
## 47 -1.060226e-01
## 48 3.923613e-02
## 49 -5.787103e-02
## 50 -7.785525e-02
## 51 5.920953e-02
## 52 1.010384e-01
## 53 1.241630e-02
## 54 2.874880e-02
## 55 5.029571e-01
## 56 -3.799677e-02
## 57 8.489862e-02
## 58 -3.224237e-02
## 59 -4.964959e-02
## 60 8.823296e-02
## 61 -1.056291e-01
## 62 -5.915571e-02
## 63 5.301325e-02
## 64 -9.826233e-03
## 65 -1.344549e-01
## 66 -8.682716e-02
## 67 4.708529e-02
## 68 4.802084e-02
## 69 -2.928167e-02
## 70 -5.020946e-03
## 71 4.820298e-02
## 72 -1.150741e-01
## 73 4.342598e-03
## 74 -8.371933e-02
## 75 6.461717e-02
## 76 6.491408e-02
## 77 6.374002e-02
## 78 2.004359e-02
## 79 -1.413063e-01
## 80 -7.301673e-02
## 81 1.788700e-02
## 82 6.614080e-02
## 83 -1.182960e-01
## 84 -6.859736e-03
## 85 9.414743e-03
## 86 -4.932033e-02
## 87 -3.814746e-02
## 88 -1.592071e-02
## 89 -4.313523e-05
## 90 7.029492e-03
## 91 -7.507442e-02
## 92 -7.151022e-02
## 93 9.105058e-02
## 94 2.247515e-02
## 95 -2.588616e-02
## 96 2.552159e-01
## 97 -4.530042e-02
## 98 -5.840276e-02
## 99 2.986040e-02
## 100 -7.894640e-02
biplot(fit)
# Varimax Rotated Principal Components
# retaining 5 components
library(psych)
fit <- principal(Employee_Data_df, nfactors=3, rotate="varimax")
fit # print results
## Principal Components Analysis
## Call: principal(r = Employee_Data_df, nfactors = 3, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
## RC1 RC3 RC2 h2 u2 com
## X1 -0.75 0.07 0.56 0.88 0.1155 1.9
## X2 0.75 0.11 0.56 0.89 0.1053 1.9
## X3 -0.81 0.01 0.01 0.65 0.3510 1.0
## X4 0.12 0.92 0.15 0.89 0.1149 1.1
## X5 -0.06 0.18 0.98 1.00 0.0049 1.1
## X6 0.03 0.95 0.08 0.90 0.0995 1.0
## X7 0.76 0.19 -0.07 0.62 0.3817 1.1
##
## RC1 RC3 RC2
## SS loadings 2.38 1.83 1.62
## Proportion Var 0.34 0.26 0.23
## Cumulative Var 0.34 0.60 0.83
## Proportion Explained 0.41 0.31 0.28
## Cumulative Proportion 0.41 0.72 1.00
##
## Mean item complexity = 1.3
## Test of the hypothesis that 3 components are sufficient.
##
## The root mean square of the residuals (RMSR) is 0.07
## with the empirical chi square 19.3 with prob < 0.00024
##
## Fit based upon off diagonal values = 0.97
##Factors obtained We could divide these 7 variables into 3 factors. Variables X1,X2,X3,and X7 load highly on 1 component. This factor can be named as ‘Commitment’ Variables X4 and X6 load highly on the 2nd component. This factor can be named as ‘Soft Skills’ Variable X5 can be used as an independent factor for further analysis. This can be called ‘Independent Nature’