R语言实现因子分析

x<- c(1.000, 0.846, 0.805, 0.859, 0.473, 0.398, 0.301, 0.382,     
      0.846, 1.000, 0.881, 0.826, 0.376, 0.326, 0.277, 0.277,  
      0.805, 0.881, 1.000, 0.801, 0.380, 0.319, 0.237, 0.345,
      0.859, 0.826, 0.801, 1.000, 0.436, 0.329, 0.327, 0.365,       
      0.473, 0.376, 0.380, 0.436, 1.000, 0.762, 0.730, 0.629,    
      0.398, 0.326, 0.319, 0.329, 0.762, 1.000, 0.583, 0.577,    
      0.301, 0.277, 0.237, 0.327, 0.730, 0.583, 1.000, 0.539,    
      0.382, 0.415, 0.345, 0.365, 0.629, 0.577, 0.539, 1.000) 
names<-c("身高 x1", "手臂长 x2", "上肢长 x3", "下肢长 x4", "体重 x5",  "颈围 x6", "胸围 x7", "胸宽 x8") 
r<-matrix(x, nrow=8, dimnames=list(names, names))####构成相关矩阵 
facotrs<-factanal(covmat=r,factors=2,n.obs=64,rotation = "varimax")
facotrs

结果如下

Call:
factanal(factors = 2, covmat = r, n.obs = 64, rotation = "varimax")

Uniquenesses:
  身高 x1 手臂长 x2 上肢长 x3 下肢长 x4   体重 x5   颈围 x6   胸围 x7   胸宽 x8 
    0.166     0.110     0.166     0.196     0.099     0.360     0.414     0.538 

Loadings:
          Factor1 Factor2
身高 x1   0.869   0.282  
手臂长 x2 0.929   0.164  
上肢长 x3 0.896   0.174  
下肢长 x4 0.862   0.247  
体重 x5   0.244   0.917  
颈围 x6   0.201   0.774  
胸围 x7   0.141   0.752  
胸宽 x8   0.222   0.643  

               Factor1 Factor2
SS loadings      3.333   2.618
Proportion Var   0.417   0.327
Cumulative Var   0.417   0.744

Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 14.51 on 13 degrees of freedom.
The p-value is 0.339 


你可能感兴趣的:(R语言实现因子分析)