Announcement

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

  • r(2000) no observations

    Dear statalisters,

    I want to run a system gmm regression to estimate the impact of agriculture and manufactured exports ( high skill exports and low skill exports) on the average

    years of schooling. My control variables are "imports", "death rate" and "migrant share". The independant variables are loged and lagged 5years.

    I have a panel data for 67 countries covering the period 1995-2015 with 5 year gaps.

    For the system gmm regression i used the following command :

    xtdpdsys schl2 L5.schl2 L5.lnagri L5.lnhigh L5.lnlow L5.lnimport L5.lndeath L5.lnmig, lags(5) twostep vce(robust)

    However when i run it i get r(2000) no observations knowing that i dont have missing observations and all my variables are numeric.

    Could it be that xtdpdsys is creating restrictions that eliminate all observations ? If not, can you please tell me what could be the problem? Thank you very

    much in advance.

    Hela
    Last edited by Hela BEJI; 04 Jul 2017, 08:11.

  • #2
    I think perhaps your problem lies in the interaction of your xtset command and lag prefix. If I understand you correctly, you have data for 1995, 2000, 2005, 2010, and 2015.

    Did you
    Code:
    xtset panelid year, delta(5)
    to tell Stata that you have five-year gaps in your time series? That is the recommended approach when the time series gaps are not 1 unit of the time variable, whatever that unit is.

    Having done this xtset, lags will be expressed in terms of the delta, not in terms of the underlying time unit, so L1 is a 5-year (one observation) lag, and L5 is a 25-year (5 observation) lag. Here's an example.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(id year x)
    101 1995 1
    101 2000 2
    101 2005 3
    101 2010 4
    101 2015 5
    end
    xtset id year, delta(5)
    generate xL = L.x
    generate xL5 = L5.x
    Code:
    . list, clean
    
            id   year   x   xL   xL5  
      1.   101   1995   1    .     .  
      2.   101   2000   2    1     .  
      3.   101   2005   3    2     .  
      4.   101   2010   4    3     .  
      5.   101   2015   5    4     .
    So if indeed your xtset included the delta option, your L5 prefixes need to become L1 prefixes.

    Comment


    • #3
      Dear William Lisowski,
      Thank you very much for your precious help. Indeed, now that i entered xtset panelid year, delta(5), thextdpdsys regression runs without any problem.
      Hela

      Comment


      • #4
        Hi,

        I am running system gmm to identify the impact of size of bank, asset, profit and interest margin on non-performing assets. I am using xtabond2 command for the same and getting the same error r(2000). The command is xtabond2 npa l.npa size asset profit interestmargin year*, gmm(l.npa, lag(1 2) collapse) iv(ize asset profit interestmargin year*, equation(level)) nodiffsargan twostep robust orthogonal small.

        Please help.

        Comment


        • #5
          #4 You don't give us any information about your data to comment. The possible problems in general include


          * Something that "should be" numeric is in practice string. (You would, I think, have got a different error message in your case, but this is a reason for r(2000).)

          * Missing values.

          * A mismatch between the time step of your data so that Stata can't find non-missing values when using lags. For example, you might have monthly data given in terms of daily dates such as 1 Jan 2020, 1 Feb 2020, ,,, . Asked to work with the previous value Stata will look for say 31 Dec 2019, 31 Jan 2020, .,,, and fail to find data for them. Stata will have told you about this problem by giving a message about gaps when you typed xtset or tsset.



          Comment


          • #6
            Hi Nick

            I have annual data for 10 years for 45 banks.

            Comment


            • #7
              That is some information but doesn't allow me to say which of #5 applies in your case. As already spelled out I suspect something weird, say although you have annual data, they are tsset or xtset in terms of a monthly or daily date variable, but you don't address this.

              Please back up, read https://www.statalist.org/forums/help#stata and come back with a data example using dataex.

              Comment

              Working...
              X