# same as the example in felm but extracting the covariance matrix
# subset trade flows to avoid fitting time warnings during check
set.seed(123)
trade_2006 <- trade_panel[trade_panel$year == 2006, ]
trade_2006 <- trade_2006[sample(nrow(trade_2006), 500), ]
mod <- felm(
trade ~ log_dist + lang + cntg + clny | exp_year + imp_year | pair,
trade_2006
)
round(vcov(mod, type = "clustered"), 5)
Run the code above in your browser using DataLab