I have a panel data of companies and their ages and returns for a period of 20 years. as a control for my analyses, I would like to divide the sample into three categories of Old, Medium, and Young in every given date.
I tried :
egen SMB= cut(age),group(3),
however, obviously it doesn't work because the age is changing with time and therefore most of the observations in the later years of the sample will have SMB=3. I was hoping someone could help me with a way to do the same for every given date.
I tried:
by DATE egen SMB= cut(age),group(3)
but "egen cut() may not be combined with by" is the error I receive.
Thanks in advance.
Hamidreza
Related Posts with Problem with creating subgroups based on age variable
Outreg - varlist not allowedHello, I'm a newbie to stata. I'm doing a replication study for my school work, codes are provided a…
Hausman Test in FE and RE linear regression at multiple imputationDear All, I am trying to post estimation for model diagnosis using Hausman Test in FE and RE linear …
First effects vs first differenceHello all, I am running two models with exactly the same variables (a fixed effects and a first dif…
How to create a dbf/gal file from a dta file? (spatmat command)Hello everybody! If I have a gal/dbf file of a contiguity matrix (created through geoda, e.g.), in …
command ifgt is unrecognisedHello All. I was running some microsimulation code and got the error "command ifgt is unrecognised".…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with creating subgroups based on age variable
Post a Comment