6

使用时stargazer有一个参数,omit.stat但是我需要从我的系数值下方删除测试统计数据,并且它不是stargazer 包文档 (PDF) (pp. 14–15)中列出的参数。有谁知道我会怎么做?

例如:

install.packages('stargazer'); library(stargazer)
linear.1 <- lm(rating ~ complaints + privileges + learning + raises + critical,
               data=attitude)
linear.2 <- lm(rating ~ complaints + privileges + learning, data=attitude)
attitude$high.rating <- (attitude$rating > 70)
probit.model <- glm(high.rating ~ learning + critical + advance,
                    data=attitude, family = binomial(link = "probit"))

stargazer(linear.1, linear.2, probit.model, title="Regression Results",
          align=TRUE, dep.var.labels=c("Overall Rating","High Rating"),
          covariate.labels=c("Handling of Complaints","No Special Privileges",
          "Opportunity to Learn","Performance-Based Raises","Too Critical",
          "Advancement"), omit.stat=c("LL","ser","f"), no.space=TRUE)

上面给了我一个包含测试统计数据的表格,我想完全省略它。以下用置信区间替换它们,但这并没有更好。

stargazer(linear.1, linear.2, title="Regression Results",
dep.var.labels=c("Overall Rating","High Rating"),
covariate.labels=c("Handling of Complaints","No Special Privileges",
                   "Opportunity to Learn","Performance-Based Raises",
                   "Too Critical","Advancement"), omit.stat=c("LL","ser","f"),
                   ci=TRUE, ci.level=0.90, single.row=TRUE)

这些表格可以在R-statistics 博客条目Tailor Your Tables with stargazer: New Features for LaTeX and Text Output中看到,分别作为第一和第二。

4

1 回答 1

5

当前版本的 stargazer 不支持省略标准错误和/或置信区间(我假设这就是您所说的“测试统计”的意思)。但是,我一直在考虑在未来的版本中使 stargazer 输出更加可调整 - 请随时向我(包作者)发送有关如何最好地做到这一点的想法。

目前,省略标准错误的一种骇人听闻的方法可能涉及为se参数提供一个 NA 列表:

stargazer(linear.1, linear.2, probit.model, title="Regression Results", 
align=TRUE, dep.var.labels=c("Overall Rating","High Rating"), 
covariate.labels=c("Handling of Complaints","No Special Privileges", 
"Opportunity to Learn","Performance-Based Raises","Too Critical","Advancement"),
omit.stat=c("LL","ser","f"), no.space=TRUE, se=list(NA, NA, NA))

更新:

从 5.0 版开始,stargazer 包含了“报告”参数,允许用户选择要报告的统计数据。例如,要仅报告带有显着性星的系数,用户可以指定report = "c*".

于 2013-10-07T02:49:28.727 回答