转载自:http://blog.csdn.net/liuxincumt/article/details/8110127
主要是为了理解因子得分,跟factanal计算出来的比较。
data(USArrests)
fa <- factanal(~., factors = 1, data = USArrests, score = "Bartlett", rotation = "none") #不做旋转
D <- diag(fa$uniquenesses) #特殊方差
A <- as.matrix(fa$loadings[,1]) #载荷矩阵
D1 <- solve(D) #D的逆矩阵
x <- t(as.matrix(USArrests))
#Bartlett方法(最小二乘法)
因子得分为f <- solve(t(A) %*% D1 %*% A) %*% t(A) %*% D1 %*% x
然后标准化就是fa$scores了
fa <- factanal(~., factors = 1, data = USArrests, score = "regression", rotation = "none")
r <- fa$correlation #x的相关矩阵
Thompson方法(回归方法)
f <- t(A) %*% solve(r) %*% x