Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAPEs with more than 2 high-dimensional fixed effects #11

Open
tcsimmons opened this issue Jul 20, 2020 · 2 comments
Open

getAPEs with more than 2 high-dimensional fixed effects #11

tcsimmons opened this issue Jul 20, 2020 · 2 comments

Comments

@tcsimmons
Copy link

While using getAPEs to calculate the fixed effects of the model, I've noticed that "getAPEs' currently only supports logit and probit models" error always shows up whenever I have more than 2 high-dimensional fixed effects in the model. I looked through the code and found that this is indeed part of the function. You can see from the following code, copied directly from the function, that any model with "lvls.k" not equal to 2 will throw an error:

if (panel.structure == "classic") {
if (object[["family"]][["family"]] != "binomial" |
!(object[["family"]][["link"]] %in% c("logit",
"probit")) | length(object[["lvls.k"]]) !=
2L) {
stop(paste("'getAPEs' currently only supports logit and probit models.")

Maybe I just don't understand the background here, but I was also reading in the package reference manual and found the following line which suggests that the function should apply for all covariates in the model and never stipulates the limitation on number:

"getAPEs 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."

Can you help me understand why there's a limitation on calculating average partial effects with respect to the number of covariates placed in the model?

@amrei-stammann
Copy link
Owner

Hi,

getAPEs() currently only works for logit and probit models, either with two-way fixed effects (in a classical panel structure, see https://cran.r-project.org/web/packages/alpaca/vignettes/howto.html) or with three-way fixed effects (in a network panel structure, see https://cran.r-project.org/web/packages/alpaca/vignettes/trade.html). You are right, the error message should be more informative. The limitation is mainly due to the computation of the standard errors. We are currently working on extensions.

Best,
Amrei

@tcsimmons
Copy link
Author

tcsimmons commented Jul 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants