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
Interpretation of coefficients with interaction term with odds ratios (logit regression)Hi, I want to clarify the interpretation the effect of a variable when an interaction term is includ…
Recoding a variable with data from another variableHi, Can somebody please advise me on the most straightforward way to recode a variable with data fro…
Diff-in-Diff estimator collinearity issueHi all, I am researching the causality of the plain package on the proportion of smokers with Diff-i…
stata shell pdftk on macHi Statalist, I don't know enough to be sure, but please let me know if this isn't the right place …
Creating identifier variable equal to one for all the observations from the same personDear all, I am working with panel data from a national survey. People interlude in the waves have a…
Subscribe to:
Post Comments (Atom)
0 Response to generate retirement age
Post a Comment