The provided broom
methods do the following:
augment
: Takes the input data and adds additional columns with the fitted values and residuals.glance
: Extracts the deviance, null deviance, and the number of observations.`tidy
: Extracts the estimated coefficients and their standard errors.
Usage
# S3 method for class 'feglm'
augment(x, newdata = NULL, ...)
# S3 method for class 'felm'
augment(x, newdata = NULL, ...)
# S3 method for class 'feglm'
glance(x, ...)
# S3 method for class 'felm'
glance(x, ...)
# S3 method for class 'feglm'
tidy(x, conf_int = FALSE, conf_level = 0.95, ...)
# S3 method for class 'felm'
tidy(x, conf_int = FALSE, conf_level = 0.95, ...)
Examples
set.seed(123)
trade_2006 <- trade_panel[trade_panel$year == 2006, ]
trade_2006 <- trade_2006[sample(nrow(trade_2006), 500), ]
mod <- fepoisson(
trade ~ log_dist + lang + cntg + clny | exp_year + imp_year,
trade_2006
)
broom::augment(mod)
#> Registered S3 methods overwritten by 'broom':
#> method from
#> augment.felm capybara
#> glance.felm capybara
#> tidy.felm capybara
#> # A tibble: 500 × 9
#> trade log_dist lang cntg clny exp_year imp_year .fitted .residuals
#> <dbl> <dbl> <int> <int> <int> <fct> <fct> <dbl> <dbl>
#> 1 599. 9.00 0 0 0 KOR2006 CYP2006 467. 132.
#> 2 97.6 9.18 0 0 0 KOR2006 TUN2006 156. -58.5
#> 3 4.16 8.80 0 0 0 ITA2006 NPL2006 5.77 -1.61
#> 4 1609. 8.69 0 0 0 CAN2006 NOR2006 1076. 532.
#> 5 73.5 9.03 0 0 0 TUN2006 BRA2006 51.5 22.0
#> 6 0 9.68 0 0 0 MMR2006 TTO2006 0.0899 -0.0899
#> 7 11.0 9.69 0 0 0 IND2006 BOL2006 14.1 -3.09
#> 8 1454. 6.55 0 0 0 DNK2006 POL2006 1436. 18.3
#> 9 63.7 9.03 0 0 0 NLD2006 LKA2006 203. -140.
#> 10 3.43 9.06 0 0 0 NOR2006 MWI2006 0.583 2.84
#> # ℹ 490 more rows
broom::glance(mod)
#> # A tibble: 1 × 6
#> deviance null_deviance nobs_full nobs_na nobs_pc nobs
#> * <dbl> <dbl> <int> <int> <int> <int>
#> 1 55601. 2890992. 500 0 0 500
broom::tidy(mod)
#> # A tibble: 4 × 4
#> estimate std.error statistic p.value
#> * <dbl> <dbl> <dbl> <dbl>
#> 1 -0.794 0.00490 -162. 0
#> 2 0.0491 0.0103 4.78 0.00000175
#> 3 0.691 0.0113 61.3 0
#> 4 -0.0239 0.0109 -2.19 0.0287