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
spxtregress is arbitrarily dropping regressorsI'm trying to use Stata's built-in commands to estimate a spatial panel model (i.e. I'm using spxtre…
Data perperation (Event data analysis) - please help :)Hi all, I am so stuck with my data preperation before even beginning with the actual analysis and r…
Using categorical independent variables in GSEM builderMy goal is to use and understand GSEM, both the builder and the syntax. I'm doing a path analysis to…
Help with longitudinal mixed modelHi all New to this forum. I'm working on a longitudinal mixed model and wanted to ensure the model …
Estimating models with stochastic volatility using Bayesian techniques involving MCMC. .Hi, I am trying to estimate the following model with a standard deviation that is random. The model …
Subscribe to:
Post Comments (Atom)
0 Response to Problem with creating subgroups based on age variable
Post a Comment