Hi Clyde,
As regards to your post #14, if psic is not always the lowest number among all sic,
e.g. for firm X, psic=3500, and the other segment sic=3100, 3200.
can I stiil use
instead of using
isid gvkey sic gen not_psic = (sic != psic) // 0 FOR PSIC, 1 FOR OTHERS by gvkey (not_psic sic), sort: gen seq = _n-1 // SORT THE PSIC TO THE TOP OF THE LIST drop not_psic
As regards to your post #14, if psic is not always the lowest number among all sic,
e.g. for firm X, psic=3500, and the other segment sic=3100, 3200.
can I stiil use
Code:
// ASSIGN SEQUENCE NUMBERS TO EACH SEGMENT WITHIN A FIRM by gvkey sic, sort: gen int seq = 1 if _n == 1 & sic != psic by gvkey (sic): replace seq = sum(seq)
isid gvkey sic gen not_psic = (sic != psic) // 0 FOR PSIC, 1 FOR OTHERS by gvkey (not_psic sic), sort: gen seq = _n-1 // SORT THE PSIC TO THE TOP OF THE LIST drop not_psic
Comment