将字符向量传递给 to 的dep.var.labels参数时stargazer,我希望因变量标签由该向量组成。但这似乎只有在模型是不同类型时才会发生。
data(mtcars)
m0 <- lm(mpg ~ hp, data=mtcars)
m1 <- lm(mpg ~ wt, data=mtcars)
m2 <- glm(cyl ~ disp, data=mtcars)
## Only shows the label 'foo' for both models.
stargazer(m0, m1, dep.var.labels=c('foo','bar'))
## shows 'foo' and 'bar' as labels.
stargazer(m0, m2, dep.var.labels=c('foo','bar'))
Run Code Online (Sandbox Code Playgroud)
即使模型类型相同,如何让观星者显示不同的因变量标签?
小智 6
stargazer使用相同的因变量是因为您的因变量相同,而不是因为您使用相同类型的统计模型。您可能对使用该column.labels参数感兴趣:
data(mtcars)
m0 <- lm(mpg ~ hp, data=mtcars)
m1 <- lm(mpg ~ wt, data=mtcars)
m2 <- glm(cyl ~ disp, data=mtcars)
## Only shows the label 'foo' for both models.
stargazer(m0, m1, column.labels=c('foo','bar'), type="text")
## shows 'foo' and 'bar' as labels.
stargazer(m0, m2, column.labels=c('foo','bar'), type="text")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6961 次 |
| 最近记录: |