lrberge / fixest

Fixed-effects estimations
https://lrberge.github.io/fixest/
377 stars 59 forks source link

Ordering of automatic headers from etable #416

Open bberger94 opened 1 year ago

bberger94 commented 1 year ago

I'd like to reorder the default headers from etable so that the depvar lines are below split sample groups. As far as I can tell this is not possible without manually specifying headers for the group and depvar headers and using ^ to order them. Am I missing something? If not, could this functionality be added?

Thanks!

library(tidyverse)
library(fixest)
n <- 100
set.seed(1)
data <- tibble(
   i = seq_len(n),
   x = rnorm(n),
   g = ifelse(i > n / 2, "Group 2", "Group 1"),
   y1 = x + rnorm(n),
   y2 = x + rnorm(n))

fit <- feols(c(y1, y2) ~ x, data, split = ~g)

etable(fit, tex = TRUE, headers = list("auto"))