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

Fixef Function with Instruments #10

Closed
gorkembostanci opened this issue Aug 23, 2021 · 4 comments
Closed

Fixef Function with Instruments #10

gorkembostanci opened this issue Aug 23, 2021 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@gorkembostanci
Copy link

Hello,

The fixef function gives the following error when instruments are used in plm function:

Error in tcrossprod(coef(object), as.matrix(object$model[, -1, drop = FALSE])) :
non-conformable arguments

I believe this is because the object 'as.matrix(object$model[, -1, drop = FALSE])' has the instruments in it. I think this wasn't an issue before March.

Best,

@tappek tappek added the bug Something isn't working label Aug 23, 2021
@tappek
Copy link
Collaborator

tappek commented Aug 23, 2021

Thank your for reporting. This bug is in since 2.4-0 when fixef was fixed for two-way FE models.
You can workaround this by estimating a one-way model with dummies for the other dimension.

@gorkembostanci
Copy link
Author

I see, thank you!

@tappek tappek added this to the plm 2.4-2 milestone Aug 26, 2021
@tappek
Copy link
Collaborator

tappek commented Aug 31, 2021

This is fixed in the development version since a few days in rev. 1293, https://r-forge.r-project.org/R/?group_id=406, the root cause being a different one than supposed in the original report.

Install the development version via install.packages("plm", repos="http://R-Forge.R-project.org").

Be sure to check out the fast mode of the package by setting options("plm.fast" = TRUE).

[While fixing this bug, I found an issue in package fixest:fixef() related to this (https://github.com/lrberge/fixest/issues/190) and found a somewhat suprisingly dynamic setting of the reference level in lfe:getfe() (https://github.com/sgaure/lfe/issues/52).]

@tappek tappek closed this as completed Aug 31, 2021
@tappek
Copy link
Collaborator

tappek commented Sep 21, 2021

plm version 2.4-2 now on CRAN (2021-09-21) containing this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants