Hello, I would like to create a variable that concatenate the names of other variables(even better the labels of the variable) by group.
So with the example below I would like to get a new variable x equal to "osal" for id 58, to "osal osat" for id 59, "osam" for id 60, "osal osat osam" for id 21 and "osal osam" for id 22.
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Thank you for any help!
So with the example below I would like to get a new variable x equal to "osal" for id 58, to "osal osat" for id 59, "osam" for id 60, "osal osat osam" for id 21 and "osal osam" for id 22.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long id float(osal osat osam) 58 1 0 0 58 1 0 0 58 1 0 0 59 1 0 0 59 1 1 0 60 0 0 1 21 0 1 1 21 0 0 1 21 1 0 1 22 1 0 1 22 0 0 0 end
Thank you for any help!
Comment