Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: sum up many variables with missing values across columns
From
Daifeng He <[email protected]>
To
[email protected]
Subject
st: sum up many variables with missing values across columns
Date
Mon, 19 Sep 2011 13:59:03 -0400
Hi there,
I am trying to sum up say 100 variables across columns, but many of
the 100 variables have missing values. And I want the sum to be
missing if any of the 100 variables is missing. -rowtotal- does not
work because it treats missing values as 0; even with the option -,
missing-, it generates a missing value only when all the 100 variables
are missing.
Does anybody know how to do this efficiently instead of typing varx+
vary+ var z+... varxx+varyy+varzz? My variables do not have a common
stub in the variable names so I cannot use a loop.
Thanks for the help.
Daifeng
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/