Announcement

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

  • Issue with xtsum output

    Hello,

    I tried to figure out a problem that came up when I used xtsum yesterday to inspect a new panel data set.

    Within variation for var "c_id" should be "0" and it is. But for var "year" the between-variation was not "0" what it should be. There is no value like 2008.5 allowed - only full years. Also my dummy variable for the year 2004 does not look right...

    Do you have an explanation for that? Also T-bar looks awkward. I analyse a 8 year period. I already visually inspected the data and checked for any year values that might not be integers, but maybe there is another way to check for those deviations?

    Thank you!

    Stata 11.2

    Code:
    sort c_id year
    xtset c_id year
    xtsum c_id year dummy04
    
    Variable         |      Mean   Std. Dev.       Min        Max |    Observations
    -----------------+--------------------------------------------+----------------
    c_id     overall |  1319.154   1049.926          1       4611 |     N =   64340
             between |             1048.901          1       4611 |     n =    4611
             within  |                    0   1819.384   1819.384 | T-bar = 6.67492
                     |                                            |
    year     overall |  2007.994   2.026894       2004       2011 |     N =   64340
             between |             .4408717     2006.5     2008.5 |     n =    4611
             within  |              1.97871   2004.137   2011.851 | T-bar = 6.67492
                     |                                            |
    dummy04  overall |  .0438763    .204824          0          1 |     N =   64340
             between |             .0592206          0         .2 |     n =    4611
             within  |             .1954326  -.1561237   .9188763 | T-bar = 6.67492

  • #2
    Is there necessarily a problem with my dataset / year values or did I use the the xtsum command wrong?
    Appreciate your help

    Comment


    • #3
      Clearly it's axiomatic that an identifier is constant within panels. You can expect year to show no variability between if your dataset is balanced, and occasionally otherwise, but variation in year between is diagnostic of an unbalanced panel. 2006.5 is the lowest mean year in your case: you should expect mean year to be something.5 if the number of years is even and all years are present, and sometimes otherwise. This can be seen from an example of a two-year panel for 2013 and 2014 in which case the mean year for any panel with both years present must be 2013.5.

      Try experiment in a sandbox:

      Code:
      webuse grunfeld
      xtsum
      drop in 5/10
      xtsum
      After dropping a few observations balance is lost and the report for year changes.

      Comment


      • #4
        Thank you a lot for your answer. Yes, it is an unbalanced panel, so your explanation makes perfect sense.

        Comment


        • #5
          please anyone here tell me how i calculate within min and max value in panel data.
          Last edited by Shahla Akram; 08 Dec 2018, 02:48.

          Comment

          Working...
          X