setwd("~/Documents/Dropbox/Research/Bernd")
abot<-read.csv ("abot_database_robot_list_final.csv", header=T, sep=",")

abot<-subset(abot, select=c(3:21))

library(psych)
## Warning: package 'psych' was built under R version 3.2.5
fit <- principal(abot, nfactors=2, rotate="varimax") #get factor loadings
fit 
## Principal Components Analysis
## Call: principal(r = abot, nfactors = 2, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##                 RC1   RC2    h2   u2 com
## Apparel        0.64  0.23 0.466 0.53 1.3
## Arms           0.04  0.93 0.862 0.14 1.0
## Eyebrows       0.77 -0.14 0.606 0.39 1.1
## Eyelashes      0.84 -0.07 0.718 0.28 1.0
## Eye.s.         0.51  0.09 0.269 0.73 1.1
## Face           0.64  0.23 0.458 0.54 1.3
## Finger.s.      0.09  0.88 0.788 0.21 1.0
## Gender         0.79  0.25 0.687 0.31 1.2
## Gripper       -0.14  0.87 0.785 0.22 1.1
## Hand.s.        0.10  0.94 0.891 0.11 1.0
## Head           0.44  0.55 0.489 0.51 1.9
## Head.hair      0.78  0.01 0.605 0.39 1.0
## Leg.s.        -0.05  0.69 0.472 0.53 1.0
## Mouth          0.69 -0.02 0.470 0.53 1.0
## Nose           0.77  0.07 0.593 0.41 1.0
## Skin           0.74 -0.01 0.544 0.46 1.0
## Torso          0.11  0.90 0.821 0.18 1.0
## Treads.tracks -0.33  0.13 0.129 0.87 1.3
## Wheels        -0.28 -0.04 0.077 0.92 1.0
## 
##                        RC1  RC2
## SS loadings           5.64 5.08
## Proportion Var        0.30 0.27
## Cumulative Var        0.30 0.56
## Proportion Explained  0.53 0.47
## Cumulative Proportion 0.53 1.00
## 
## Mean item complexity =  1.1
## Test of the hypothesis that 2 components are sufficient.
## 
## The root mean square of the residuals (RMSR) is  0.11 
##  with the empirical chi square  840.92  with prob <  7.9e-103 
## 
## Fit based upon off diagonal values = 0.91