Dear Statalist,

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
And the code i used:
Code:
egen var5 = concat(var1 var2 var3 var4)
The result was:
id var1 var2 var3 var4 var5
1 . .15 . . ..15..
2 1.25 . . . 1.25...
3 . . 2.15 . ..2.15.
4 . . . .025 ....025
Is there anyway i can deal with the missing values, so that it won't appear in the"var5"?

Thank you.