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
Which statistics should I use when analyzing the effect of interventions on health outcomes?Dear Stata users, I would like to ask which stats I should use. I have health outcomes data (contin…
Testing for serial correlation in panel analysis with instrumentDear all, Is there an alternative way to test for serial-/autocorrelation in a panel data setting w…
Conducting system GMM using xtabond2Dear Stata users, I am using the System GMM approach for estimation and I want to know whether the …
coefplot and axis labels of different colorsHi all! I am using coefplot to plot predicted probabilities at certain values for 5 model specifica…
How to overcome the word limitation of 12 in Stata output table when using esttab?I remember somewhere that the word limitation for variable name in Stata is 12, and I try with estta…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with creating subgroups based on age variable
Post a Comment