1
$\begingroup$

How do I present a difference-in-differences regression output like the following in R?

$\endgroup$
1
  • $\begingroup$ TRY STARGAZER PACKAGE $\endgroup$ Apr 11 at 19:16

2 Answers 2

3
$\begingroup$

In addition to stargazer, you can also try to use model summary package. I used to use stargazer, and stargazer is very good if you need just quick table, but model summary gives you more options and control over the table.

Quick example;

install.packages('modelsummary')
library(modelsummary)
mod <- lm(y ~ x, dat)
modelsummary(mod, output = "table.tex")

See the package manual for more details.

$\endgroup$
3
$\begingroup$
install.packages('stargazer')
library(stargazer)

x1 = rnorm(100)
x2 = x1 + rnorm(100)
y = 2*x1+3*x2
model = lm(y~x1+x2)

stargazer(model)

And if you are using the package 'fixest' for estimation (which is a good idea because it is fast if you have many fixed effects) then you can use the function table() as documented via this link

https://www.rdocumentation.org/packages/fixest/versions/0.3.1/topics/etable

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.