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
Right way to generate a dataset of estimates of treatment effect by year and their CI's as well as the year FEDear all, I want yearly coefficients of treat with their confidence intervals as well as the year f…
Exporting Percentage with asdocHi Attaullah Shah I am using asdoc command in stata it is very useful, and i am thankful for you. …
How to detect data entry error: locating an observation that does not match any of the observations of a given set?Hi Statalist, Apologies for the vagueness of the question as I didn't know how to frame it better. H…
Issue with summing and averaging different columns/variablesHi, I'm fairly new to Stata so I apologize if my question is basic. I am essentially trying to creat…
generalised DID with two-way fixed modelDear researchers, I have unbalanced panel data for a set of firms for the year extends from 2000-201…
Subscribe to:
Post Comments (Atom)
0 Response to egen numeric variable
Post a Comment