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
Vlookup style function of variable from other datasetDear all, I come to you as I face a problem that sounds easy but I have stuck for good. I have two …
Create a variables based on consecutive years of observationDear Stata Users, Please, help me to resolve the following issue. Below is the sample of data that I…
kmatch bandwidthI am running Stata 14.2 on Win 7E. I'm using propensity score matching on some observational data. I…
Group differences of transition frequenciesHi everyone, I am trying to estimate group differences of transition frequencies. I have a unbalance…
Laptop for running stataI am in the market for a new laptop that would allow me to run large datasets in Stata. Is an 8th ge…
Subscribe to:
Post Comments (Atom)
0 Response to generate retirement age
Post a Comment