Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • time variable must contain only integer values

    Hi


    I do not understand what is causing the r(451) error after the second GMM command below.

    xtset person year, delta(2) format(%ty)
    panel variable: person (unbalanced)
    time variable: year, 1998 to 2016, but with gaps
    delta: 2 years

    The following code works
    gmm (1- {b=1}*F.gross_r*(F.totcons/totcons)^(-1*{gamma=1})), instruments(gross_r L.gross_r ly L.ly)

    The following code gives me an r(451) error
    gmm (1- {b=1}*F.gross_r*(F.totcons/totcons)^(-1*{gamma=1})), xtinstruments(ly, lags(2/3)) instruments(L.gross_r) winitial(xt L)

    time variable must contain only integer values
    r(451);

    But Year is stored as an integer.



    . dataex person year totcons gross_r ly in 1/10

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float person int year float(totcons gross_r ly)
     9 1998  5008.018 1.0561262 20900
     9 2000  4949.356 1.0418211 23000
     9 2002  5906.731  .9898661 22440
     9 2004  5534.972  .9723974 16000
     9 2006  6316.314 1.0307101 23000
     9 2008 3593.0674  .9943333     0
     9 2010 4865.0444  .9557594     0
    10 1998  8846.052 1.0561262     0
    10 2000  7747.692 1.0418211     0
    10 2002  9452.782  .9898661     0
    end
    format %ty year
    ------------------ copy up to and including the previous line ------------------

    Listed 10 out of 39783 observations





    Any advice on how to fix this would be appreciated.


    yours sincerely
    Mo
Working...
X