getAPEs {alpaca}  R Documentation 
Compute average partial effects after fitting binary choice models with a one/two/threeway error component
Description
getAPEs
is a postestimation 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 nonbinary.
Remark: The routine currently does not allow to compute average partial effects based on functional forms like interactions and polynomials.
Usage
getAPEs(
object = NULL,
n.pop = NULL,
panel.structure = c("classic", "network"),
sampling.fe = c("independence", "unrestricted"),
weak.exo = FALSE
)
Arguments
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
CruzGonzalez, FernándezVal, 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 
Value
The function getAPEs
returns a named list of class "APEs"
.
References
CruzGonzalez, M., I. FernándezVal, and M. Weidner (2017). "Bias corrections for probit and logit models with twoway fixed effects". The Stata Journal, 17(3), 517545.
Czarnowske, D. and A. Stammann (2020). "Fixed Effects Binary Choice Models: Estimation and Inference with Long Panels". ArXiv eprints.
FernándezVal, I. and M. Weidner (2016). "Individual and time effects in nonlinear panel models with large N, T". Journal of Econometrics, 192(1), 291312.
FernándezVal, I. and M. Weidner (2018). "Fixed effects estimation of larget panel data models". Annual Review of Economics, 10, 109138.
Hinz, J., A. Stammann, and J. Wanner (2020). "State Dependence and Unobserved Heterogeneity in the Extensive Margin of Trade". ArXiv eprints.
Neyman, J. and E. L. Scott (1948). "Consistent estimates based on partially consistent observations". Econometrica, 16(1), 132.
See Also
Examples
# Generate an artificial data set for logit models
library(alpaca)
data < simGLM(1000L, 20L, 1805L, model = "logit")
# Fit 'feglm()'
mod < feglm(y ~ x1 + x2 + x3  i + t, data)
# Compute average partial effects
mod.ape < getAPEs(mod)
summary(mod.ape)
# Apply analytical bias correction
mod.bc < biasCorr(mod)
summary(mod.bc)
# Compute biascorrected average partial effects
mod.ape.bc < getAPEs(mod.bc)
summary(mod.ape.bc)