Stargazer Omit测试统计

时间:2013-10-03 18:47:30

标签: r latex stargazer

使用stargazer时,有一个参数omit.stat,但是我需要从我的系数值下面删除测试统计信息,它不是stargazer package documentation (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 blog entry, Tailor Your Tables with stargazer: New Features for LaTeX and Text Output上看到,分别作为第一个和第二个。

1 个答案:

答案 0 :(得分:5)

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

目前,省略标准错误的一种hackish方法可能涉及向se参数提供一份NAs列表:

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*"