Nuno,
for your special case you could try to use -mvencode- :
mvencode var1 var2 var3, mv(0)
will replace all missing values in var1, var2, var3 by 0. See also
-help mvencode-
A more general approach would be to use recode, see -help recode-
hth
Sebastian
On 2/6/07, Nuno <[email protected]> wrote:
Hi everyone,
I need to replace missing values by 0 for a set of about 30 variables which
are not sequencially ordered and have very different names. I'm using the
-rename- command for each variable, but this becomes a bit cumbersome and
might contain errors given the number of the variables. Plus, I'll need to
redo the same thing for other datasets. Does anyone know a way of
facilitating this task? I was wondering if -inlist- would be suitable to do
this, as it would only be necessary to define the variables once( something
like replace inlist(arlist)=0 if inlist(varlist)==.).
All the best.
*
* 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/
*
* 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/