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
TempfileI have been trying to merge a file with a tempfile. evertime stata shows "variable HHID does not uni…
predict fit, xbHi, what is the meaning of "predict fit, xb"?: Is it the value of the estimated variable? Thanks!…
Comparing Means Between Two GroupsI would like to compare the means of Group A with those of Group B. How would I see if there is any …
Rename variable in tabHi, I would like to rename my variable just in a tab. I don't want to create a new variable or rena…
Error: Master Data not sorted by applying -glmdose-Dear Statalisters, I am looking for help on -glmdose-. code:mat def tp1=(0/6/12/24/60) glmdose m_…
Subscribe to:
Post Comments (Atom)
0 Response to egen numeric variable
Post a Comment