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
Event study moving average outside event windowThe following panel data provides information about the firm event PERMCO_ED which is unique. DATE i…
Using loops in MatrixHi all, I am trying to create a composite index on connectivity, by region (e.g. africa, european u…
control row / colum percent display in svy jackknifewhen i do this: svy jackknife, subpop (if charflag==2 & SCHLEV_3CAT==2 & teach_pe_di==2 ): …
-centile command-Dear Stata users, I am wondering, is it possible to generate upper and lower 95% CI of variable V1 …
How to find variable1 that contain words like "apple" or "pear" with keywords typea... and replace them with the text "selected fruit"?Hi all. How to find variable1 that contain words like "apple" or "pear" or "orange" with keywords t…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable using subtraction
Post a Comment