Dear Stata users,
Please take a look at this problem: I wish to generate a unique identifier for a panel data set. The id is supposed to be composed of values drawn from three existing variables. Therefore I used this code: egen [float] ID = concat(var1 var2 var3)
The result is almost correct. Unfortunately, the new variable ID is created as a string variable, despite the float specification in my code. Moreover, the values all look like this: 6.70e+071020 which makes it impossible to use destring as this format contains non-numeric characters. I have tried other type specifications but none of them work.
Does anyone know how to do in order to get an output that looks like this: 670007181020 ?
Thank you!
Related Posts with egen numeric variable
asdoc + xtdidregress not workingHi Statalists! I wonder if someone else have a problem using asdoc together with the new xtdidregre…
Problem with implementing forward and backward linkages on stataHello, I am currently doing a research on FDI spillovers, at this point i need some help with imple…
Count unique observations by grouping vars if conditions is metHi I want to count the number of unique ID's per year and group. I have managed that with the follo…
Problem to create loopGoodmorning I have a panel data, with severall variables for each countriesin every years. However I…
How to draw 1:2 matched dataset then double the cases?Hello Statalists, Part of my data is as follows: Code: * Example generated by -dataex-. For more i…
Subscribe to:
Post Comments (Atom)
0 Response to egen numeric variable
Post a Comment