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
feols(): divergence of the fixed-effects algorithm without warning #323
Comments
Here is how to replicate the problem with this data set:
|
I was curious by this issue given my recent question: #363 Your example replicates for me. I don't have an answer except that demeaning goes wrong somewhere, but I'll post my thought process.
Lastly, |
Dear @ja-ortiz-uniandes, thanks a lot for this issue and especially the reproducible example. Two things:
To be clear, I have added a few tricks in the internal demeaning algorithm to help it get out of difficult cases. You can access the new settings with the (new) function Thanks again all and very sorry for the immense delay. |
Dear @lrberge thank you. Your package has made science more open and accessible. As I have expressed many times before, I believe there is no better way to do FE estimations than with |
Hello, I am using
feols()
to estimate a relatively simple model with 3 types of fixed effects. Here is my call:However after doing this estimation I get the following results when using
screenreg()
(results are the same withetable()
):I believe this is problematic since the model I have has no restrictions for the slope or the intercept and as such I don't see why I'm producing a negative R2. Possibly, I'm not understanding something.
I also tried using
lfe::felm()
and got quite a different result in much less time. Here is my call tofelm()
:And here are the results (using
screenreg()
):As for the execution time I've been using
Sys.time()
and whilefelm()
takes around 1.3 seconds,feols()
takes over a minute (anywhere between 1.02 mins to 1.4 mins).Finally, I will say that when using
etable()
I get the following warning:In FUN(X[[i]], ...) : probable complete loss of accuracy in modulus
however this is not always the case, as different model specifications still yield negative R2s but no error messages. The necessary steps to reproduce these results are bellow.The text was updated successfully, but these errors were encountered: