I am struggling with the "egen - concat" command to join the list of 4 variables into one new variable:
Here is the example:
Code:
clear input id var1 var2 var3 var4 1 . 0.15 . . 2 1.25 . . . 3 . . 2.15 . 4 . . . 0.25 end
Code:
egen var5 = concat(var1 var2 var3 var4)
| id | var1 | var2 | var3 | var4 | var5 |
| 1 | . | .15 | . | . | ..15.. |
| 2 | 1.25 | . | . | . | 1.25... |
| 3 | . | . | 2.15 | . | ..2.15. |
| 4 | . | . | . | .025 | ....025 |
Thank you.
0 Response to Concatenating multiple variables into one variable
Post a Comment