-viewsource _growtotal.ado- shows that treating missings as 0 is exactly
what -egen, rowtotal()- does.
Nick
[email protected]
David Bell
You have surmised that -egen newvar = rowtotal(var1 var2)- treats
missing values as zero. I do not believe this is strictly correct.
The command just sums the values that it has (thus not using a
variable in a sum is the same as treating it as zero). This is why I
always use -rowmean- instead of -rowtotal-. Thus when there is a
missing value, you get the mean of the remaining values (they are not
treated as zeros).
On May 15, 2008, at 12:31 AM, Yamamoto, Satomi wrote:
> I think egen newvar = rowtotal(var1 var2) is equivalent to
> replacing missing values with 0(zero).
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/