Luca Gagliardone
2015-Aug-14 12:13 UTC
[R] System exactly singular with pgmm (package plm)
his is my first post, I'll do my best to be clear and complete. I am trying to run a pgmm regression (Arellano Bond estimator) following the example online with the EmplUK dataset. My dataset is unbalanced, with some missing values (that I also removed, without any difference). This is the paste from R' dataframe. row.names ID Year p I 1 23 1 1992 NA NA 2 22 1 1993 17.01 NA 3 21 1 1994 15.86 NA 4 20 1 1995 17.02 7.512347 5 19 1 1996 20.64 7.685104 6 18 1 1997 19.11 12.730282 7 17 1 1998 12.76 12.633871 8 16 1 1999 17.90 7.416381 9 15 1 2000 28.66 6.396114 10 14 1 2001 24.46 9.213729 11 13 1 2002 24.99 20.117159 12 12 1 2003 28.85 11.117816 13 11 1 2004 38.26 11.242638 14 10 1 2005 54.57 13.015168 15 9 1 2006 65.16 18.507212 16 8 1 2007 72.44 18.875281 17 7 1 2008 96.94 24.459170 18 6 1 2009 61.74 21.332035 19 5 1 2010 79.61 17.119038 20 4 1 2011 111.26 16.941914 21 3 1 2012 111.63 19.964875 22 2 1 2013 108.56 28.863894 23 1 1 2014 99.03 15.182615 24 45 2 1993 17.01 NA 25 44 2 1994 15.86 NA 26 43 2 1995 17.02 NA 27 42 2 1996 20.64 NA 28 41 2 1997 19.11 NA 29 40 2 1998 12.76 NA 30 39 2 1999 17.90 11.428262 31 38 2 2000 28.66 20.232613 32 37 2 2001 24.46 25.811754 33 36 2 2002 24.99 18.959958 34 35 2 2003 28.85 20.767074 35 34 2 2004 38.26 29.260406 36 33 2 2005 54.57 25.837434 37 32 2 2006 65.16 32.675618 38 31 2 2007 72.44 48.415190 39 30 2 2008 96.94 42.444435 40 29 2 2009 61.74 40.047462 41 28 2 2010 79.61 49.090816 42 27 2 2011 111.26 53.828050 43 26 2 2012 111.63 61.684020 44 25 2 2013 108.56 68.394140 45 24 2 2014 99.03 55.738584 46 76 3 1984 NA NA 47 75 3 1985 NA NA 48 74 3 1986 NA NA 49 73 3 1987 18.53 NA 50 72 3 1988 14.91 NA 51 71 3 1989 18.23 NA 52 70 3 1990 23.76 17.046268 53 69 3 1991 20.04 30.191128 54 68 3 1992 19.32 30.414108 55 67 3 1993 17.01 27.916000 56 66 3 1994 15.86 26.437651 57 65 3 1995 17.02 25.895513 58 64 3 1996 20.64 26.791996 59 63 3 1997 19.11 30.074375 60 62 3 1998 12.76 42.636103 61 61 3 1999 17.90 46.862510 62 60 3 2000 28.66 30.154079 63 59 3 2001 24.46 30.297644 64 58 3 2002 24.99 34.851205 65 57 3 2003 28.85 38.854943 66 56 3 2004 38.26 37.542447 67 55 3 2005 54.57 38.456399 68 54 3 2006 65.16 43.465535 69 53 3 2007 72.44 41.749414 70 52 3 2008 96.94 48.371262 71 51 3 2009 61.74 54.914470 72 50 3 2010 79.61 65.444964 73 49 3 2011 111.26 76.888119 74 48 3 2012 111.63 81.833602 75 47 3 2013 108.56 83.800483 76 46 3 2014 99.03 79.713947 my codes are the following: data <- plm.data(Autoregression,index=c("ID","Year")) Panel <- subset(data, !is.na(I) ) Are <- pgmm( I~p+lag( I , 0:1) | lag(I, 2:99), data = Panel, effect = "twoways", model = "onestep") I have tried also many other versions, including every possible number of the lags, shorter or longer. The error is the following : Errore in solve.default(crossprod(WX, t(crossprod(WX, A1)))) : Lapack routine dgesv: system is exactly singular: U[3,3] = 0 Inoltre: Warning message: In pgmm(I ~ lag(I, 1) + p | lag(I, 2:10), Panel, effect = "twoways", : the first-step matrix is singular, a general inverse is used Can you please help me? Thanks for the attention, i'll wait for an answer Regards, Luca. [[alternative HTML version deleted]]