Announcement

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

  • Drop observations if not meeting frequency criterium

    My dataset consists of time-series observation of US firms with identifiers like gvkey, cusip and a construct variable cusip_fiscalyear. I use data between 1995 and 2005, but need to drop all observations of a particular firm if the observations are less than 8 years, that is if for instance gvkey appears 8 times or less. I suppose I need to generate a kind of frequency variable? And I suppose I can use any one of the three identifiers.
    Last edited by NORMAN DAVELAAR; 29 May 2022, 01:27.

  • #2
    if the data are without gaps,
    Code:
    bysort gvkey: drop if _N<8

    Comment


    • #3
      FWIW, the plural criteria is of Greek origin and its singular is criterion.


      A criterium is a kind of cycle race.https://www.merriam-webster.com/dict...rmal%20traffic I didn't know this until I just looked it up.

      Comment


      • #4
        I already found the solution using the bysort command

        Comment


        • #5
          Thx Mr. Snilsberg

          Comment


          • #6
            ....and Mr. Cox for correction of word usage.

            Comment

            Working...
            X