0

I am using stargazer and I would like to use it for model type, that is not supporter yet. So I would like to put it into stargazer by hand.

My question is how to replicate stargazer by hand using simple lm function

model = lm(hp ~ factor(gear) + qsec, data= mtcars)
stargazer::stargazer(model, type = "text")

is it possible to reproduce this output by hand? that is extract all coefficients and std. erors from model, create a dataframe and insert it to stargazer so it would look exactlz the same?

Petr
  • 1,606
  • 2
  • 14
  • 39
  • 1
    This is fundamentally not possible. The rule of thumb for working with stargazer is: don’t. [It’s a terrible package and quite unredeemable](https://www.reddit.com/r/rstats/comments/6o9v9h/whats_your_favorite_relatively_obscure_r_package/dkgw9q1/). Use [‘texreg’](https://github.com/leifeld/texreg/) instead. – Konrad Rudolph Mar 29 '20 at 16:45
  • @Konrad, *texreg* documentation looks solid. Also on that thread you linked, *broom* plus *pander* gets some votes as well - have you compared that workflow? – Mark Neal Mar 29 '20 at 18:28
  • 1
    @MarkNeal texreg is more automated than the combination broom + pander, which, ultimately, still requires you to format the model table yourself. That said, I find both workflows acceptable. – Konrad Rudolph Mar 29 '20 at 20:16

1 Answers1

0

With what I have worked with stargazer you can insert values manually (with latex output) but it is very tedious but very good if you want to add extra things with LaTeX code as well as insert additional rows or columns quickly as you like, but sometimes there are errors as you can't distinguish all LaTeX code in stargazer as I had a problem here. So I had to resort to another package called xtable. In short, it depends on what you want to do. I hope I've cleared up your doubt.

cdcarrion
  • 574
  • 6
  • 22