Announcement

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

  • Repeated time values in panel data

    Hi all,
    I am trying to run a panel data from 2011 to 2016 for 10 regions of Perú, with 100 observations each region, making up a total of 1000 for each year, 6000 total observations. All the time values are equal, and i missed no spaces there or regions. When i run the Xtset command i receive this response from Stata 14.

    Code:
    . xtset Regiones AÑO
    repeated time values within panel
    r(451);
    
    end of do-file
    
    r(451);
    I don´t really know how to proceed next since I checked the variable year and there is nothing wrong with it, I would like some guidance in this part since this is the first panel data I run that I get this response. Thanks in advance.

  • #2
    The problem is not gaps in your data. That wouldn't be a problem either: Stata can handle unbalanced panel data perfectly fine.

    The problem is that Stata requires exactly one unique observations for each region-year combination. You need to consider if these observations have some other time indication (like a month?), or whether you should take means or sums of you observations for each year. You could do that with collapse.

    Comment


    • #3
      Cesar:
      I would recommend you to check your data via -isid- (see -help isid-).
      Otherwise, if you do not plan to use time-series commands such as leads and lags, you can -xtset- your data with -panelid- only.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Annual data for 6 years and 10 regions would imply 60 observations, so what are the replicates? Giving us a data example might lead to precise advice.

        https://www.statalist.org/forums/help#stata

        ​​​​​​​

        Comment


        • #5
          Originally posted by Jorrit Gosens View Post
          Stata requires exactly one unique observations for each region-year combination. collapse.
          This is something I forgot, shame on me, I didn´t put the data in the correct way.

          Originally posted by Nick Cox View Post
          Annual data for 6 years and 10 regions would imply 60 observations,
          Yeah I can still get the data monthly and make it 72 for periods and with 10 regions making it up to 720.

          Originally posted by Carlo Lazzaro View Post
          Cesar:
          Otherwise, if you do not plan to use time-series commands such as leads and lags, you can -xtset- your data with -panelid- only.
          I didn´t know i could use panel data with only periods, will give it a try too.

          Thanks to all your feedbacks, with the new dataset the panel data is working perfectly fine. I put the 10 regions within the 72 months.

          Comment

          Working...
          X