Stargazer Omit test statistics
Asked Answered
L

1

6

When using stargazer there is an argument, omit.stat, however I need to remove the test statistics from below my coefficient values and it isn't an argument listed in the stargazer package documentation (PDF) (pp. 14–15). Does anyone know how I might go about this?

For Example:

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)

The above gives me a table with test statistics, which I would like to omit entirely. The following replaces them with confidence intervals but that isn't any better.

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)

The tables can be seen on the R-statistics blog entry, Tailor Your Tables with stargazer: New Features for LaTeX and Text Output, as the first and second respectively.

Lamberto answered 3/10, 2013 at 18:47 Comment(1)
Ugh, smart-quotes replaced.Cheddite
C
5

The current version of stargazer does not support omitting the standard errors and/or confidence intervals (I assume this is what you mean by 'test statistics'). However, I have been considering making stargazer output a lot more adjustable in future releases - feel free to send me (the package author) ideas about how best to do this.

For now, a hackish way to omit standard errors might involve feeding the se argument a list of 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))

Update:

Since version 5.0, stargazer has included the 'report' argument that allows users to choose which statistics to report. To report only coefficients with significance stars, for instance, users can specify report = "c*".

Chetchetah answered 7/10, 2013 at 2:49 Comment(9)
Thanks! Very helpful, I was using the ugly approach of removing every nth line from the output as neededLamberto
passing se=list(NA,NA,NA) works but then the stars for significance are gone as well. Is there a workaround?Creolized
Omitting standard error and/or confidence intervals and keeping the significance stars would be great!Doi
See the update to my answer above. report = c* might be what you are looking for.Chetchetah
Hello, Marek! Do you have any plans to add support for SEM packages any time soon? In particular, for objects, produced by lavaan, OpenMx, plspm and other SEM packages. EFA/CFA support would be very welcome, as well.Hysterectomy
Planning to make the package more extensible in the near future - would make it easy to add support for those. Currently swamped with other projects, though. Thanks for the suggestions!Chetchetah
My pleasure and thank you for the reply. I look forward to the package's enhancements. Best wishes!Hysterectomy
@Marek Would you consider adding a couple of examples with the report argument in action in ?stargazer? This would be very useful!Seavey
@Creolized put se = NA, it's work for me !Crusado

© 2022 - 2024 — McMap. All rights reserved.