Announcement

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

  • Repeated time values within panel when declaring Panel Data

    Hi all,

    I have a panel data on bilateral trade volume of 55 country pairs for 15 years time period (so an unbalanced 15*55*15 matrix).
    So far, I am done with reshaping and trying to declare the panel data before running the regression.

    when I ran the following command:

    egen group = group(countryi countryj)
    su group, meanonly
    xtset group year


    the result revealed
    xtset group year
    repeated time values within panel
    r(451)
    ;


    In an attempt to fix it, I did

    code
    drop if year==year[_n-1]
    xtset group year, yearly


    and I got the panel with weak balanced. Then I ran the regression and got the r2000, no observation.

    I could not figured out how best can I fix it. Any help or guidance would be much appreciated.
    I am happy to provide with more details if needed.

    Cheers,
    Thanh Hao
    Last edited by Hao Thanh; 07 Mar 2020, 00:40.

  • #2
    Hao:
    welcome to this forum.
    If you do not plan to use time series related commands such as lags and leads, you can test-xtset- your data with -panelid- only.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you so much for the suggestion Mr Carlo. Unfortunately, I will be using lagged variables for the later part.

      Comment


      • #4
        Hao:
        the only chance is to build a different -timeid- (eg, monthly), if feasible.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment

        Working...
        X