0

I have a panel data that follows the same individuals (id) over 2 time periods being 2002 and 2004 (year where year equals to 1 if the year is 2004).

N = 10000
wage <- rnorm(N)
educ <- rnorm(N)
age  <- rnorm(N)
tce  <- rnorm(N)

work <- rbinom(n = N, size = 1, prob = 0.05)
manu <- rbinom(n = N, size = 1, prob = 0.05)
year <- rbinom(n = N, size = 1, prob = 0.05)

id <- sample(10, N, replace = TRUE)

df <- data.frame(wage, educ, age, tce, work, manu, id, year)

I would like advice on how to cluster standard errors, if I wanted to cluster standard errors at the individual level. Should it be:

library(fixest)
model1 <- feols(wage ~ educ + age + tce, data = df, vcov = id)

or is it

library(fixest)
model2 <- feols(wage ~ educ + age + tce, data = df, vcov = ~id+year)

since I have panel data.

Thank you.

anrisakaki96
  • 193
  • 8
  • If you want to cluster standard errors only at the individual level, you should use model1. – Julian Apr 04 '22 at 19:48
  • Thanks for your reply. Is there a reason why I should not include year, even when I write it econometrically as e_{it} – anrisakaki96 Apr 04 '22 at 20:34
  • I think you confuse the error term with the standard errors. Perhaps you should ask your question on https://stats.stackexchange.com/. Which standard errors to include depends really competely on your research question (on how your observations may be clustered and how to account for it) – Julian Apr 05 '22 at 06:50

0 Answers0