linearmodels
linearmodels copied to clipboard
Panel regression with lagged dependent variables
It looks like many of the needed pieces (esp. GMM IV) are in place to do Arellano-Bond style regressions with a lagged dependent variable, but it doesn't look like it is actually implemented. If that's the case do you have thoughts on how to implement it?
Possibly. I haven't started thinking about Dynamic Panel models to think about what a good interface would look like. I don't think the univariate GMM IV is enough to estimate the AB model.
Based on the Wikipedia entry I think the basic AB estimator can be estimated using your univariate GMM IV estimator. I started playing around in an IPython Notebook and created a simple class to replicate the instrument structure (scroll to the end):
https://gist.github.com/spillz/5cab778e146e37020d16c40eba9d9839
The more complicated AB estimator is a system IV. Is that something you have thought about implementing?
Actually, scratch this:
The more complicated AB estimator is a system IV.
It turns out it just stacks the differenced and undifferenced data and adds some additional instruments for the undifferenced set. So it's not really a "system". Should be easy to implement.
Thorough documentation by Roodman (creator of xtabond2):
http://www.stata-journal.com/article.html?article=st0159
A gist or similar would be helpful.
Yes, I'll add the system GMM estimator to the gist I linked above.
Dear Users,
I wanted to ask you a question related to Dynamic Panel Data and System-GMM models. When trying to run the System-GMM model, I get the following error message in STATA:
quadcross(): 3900 unable to allocate working space
xtabond2_mata(): - function returned error
@droodman tol me that perhaps I was using too many instruments. My annual panel covers 1960-2015, and around 160 countries. The code looks something like:
quietly: xtabond2 y l.y x1 x2 x3 x4 x5 year* , gmmstyle(y, laglimits(2 .)) gmmstyle(x1 x2 x3 x4 x5 , laglimits(1 .)) ivstyle(year* , p) noleveleq robust nodiffsargan nomata
Thanks for your help