Hi,
I need to create a variable that is the sum of other values in a row. I normally use newvar=egen(rowtotal var 1 var2....., etc.) for this. However I need newvar to be missing if any one of var 1, var 2, etc. are missing, and rowtotal treats missing as 0. Is there an easy way to solve this problem?
Thanks,
Alyssa
I need to create a variable that is the sum of other values in a row. I normally use newvar=egen(rowtotal var 1 var2....., etc.) for this. However I need newvar to be missing if any one of var 1, var 2, etc. are missing, and rowtotal treats missing as 0. Is there an easy way to solve this problem?
Thanks,
Alyssa
Comment