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
Out of sample tests with conditional logistic regressionHi all, This might be really simple question about out of sample tests, but still I couldn't find a…
Generating KM curves in stratified analysis with time varying covariateI am trying to generate KM curves in a survival analysis that is stratified by matched pairs and als…
removing 95%CI and renaming axis by intervalsHere is my code for prevalence vs month: logit mrsp i.month margins month, plot(ytitle(Prevalence) …
Understanding interactions using -clogit_I have a 1:4 matched dataset. One case (a brain tumor that responded to an experimental treatment) m…
ESTIMATE Workshop at Michigan State in early JuneHi All: I'm not sure about the proper protocol when advertising workshops on Statalist. I suspect s…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable using subtraction
Post a Comment