3

I want to replicate in texreg the functionality contained in stargazer via the arguments omit and omit.labels (see here). Unfortunately, I cannot use the stargazer package as it does not support the model I am using and is not extensible. Since texreg is easily extensible I can get it to work with my models. I can also easily omit some output from texreg with the omit.coef argument. What I can't seem to figure out is how to insert labels for the omitted coefficients. Does this exist in texreg? Does anyone have experience trying to write this functionality into an extract function? Alternatively, has anyone figured out how to extend stargazer to work with a custom model?

Context: I am writing a presentation in knitr and need to convert the output of some estimators into latex which will then get converted to pdf for my beamer presentation. The output has a bunch of covariates and thus is too long to display nicely in beamer. I want to truncate the output by omitting some covariates and inserting in their place a line indicating whether these covariates have been included in the model or not, e.g. collapse the variables "County Population", "County Income", etc. into a line that reads "County controls" and then have "Yes" or "No" to indicate whether these controls were included in the estimate or not. Ideally, someone could help me figure out a way to do this in texreg. If not, I would be open to other packages/approaches, e.g. xtable.

Cœur
  • 37,241
  • 25
  • 195
  • 267
gfgm
  • 3,627
  • 14
  • 34

1 Answers1

1

A possible option is the github version of huxtable. (I am the author.) This has a huxreg function which creates a table from a bunch of regressions, much like texreg: it'll work for anything that has a broom::tidy method defined for it. You can then edit the table much like a normal data frame, just rbind in the rows you want.

You'll need to install using devtools::install_github, if you want to try this route.

  • Thanks @dash2, that's a very interesting package. Unfortunately, it won't help me much directly as I am working with models I wrote myself so there are no `tidy` methods defined for them. But the package looks interesting for the future. Would be great if you gave it a standard API that would allow someone to make their model work with the package as texreg does (i.e. that would allow me to make my model readable to your `huxreg` function). – gfgm Mar 27 '17 at 14:59
  • Well, why not just define a `tidy` method? Then you get it and all other packages that work with `broom` (e.g. `pixiedust`) for free. –  Mar 27 '17 at 15:41