Announcement

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

  • removing 2-digit sic-codes with <10 companies

    Hi there,

    I am trying to remove 2-digit sic codes for which my dataset has less than 10 companies.
    I have made a numerical variable of the first two digits of the sic code:
    gen sic2 = substr(sic,1,2)
    destring sic2, gen(sicnum2)

    Does someone know what type of command I should put based on number of companies conditional? Note that I have data for various years per company.

    Hope someone can help out.

    Kind regards,
    Sarah

  • #2
    Code:
    egen fob= tag(company)
    bys sic2: egen count=total(fob)
    drop if count<10

    Comment

    Working...
    X