Hey all,
I am using panel data and have a full population dataset. I can observe an individuel over time, their age and their retirement status (dummy variable). I would like to generate a variable over their retirement age by ID.
I tried the following code:
by ID_nr: gen retirement_age = age if retirement == 1
by ID_nr: replace retirement_age = min(retirement_age)
However, it does unfortunately not work.
Can anyone help?
Thank you in advance!
Related Posts with generate retirement age
Terrible parallelization performance in MataI just ran an example from the SJ paper about boottest ("Fast and Wild") and was surprised at its po…
Testing for significant differences between the betas of two FE model specifications without using an interaction termGood morning all, I am using 2-wave panel data and a standard fixed effects model to estimate the m…
Specific Values of Variables and creating a new VariableHello, I am trying to takes 3 variables and take a specific value from that variable, and create a …
cluster 2 varlist not allowedHi, I'm replicating a report, and this is the attached do-file use wintertime_final, clear gen snod…
how to count numbers of households expose to a specific shock?Dear all, I need your help in the following issue in coding my data. I have a data set for a year …
Subscribe to:
Post Comments (Atom)
0 Response to generate retirement age
Post a Comment