Announcement

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

  • Panel data: classifying cohorts based on age

    Hello everybody,

    I'm quite new to stata and am currently using it (or trying to use it) for my master thesis. I am quite a bit desperate right now and would really appreciate every help a lot!

    My problem: I have panel data of U.S. banks from 2003-2017 including their age (years of existence). I study how the banks evolve over time as they get older, thus move from being a 'new entrants' in the banking sector (which I btw define as the first 8 years of a banks' existence) to becoming an incumbent (from the 9th year of their existence onwards).
    The tricky thing is, that every year new banks enter. I want to categorize those banks for the first 8 years of their existence as new entrants and from the 9th year onwards as incumbents. Thus one and the same bank should be classified for a couple of years as a new entrant and later as an incumbent.

    The table below displays in green the observations (banks) I want to group to the 'new entrant cohort' and in red the ones, I want to classify as incumbents.


    For the incumbents' classification I run the following code: gen incumbents =1 if year >= 2012 & n1 >= 9

    For new entrants, I am somewhat lost. For 2014, I would set up the code like this: gen newentrants2004 = 1 if year ==2004 & n1 == 1

    ...but then for 2005, I would need to include banks being 1 or 2 years old, for 2006 those being 1, 2, 3 years old.

    Anyone who knows how to do this properly?

    Thanks a lot!

    Julia

    Attached Files
    Last edited by Jules Guenther; 14 May 2018, 10:40.

  • #2
    Jules:
    welcome to this forum.
    As per FAQ, please do not post screenshots (often unredable, pretty always unuseful), but share with interested listers an example/excerpt of your data via -dataex- and/or post what you typed and what Stata gave you back via CODE delimiters. Thanks.
    That said, if your goal is to investigate how your banks evolve as time goes by, you may probably use -xtreg, fe- (or -xtreg, re-) without any need to classify them as you're trying to do.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      If you set up xtset, you can generate almost any such classification scheme with complex if conditions. A bank that doesn't exist in a given year will have missing for that year.

      Comment

      Working...
      X