【问题标题】:How to use Stargazer R package with factor analysis output如何使用带有因子分析输出的 Stargazer R 包
【发布时间】:2021-06-12 16:45:27
【问题描述】:

我过去曾在回归表中使用过 stargazer。

但是,我想知道如何将 stargazer 与因子分析和主成分分析的输出一起使用。

我的代码运行如下:

fa1 <- factanal(new2, factors = 4, rotation = "varimax", sort = TRUE)
print(fa1, digits = 3, cutoff = .5, sort = TRUE)
load <- fa1$loadings[,1:2] 
plot(load,type="n")
text(load,labels=names(new2),cex=.7) 

two <- pca(new2, nfactors = 3)

这不起作用 - 我目前唯一的尝试。

stargazer(fa1, type = "text", title="Descriptive statistics", digits=1, out="table1.txt")

更新:自发布以来,我已经能够将对象转换为数据框:

已转换

然后我成功地使用了上面的代码,除了输出似乎不包括单个因素得分。

见下文:

loadings

【问题讨论】:

    标签: r stargazer


    【解决方案1】:

    这可能不是一个完美的解决方案,您现在可能已经发现,但您可以做的是通过添加summary = FALSE 作为选项,使用 stagazer 单独输出因子分数。这样,您只能获得因子载荷作为输出。 比如这样:

    stargazer(fa1, summary = FALSE, title="Descriptive statistics", digits=1, out="table1.txt")
    

    【讨论】:

      猜你喜欢
      • 2020-10-18
      • 2013-03-23
      • 1970-01-01
      • 2010-12-21
      • 2019-04-13
      • 2020-09-24
      • 2013-08-10
      • 1970-01-01
      • 2015-09-05
      相关资源
      最近更新 更多