Reputation: 11
How can I vertically stack two different sets of regression outputs using the same set of dependent variables from fixest/feols using etable? For instance, suppose you estimate the same specification with different samples
est1 <- feols(c(y1,y2,y3,y4) ~ x1, data %>% filter(sample=="A"))
est2 <- feols(c(y1,y2,y3,y4) ~ x1, data %>% filter(sample=="B"))
I would like to stack the results in est1 and est2 vertically (instead of horizontally) to create a latex table so that Panel A has the results from est 1 (using sample "A") and Panel B of the same table has the results from est2 (without having to repeat the dependent variable names).
I have tried to do this using "modelsummary" instead of etable. Unfortunately, for IV regression, I was not able to export all the relevant statistics to modelsummary from the fixest_multi object.
Upvotes: 1
Views: 589
Reputation: 170
You can use the panelsummary
package.
library(fixest)
library(tidyverse)
library(panelsummary)
est1 <- feols(c(cyl,hp,drat) ~ mpg, data= mtcars %>% filter(wt <= 2))
est2 <- feols(c(cyl,hp,drat) ~ mpg,data = mtcars %>% filter(wt > 2))
panelsummary(list(est1),
list(est2),
panel_labels = c("Panel A: Restricting WT <= 2",
"Panel B: Restricting WT > 2"))
Full disclosure: I am the author of the panelsummary
package.
Upvotes: 0