本文介绍了带有stargazer的出口回归表:$运算符对原子向量无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用观星仪导出回归表.回归输出来自glm,看起来像:

I am trying to export a regression table using stargazer. The regression output comes from glm and looks like:

Call:
glm(formula = formula, family = binomial(logit), data = data)

Deviance Residuals: 
Min       1Q   Median       3Q      Max  
-1.2913  -0.11888  -0.3239  -0.3216   2.6627  

Coefficients:
                        Estimate Std. Error z value Pr(>|z|)    
(Intercept)               -3.4839244  0.2439274 -14.283  < 2e-16 ***
data$var              0.00144  0.003666   0.021  0.2724    

不幸的是,我无法控制该回归的变量名.当我尝试运行stargazer在tex中导出表时,出现错误

unfortunately I have no control over the variable names of that regression. When I try to run stargazer to export the table in tex I get the error

我该怎么办?我试图用stargazer更改变量的标签,但这不起作用.

What should I do? I tried to change the labels of the variables with stargazer but this does not work.

stargazer(glm_output,
      title            = "results",
      covariate.labels = c("newname"),
      dep.var.caption  = "caption",
      dep.var.labels   = "dep",
      rownames = FALSE)

非常感谢!

推荐答案

最佳解决方案是

  • 用扫帚整理数据
  • 在清理后的数据帧上使用stargazer

谢谢!

这篇关于带有stargazer的出口回归表:$运算符对原子向量无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 17:36