Hello,
My data doesn't have a unique identifier and I want to generate a unique id of each row of 4 digits (0001, 0002, 0003..... 1114, etc), so I can later merge the ID with other elements such as State Name, (NY0001, NY0002, ... NY1114 etc). I am using _n but only generates a number of length 1.
Thanks,
Tania
Related Posts with Generate unique ID of 4 digits
Change of stationarity when transforming from daily to yearly valuesHi everyone, I have a variable with daily observations that is stationary according to dickey fulle…
Is there an 'or' function when coding variables?I am coding a binary variable (done) to denote if a diagnostic test was done, 1=yes, 0=no. I want i…
Difference between variables' foreach loop regression coefficientsDear STATA users, I am using a foreach loop to regress four models across multiple variables. I nee…
Assigning more weight to a category of a variableDear all, I would like to know your opinion about the following issue: I need to create (starting f…
Comparing 3 correlation coefficientsI have a group of about 1300 patients who had had disease 1 (subgroup 1), disease 2 (subgroup 2), or…
Subscribe to:
Post Comments (Atom)
0 Response to Generate unique ID of 4 digits
Post a Comment