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
cnsreg using i.variables produces different results from self generated dummiesI have a dependent variable y, and the regressors are age, year and cohort (birth year). birth year …
alternative for clustered standard errors when having too few clustersHey everyone, I have observations on management scores from firms which are nested in countries. Th…
Panel data logistic regression (xtlogit): Choosing between fixed effects and random effectsHI Helpful List, I have panel data on ~2000 companies between 2005 and 2010. Of these 2000 companie…
Getting rid of na observablesHi, How do I get rid of na and scotsup,ms observables please? Array …
Recode helpHi, I am trying to get three variables only i.e. England, Wales and Scotland. I want to recode 'n…
Subscribe to:
Post Comments (Atom)
0 Response to generate retirement age
Post a Comment