Announcement

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

  • "Un-panelling" of a dataset

    Hi,

    To tell stata you're dealing with a panel data set you use the command 'xtset'.
    I've saved the stata file after using this command, so my stata dataset is set as panel set.
    Is there a way, however, to return to the original dataset before the 'xtset' command was used, i.e. undo the command?

    Kind regards,

    Joeri

  • #2
    See the help for xtset where

    Code:
    xtset, clear
    is documented. I can't imagine any good reason for doing this!

    Comment


    • #3
      Hi Joeri
      I think you are thinking of: xtset, clear
      This clears the previously set panel information. Nothing will change in your data, but if there is any command that depends on "xt" commands, they will start asking you again to set up the panel information.
      Fernando

      Comment


      • #4
        Thank you!

        Additionally, do you know why I get this error when sime-setting my data:


        . tsset Year
        repeated time values in sample
        r(451);


        Regards

        Comment


        • #5
          At a guess, there are repeated time values in your sample. You can't take any panel data that has two or more panels and a time variable and then pretend it's just time series data

          Why do you want to do this?

          Comment


          • #6
            Helped by your replies, I understand why it doesn't work for my dataset and also why I shouldn't want it in the first place.

            I am trying to find a way to test for autocorrelation in my dataset, since the Wooldridge test doesn't work in the situation of only 2 time periods.

            But, I think I will have to consider testing for autocorrelation in my dataset not possible in any way.

            Thank you for the help!

            Comment


            • #7
              Hi Joeri,
              I may be wrong, but, I do not think you can test for autocorrelation when you only have 2 years per panel. I would say that is like trying to detect a trend when you only observe two periods of time. Yes, you can say is something is growing or not, but you cant really assess if that is a trend, or just some random noise.
              Perhaps you can search for literature regarding to when is autocorrelation a problem in panel data settings. My best guess is that it will be a problem when you have long time series.
              HTH
              Fernando

              Comment


              • #8
                FernandoRios Thank you for your reply. I agree, and since the Wooldridge test also gives me an error when testing with only 2 time-periods, I think this is the case even more. Do you happen to know where I can find literary support for this perhaps? I tried to find it in:

                Drukker, D. M. (2003). Testing for serial correlation in linear panel-data models. The stata journal, 3(2), 168-177.

                But I couldn't find it in here.

                Kind regards,

                Joeri

                Comment


                • #9
                  Joeri: Fernando is correct. When one is removing the fixed effects via differencing, there is nothing to test with T = 2. The FD estimator is a cross-sectional OLS regression on the differences. There is nothing to test and therefore the test returns nothing.

                  Now, if your hope was to use the T = 2 periods in pooled OLS then you can test for serial correlation. But why bother? Just cluster your standard errors.

                  Comment

                  Working...
                  X