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
Can Inverse probability of censoring weighting (IPCW) approach be applied in stata?Hi all, I wonder if anyone is familar with IPCW model and has revelant example with stata codes to …
Fixed effects in a mlogitHello StataCorp, I want to control for country fixed effects in a mlogit I have tried the followin…
Identify where in variable list a certain value appearsSorry for the basic question. I have a dataset with 100-variable list from v1-v100 with >10k obs…
Changing a string variable with various characters into a numerical (categorical) variableHi! I am fairly new to Stata and looking to organize one of my variables within a dataset. it is a l…
Help to interpret psmatch2 messages and resultsHi, I want to run a regression to compáre yield at issuance of green and non-green bonds. In order t…
Subscribe to:
Post Comments (Atom)
0 Response to egen numeric variable
Post a Comment