[英]How to get the RMSEA value after a Factor analysis (psych:fa) with R?
[英]Eliminating arrows from a factor analysis Biplot {psych} in R
在biplot
由以下代碼制作我試圖擺脫紅線。 如果有人可以幫助,我將不勝感激。
library(psych)
data(bfi)
fa2 <- fa(bfi[16:25],2) #factor analysis
fa2$scores <- fa2$scores[1:100,] #just take the first 100
biplot(fa2,pch=c(24,21)[bfi[1:100,"gender"]],bg=c("blue","red")[bfi[1:100,"gender"]],
main="Biplot of Conscientiousness and Neuroticism by gender")
無論出於何種原因, psych
圖書館都決定重寫自己的Biplot,因此它忽略了許多標准參數。 您可以創建自己的版本,只需刪除箭頭圖即可。 該方法有些hacky,但已使用psych_1.4.5
進行了psych_1.4.5
。 只要驗證一下
body(biplot.psych)[[c(11,3,12)]]
回報
arrows(0, 0, x$loadings[, 1L] * 0.8, x$loadings[, 2L] * 0.8,
col = col[2L], length = arrow.len)
確保我們更改了正確的行。 那你可以做
biplot.psych2<-biplot.psych
body(biplot.psych2)[[11]][[3]][[12]]<-NULL
然后使用
biplot.psych2(fa2,pch=c(24,21)[bfi[1:100,"gender"]],
bg=c("blue","red")[bfi[1:100,"gender"]],
main="Biplot of Conscientiousness and Neuroticism by gender")
要得到
發布問題數月后,這里有一個快速解答。 您實際要求的不是biplot(包括因子得分以及因子負載),而只是因子得分的圖。 用你的例子,
情節(FA2 $分數,BG = C( “藍”, “紅”)[BFI [1:100, “性別”]],PCH = C(24,21)[BFI [1:100, “性別”] ],ylim = C(-3,3),XLIM = C(-3,3))。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.