apes | R Documentation |
apes
is a post-estimation routine that can be used
to estimate average partial effects with respect to all covariates in the
model and the corresponding covariance matrix. The estimation of the
covariance is based on a linear approximation (delta method) plus an
optional finite population correction. Note that the command automatically
determines which of the regressors are binary or non-binary.
Remark: The routine currently does not allow to compute average partial effects based on functional forms like interactions and polynomials.
apes(
object = NULL,
n_pop = NULL,
panel_structure = c("classic", "network"),
sampling_fe = c("independence", "unrestricted"),
weak_exo = FALSE
)
object |
an object of class |
n_pop |
unsigned integer indicating a finite population correction for
the estimation of the covariance matrix of the average partial effects
proposed by Cruz-Gonzalez, Fernández-Val, and Weidner (2017). The correction
factor is computed as follows:
|
panel_structure |
a string equal to |
sampling_fe |
a string equal to |
weak_exo |
logical indicating if some of the regressors are assumed to
be weakly exogenous (e.g. predetermined). If object is of class
|
The function apes
returns a named list of class
"apes"
.
Cruz-Gonzalez, M., I. Fernández-Val, and M. Weidner (2017). "Bias corrections for probit and logit models with two-way fixed effects". The Stata Journal, 17(3), 517-545.
Czarnowske, D. and A. Stammann (2020). "Fixed Effects Binary Choice Models: Estimation and Inference with Long Panels". ArXiv e-prints.
Fernández-Val, I. and M. Weidner (2016). "Individual and time effects in nonlinear panel models with large N, T". Journal of Econometrics, 192(1), 291-312.
Fernández-Val, I. and M. Weidner (2018). "Fixed effects estimation of large-t panel data models". Annual Review of Economics, 10, 109-138.
Hinz, J., A. Stammann, and J. Wanner (2020). "State Dependence and Unobserved Heterogeneity in the Extensive Margin of Trade". ArXiv e-prints.
Neyman, J. and E. L. Scott (1948). "Consistent estimates based on partially consistent observations". Econometrica, 16(1), 1-32.
bias_corr
, feglm
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.