# 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), ]
trade_2006$trade <- ifelse(trade_2006$trade > 100, 1L, 0L)
# Fit 'feglm()'
mod <- feglm(trade ~ lang | year, trade_2006, family = binomial())
# Compute average partial effects
mod_ape <- apes(mod)
summary(mod_ape)
# Apply analytical bias correction
mod_bc <- bias_corr(mod)
summary(mod_bc)
# Compute bias-corrected average partial effects
mod_ape_bc <- apes(mod_bc)
summary(mod_ape_bc)
Run the code above in your browser using DataLab