Announcement

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

  • xtset with very large data set - repeated time values within panel

    Hello there,

    I am working on a semiparameteric estimator for panel data. I wanted to examine the performance of the estimator by drawing samples from a very large population. Surprisingly (at least to me), xtset fails to generate large psudo panel data when the panel is very large. Here is a simple example:

    Code:
    clear
    set obs 1200000
    gen int cid = _n
    expand 20
    bysort cid: gen t = _n
    xtset cid t
    
    repeated time values within panel
    r(451);
    I tried for smaller panels (I checked upto around 120,000) and it works.

    I would appreciate if you can help me solve this problem.

    Best,
    Dani


  • #2
    Code:
    gen double cid = _n

    Comment


    • #3
      To extend Oyvind Snilsberg comment: the storage type integer can only take a maximum of 32740 and you try to create ids for up to 1.2 million (i.e. the highest value of the unit identifier is 1.2 million).

      Interestingly on my Stata 17 your code runs without the error message.

      Comment

      Working...
      X