Hello! I have data on the year that employees joined a company, startyear. In order to figure out their tenure, I want to generate a new variable Tenure that is the current year minus the year they started.
I have tried doing:
gen Tenure = 2020 - startyear
However, the results are really funky (For example, it is giving me a max value of 2021) so I don't think that is correct. Am I missing something?
Related Posts with Generating new variable using subtraction
Dynamic Panel Model for Large T and Small N.Hello Everyone, I am working on a problem in which I am assessing the risk of credit default in rel…
Drop missing observations at the end of each groupDear Statalist members, I would like to drop missing observations based on their position in the da…
Substantive differences between "memory" and "size"What is the difference between "Size" and "Memory" in the Properties/Data tab of the main IDE window…
opreg with IfHi Profs and Colleagues, I wonder if there is any difference between these two codes #1 & #2. I…
Interpreting triple interaction term with continuous variableDear stata community, I am struggling with the interpretation of Treated x Post x Log(1+Z) with Z b…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable using subtraction
Post a Comment