Factor analysis

Load and look at the data.

oxygen = read.table('oxygen.txt')
head(oxygen)
##     V1   V2   V3    V4   V5
## 1 0.34 3.71 2.87 30.87 male
## 2 0.39 5.08 3.38 43.85 male
## 3 0.48 5.13 4.13 44.51 male
## 4 0.31 3.95 3.60 46.00 male
## 5 0.36 5.51 3.11 47.02 male
## 6 0.33 4.07 3.95 48.50 male

Do PCA and look at the summary.

oxygen.pca = princomp(oxygen[,1:4])
oxygen.pca
## Call:
## princomp(x = oxygen[, 1:4])
## 
## Standard deviations:
##     Comp.1     Comp.2     Comp.3     Comp.4 
## 8.36892720 1.34142523 0.47239772 0.01094482 
## 
##  4  variables and  50 observations.

We look at the scree-plot.

plot(oxygen.pca)

Number of factors is 1. Here is the FA output.

oxygen.fa = factanal(oxygen[,1:4], factors = 1, rotation = "varimax")
oxygen.fa
## 
## Call:
## factanal(x = oxygen[, 1:4], factors = 1, rotation = "varimax")
## 
## Uniquenesses:
##    V1    V2    V3    V4 
## 0.005 0.340 0.716 0.846 
## 
## Loadings:
##    Factor1
## V1 0.998  
## V2 0.813  
## V3 0.532  
## V4 0.392  
## 
##                Factor1
## SS loadings      2.093
## Proportion Var   0.523
## 
## Test of the hypothesis that 1 factor is sufficient.
## The chi square statistic is 188.57 on 2 degrees of freedom.
## The p-value is 1.13e-41

Uniqueness increases from V1 to V4. Factor loadings decrease from V1 to V4. So V1 is determined heavily by the factor (in positive direction) and V4 is very unique. Factor 1 explains 52% of the variation. But we reject the Null that one factor is sufficient (but 2 dof?)

We can get scores of individuals wrt this factor.

oxygen.fa.s = factanal(oxygen[,1:4], factors = 1, rotation = "varimax", scores = "regression")
oxygen.fa.s$scores
##           Factor1
##  [1,] -0.16861463
##  [2,]  0.34031981
##  [3,]  1.22897358
##  [4,] -0.45436068
##  [5,]  0.04873883
##  [6,] -0.25454600
##  [7,]  0.73654554
##  [8,]  1.24077974
##  [9,] -1.44210612
## [10,] -0.35203116
## [11,]  1.84125615
## [12,] -0.34478601
## [13,]  0.44506952
## [14,] -0.44295223
## [15,]  0.85153589
## [16,] -0.34894191
## [17,]  1.43253348
## [18,]  0.05405188
## [19,]  1.24684755
## [20,]  0.44577057
## [21,]  0.64847876
## [22,]  1.93599515
## [23,]  1.43733102
## [24,] -0.15380983
## [25,]  0.42894592
## [26,] -0.65204981
## [27,] -0.75667243
## [28,] -0.45447751
## [29,] -0.54484990
## [30,] -0.75152243
## [31,] -2.44611545
## [32,] -1.04631580
## [33,] -0.94310923
## [34,]  0.35423683
## [35,]  0.14231426
## [36,] -0.45799128
## [37,] -0.06164039
## [38,] -0.65337994
## [39,] -0.24437277
## [40,] -1.74965409
## [41,] -0.75560704
## [42,]  0.84486744
## [43,] -1.34342263
## [44,] -0.15063505
## [45,] -0.54764255
## [46,] -0.45847212
## [47,] -0.84572845
## [48,]  3.04012225
## [49,]  0.13872777
## [50,] -0.05763451

End