补充内容:R自带函数,测试数据,因子评分
数据文件(点击无效则复制下面URL到迅雷下载)
https://files.cnblogs.com/files/panpansky/%E4%B8%BB%E5%9B%A0%E5%AD%90%E5%88%86%E6%9E%90%E8%A1%A5%E5%85%85%E6%95%B0%E6%8D%AE.rar
测试事例:
rt<-read.table("applicant.data")//绝对路径 factanal(~., factors=5, data=rt)
/*factanal(x, factors, data = NULL, covmat = NULL, n.obs = NA, subset, na.action, start = NULL, scores = c("none", "regression", "Bartlett"), rotation = "varimax", control = NULL, ...)*/参数说明
分析结果:
直接上代码:
rt<-read.table("applicant.data") //scores="regression"为回归法分析,scores="Bartlett"为最小二乘法分析 fa<-factanal(~., factors=5, data=rt, scores="regression")
//画出两个因子的联系图
plot(fa$scores[, 1:2], type="n")
text(fa$scores[,1], fa$scores[,2])
PS:本文涉及资料均来自薛毅书《统计建模与R语言》P543~546