bstudent
2011-Jun-12 19:43 UTC
[R] Running a GMM Estimation on dynamic Panel Model using plm-Package
Hello, although I searched for a solution related to my problem I didn?t find one, yet. My skills in R aren?t very large, however. For my Diploma thesis I need to run a GMM estimation on a dynamic panel model using the "pgmm" - function in the plm-Package. The model I want to estimate is: "Y(t) = Y(t-1) + X1(t) + X2(t) + X3(t)" . There are no "normal" instruments in this model. There just should be the "gmm-instruments" I need for the model. In order to estimate it, I tried the following code:> > library(plm) > > test <- pgmm(Y ~ lag(Y, 1) + X1 + X2 + X3 | lag(Y, 1), data=Model, > effect="individual", model="onestep") > >I tried "Model" as "Modelp <- pdata.frame(..." and as "Model <- read.table(..." but in both cases there?s an error-massage: Error in solve.default(Reduce("+", A2)) : System ist f?r den Rechner singul?r: reziproke Konditionszahl 4.08048e-22 Error in solve.default(Reduce("+", A2)) : System is singulary for the computer: reciprocal number of conditions 4.08048e-22 I really can?t help myself since the standard plm-estimations "within" or "first difference" are working well. I hope you understood what I?m trying to do and my description is adequate. Thank you very much!!!!! Kind regards. bStudent -- View this message in context: http://r.789695.n4.nabble.com/Running-a-GMM-Estimation-on-dynamic-Panel-Model-using-plm-Package-tp3592466p3592466.html Sent from the R help mailing list archive at Nabble.com.
Jan Schulz
2011-Jun-12 21:25 UTC
[R] Running a GMM Estimation on dynamic Panel Model using plm-Package
Hi! Am 12.06.2011 21:43, schrieb bstudent:> Error in solve.default(Reduce("+", A2)) : > System ist f?r den Rechner singul?r: reziproke Konditionszahl > 4.08048e-22 > > Error in solve.default(Reduce("+", A2)) : > System is singulary for the computer: reciprocal number of conditions > 4.08048e-22Just for the record: I had the same error with my data and finaly gave up and used stata. Kind regards and good luck! Jan
MicahD
2011-Oct-05 04:54 UTC
[R] Running a GMM Estimation on dynamic Panel Model using plm-Package
Hi bstudent, I've had the same problem and I wish there was a definitive answer as this seems to be the #1 problem with the package and pgmm would be awesome for economists if we could figure out how to work it! I'm no expert on GMM, but from what I've gathered from other posts, the problem may stem from your panel data being a "long panel" with more time-varying observations than cross-sectional (aka individual level) observations. If that happens then there's a problem with the number of instruments used in the Arellano-Bond estimator. I'm pretty sure you can determine exactly when it would be a problem and what size your data set has to be, but you might have to learn about the asymptotics of the Arellano-Bond estimator. Maybe someday someone who knows more about GMM will tell us how to figure this one out. I love this package, though, and panel data is at the pinnacle of dynamic empirical analysis in economics, so I wish someone could come up with more detailed instructions for non-experts. Panel GMM is becoming widely known as the most efficient estimator of panel data regressions and I think I'd ask the plim package to marry me if I ever found out how to work pgmm. Here's a link to a good paper on "optimal instruments" by Arellano: http://www.cemfi.es/~arellano/siv2004.pdf Instrumental Variables for Dynamic Panel Models - Arellano (2004) - Micah ps I simply reverted to Stata in order to get my Panel GMM estimations. -- View this message in context: http://r.789695.n4.nabble.com/Running-a-GMM-Estimation-on-dynamic-Panel-Model-using-plm-Package-tp3592466p3873431.html Sent from the R help mailing list archive at Nabble.com.
Paul Johnson
2011-Oct-05 17:26 UTC
[R] Running a GMM Estimation on dynamic Panel Model using plm-Package
On Sun, Jun 12, 2011 at 2:43 PM, bstudent <marc.ruetten at gmx.de> wrote:> Hello, > > although I searched for a solution related to my problem I didn?t find one, > yet. My skills in R aren?t very large, however. > For my Diploma thesis I need to run a GMM estimation on a dynamic panel > model using the "pgmm" - function in the plm-Package. > > The model I want to estimate is: "Y(t) = Y(t-1) + X1(t) + X2(t) + X3(t)" . > > There are no "normal" instruments in this model. There just should be the > "gmm-instruments" I need for the model. > In order to estimate it, I tried the following code: > >> >> library(plm) >> >> test <- pgmm(Y ~ lag(Y, 1) + X1 + X2 + X3 | lag(Y, 1), data=Model, >> effect="individual", model="onestep") >> >> > > I tried "Model" as "Modelp <- pdata.frame(..." and as "Model <- > read.table(..." but in both cases there?s an error-massage: > > Error in solve.default(Reduce("+", A2)) : > ?System ist f?r den Rechner singul?r: reziproke Konditionszahl > 4.08048e-22 >Hello, I have students working on similar problems. Here is what I would say to them: Without a dataset and code that is supposed to work, nobody can figure out what's wrong and help you around it. 2 suggestions 1. directly contact Yves Croissant, the plm principal author, and give him your R code and the data set. Show him the error output you get. Here's the contact information: Yves Croissant <yves.croissant at univ-reunion.fr> If he answers, please let us know. If you don't want to (or can't) give real data, make some up that causes the same crash. 2. post in here a link to your data and the full code and I will try to debug it to at least find out where this is going wrong. I've been studying debugging with R functions and this is a good opportunity for me. I stopped focusing on panel estimator details in 2000, so I'm rusty, but will probably recognize most of what is going on. If you don't want to broadcast this to everybody, uou can feel free to contact me directly, pauljohn at ku.edu is my university address. PJ -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas