lmdiag
lmdiag copied to clipboard
Estimation results of linearmodels
Thanks for a very useful package. It would be great if lmdiag is extended so that the estimation results of linearmodels can be used as an input, e.g. IV-2SLS and Panel Data.
@spring-haru: Thanks for your comment. I'd love to work on this, but I'm currently quite busy and this won't change in the next few months.
I'll keep your request in mind and will comment here, as soon as I start working on this topic.
If anyone else likes to work on this in the meanwhile, please let me know. I would be happy for any pull request :-)
Today I did a first implementation for linearmodels. Try lmdiag 0.3.7 and take a look into the example notebook for reference.
Don't expect it to be totally solid, yet. If you find bugs, please open a new ticket, then I'll try to fix them.
439f6284a08f4329a0ca8fcbc8da7158f856cebf
Thanks for a great update!!
I tried lmdiag, and it worked in many cases for IV2SLS, IVLIML, IVGMM and IVGMMCUE in the following links of the linearmodels website
Instrumental Variable Estimation: Basic Examples
and
Instrumental Variable Estimation: Further Examples
though it generated the following error
LinAlgError: SVD did not converge in Linear Least Squares
in some cases. There were also an error like
KeyError: 25.0
in others.
I also tried lmdiag for PooledOLS , RandomEffects, BetweenOLS, PanelOLS, FirstDifferenceOLS in the following link
Panel Data Model Estimation: Examples
But, all did not work.
For your reference, I uploaded .ipynb file which contains all calculations in this link.
Hope it helps!!
@spring-haru : Thanks for your tests! I try to take a look into it the next days, and your jupyter notebook will certainly help me to identify the bugs! :-)
Just a bit background FYI: linearmodels has a quite different api than statsmodels, and is sadly not compatible. Sometimes, only the names of properties vary (eg. fitted_values vs. fittedvalues) which is easy to solve, but inearmodels also doesn't provide all information needed for the plots. I had to calculate those metrics by my own, without understanding those formulas in detail, to be honest. I'll try my best to fix as many issues as possible, but don't expect lmdiag to work 100% with linearmodels, as it takes more effort than I thought...