LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 20 Feb 2009 10:12:04 -0600
Reply-To:   aldi@wustl.edu
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Aldi Kraja <aldi@WUSTL.EDU>
Subject:   Re: Missing values
Comments:   To: Paolo ORIFICI <Orifici@LACAJA.COM.AR>
In-Reply-To:   <499EB3C6.D49B.00EB.0@lacaja.com.ar>
Content-Type:   text/plain; charset=ISO-8859-1; format=flowed

That is simple Paolo in SAS:

sum(of va1,var2,va3,...,varN); SAS will consider the sum of the real values and leave out any missing.

Aldi

Paolo ORIFICI wrote: > I agree that recoding missing values to zero is a bad idea and destroys > information, as Gerhard wrote. > > But how could I sum up across variables with missing values without > taking into account missing values, so that the result itself is not a > missing value? > > Thanks for your help, > > Paolo > > > >>>> Chang Chung <chang_y_chung@HOTMAIL.COM> 20/02/2009 12:18 pm >>> >>>> > On Fri, 20 Feb 2009 13:04:19 -0300, Paolo ORIFICI > <Orifici@LACAJA.COM.AR> > wrote: > ... > >> I think you can try something like this too >> >> well you can use _numeric_ = . then _numeric_ = 0, >> > ... > hi, > _numeric_, _character_, and _all_ are called "special sas name lists". > They > are, by definition, "lists" of variables. You cannot assign a value to > them > as Paolo suggests. You can, however, use them to define an array. here > is > one way. hth. > cheers, > chang > > data one; > a = 1; > b = 0; > c = "x"; > d = .; > put (_all_) (=); > /* recode missing in all numeric vars to 0. */ > /* which i think is a bad idea, but, i guess, */ > /* you^ve got to do what you^ve got to do. :-) */ > array n _numeric_; > do over n; n = ifn(missing(n), 0, n); end; > put (_all_) (=); > run; > /* on log > a=1 b=0 c=x d=. > a=1 b=0 c=x d=0 > */ > > AVISO DE CONFIDENCIALIDAD > Este e-mail es privado y confidencial y est? dirigido ?nicamente a su destinatario. Si Ud. no es el destinatario original de este mensaje y por este medio pudo acceder al mismo o recibe este e-mail por error, por favor no lo lea y responda a este mensaje inmediatamente, informando al emisor que ha sido erroneamente dirigido y luego, eliminelo de su sistema. Si Ud. no es el destinatario del mensaje, tenga en cuenta que esta prohibida cualquier divulgaci?n, copia, reproducci?n, publicaci?n, distribuci?n o uso de su contenido > > Muchas gracias. > > > CONFIDENTIALITY STATEMENT. > This is a private and confidential e-mail and is only addressed to its recipient. If you are not the original recipient of this message and you were still able to access it by these means, or you have received this e-mail by mistake, please do not read it and reply to this e-mail immediately, notifying the sender of the mistake, and then delete it from your system. If you are not the recipient of the message, be advised that any disclosure, copy, reproduction, publication, distribution or use of its content is forbidden. > Thank you >

--


Back to: Top of message | Previous page | Main SAS-L page