Announcement

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

  • Unbalanced panel descriptives

    Hi,
    I am interested in better understanding how to get useful descriptive statistics for my unbalanced panel with Stata 13. I have panel data with abourt 13.000 observations and about 4000 objects over 12 years. I would like to know:
    1. the number of consecutive observations per object
    2. the average number of consective observations
    3. the longest spell / best spell to use
    I was told that
    Code:
    tsspell
    could help me out. But I can't find it on the SSC... Is there any other way to get a hold of this information?

    I am relatively new to Stata (I am used to R) and I am sure this is a very beginners question. But I can't get a hold of it.

    Thank you very much
    /R
    Last edited by Rachel Sleeps; 21 Jul 2015, 00:36.

  • #2
    Typing
    Code:
    search tsspell
    in Stata brings up a Viewer window that contains a hyperlink to it on SSC. The hyperlink is
    Code:
    net describe tsspell, from(http://fmwww.bc.edu/RePEc/bocode/t)
    and so you could copy and paste that into your Stata command line to go directly there.

    Comment


    • #3
      Thanks! It worked now with net install! But, does tsspell help me obtaining the information I seek?

      Comment


      • #4
        Did you read the help?

        Code:
         
        ssc inst tsspell 
        help tsspell
        1. Spells of consecutive observations: This is an example in the help.

        2. The average number of consecutive observations. You need to be precise here. This panel contains 5 consecutive observations by one definition, as there are 2 spells that contain consecutive observations. Do you mean of the longest spell?

        Code:
         
        id     time 
        42     1
        42     2
        42     3
        42     11
        42     12
        3a. Longest spell. This follows immediately from a close reading of the help. The length of the longest spell for each panel is

        Code:
         
        egen length_longest = max(_seq), by(id)
        The longest spell itself is identifiable by

        Code:
         
        bysort id (_seq) : gen which_longest = _spell
        except that you need a rule for dealing with ties.


        3b, Best spell. Not defined.

        See also http://www.stata-journal.com/sjpdf.h...iclenum=dm0029 for a discussion of principles.

        Comment


        • #5
          Perfect! Thank you. The help function is great, really. Now I know better and will check it first!

          Comment

          Working...
          X