amrei-stammann / alpaca

An R-package for fitting glm's with high-dimensional k-way fixed effects
43 stars 6 forks source link

Output to latex #8

Closed leonardodamico closed 5 years ago

leonardodamico commented 5 years ago

Hi! First of all, congratulations on doing this package, it is fast and simplifies a lot of issues! We have a big dataset on which we are fitting a Poisson regression with many levels of FE and we really appreciate alpaca!

Thanks a lot for all your work!

I was wondering whether it is possible to transform the feglm in a felm/lm-like object that is interpretable by stargazer/xtable in order to output it to Latex. I know this is minor but I was wondering if it is something you are planning to introduce!

Thanks again!

amrei-stammann commented 5 years ago

This is a good idea, but compatibility with stargazer can only be activated by the maintainer of stargazer.

However you can directly use xtable:

# Generate an artificial data set for logit models
library(alpaca)
data <- simGLM(100L, 10L, 1805L, model = "logit")

# Fit 'feglm()'
mod <- feglm(y ~ x1 + x2 + x3 | i + t, data)
summary(mod)

# Latex Output
library(xtable)
xtable(coef(summary(mod)))

Best, Amrei

leonardodamico commented 5 years ago

Thank you amrei!

Best, Leonardo

zauster commented 5 years ago

Just FYI: The texreg package can also deal with feglm objects and display several models beside each other...