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 (June 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Jun 2006 16:22:03 -0400
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:      Re: Filling of missing observations correctly in a dataset

I cannot remember whether David, before he went away, delegated responsibility for telling people not to use arbitrary numeric values to represent missing-value situations. So I'll jump in ...

Don't use arbitrary numeric values to represent missing-value situations. It's all too easy to later run stats and forget to filter out such phony cases. Garbage ensues.

The practice is common in environments which do not support missing value indicators. SAS is not such an environment. In fact it supports 27 different special missing values in addition to the generic MV, so qualitiative differentiations can be recorded.

Venky reponse in this thread illustrates usage of the feature.

On Mon, 19 Jun 2006 08:26:13 -0700, Matt <mshall2@GMAIL.COM> wrote:

>I guess I'm not really sure why you would want to do this. If it is >simply a matter of 'presenting' the data, I would, honestly do that in >excel of another spreadsheet program. >You would have to convert all your vars to character and then simply >make an if-then to change . to NA/WD. I think you would be better off >doing something like: > >array hr(5) Hr_4 Hr_8 Hr_12 Hr_24 Hr_36; >do i=1 to 5; > if Adm eq . then do; > Adm = 98; /*where 98 eq WD*/ > do j=i to 5; > hr(j) = 99; /*where 99 eq NA*/ > end; > end; > if Adm ne . AND hr[i] eq . then do; > hr[i] = 98; > do j=i to 5; > hr[j] = 99; > end; > end; >end; > > > > > >Madan Gopal Kundu wrote: >> Hi all, >> >> =0D >> >> I have following dataset: >> >> =0D >> >> Pt Adm Pre Hr_4 Hr_8 Hr_12 Hr_24 Hr_36 >> >> 4 36.9 36.5 36.4 37.2 36.2 36.4 37.1 >> >> 5 36.3 . . . . . . >> >> 6 36.8 36.9 36.9 37 36.7 37.2 36.8 >> >> 7 36.6 36.4 36.6 36.7 36.8 36.7 36.8 >> >> 8 36.4 36.6 36.6 36.2 . . . >> >> 10 36.5 35.9 36.2 36.4 36 35.8 36.3 >> >> 11 36.8 35.8 36.6 . . . . >> >> 12 36.4 36.1 36.4 36.8 36.3 36.2 36.6 >> >> 13 36.6 36.2 36.3 36.5 36.4 36.3 36.6 >> >> 14 36.5 36.8 37 37 36.6 36.8 36.8 >> >> 15 36.3 . . . . . . >> >> =0D >> >> Now I have to fill the missing values in the above dataset smartly. I >> have to report the above data in the following way: >> >> =0D >> >> 4 36.9 36.5 36.4 37.2 36.2 36.4 37.1 >> >> 5 36.3 WD N/A N/A N/A N/A N/A >> >> 6 36.8 36.9 36.9 37 36.7 37.2 36.8 >> >> 7 36.6 36.4 36.6 36.7 36.8 36.7 36.8 >> >> 8 36.4 36.6 36.6 36.2 WD N/A N/A >> >> 10 36.5 35.9 36.2 36.4 36 35.8 36.3 >> >> 11 36.8 35.8 36.6 WD N/A N/A N/A =0D >> >> 12 36.4 36.1 36.4 36.8 36.3 36.2 36.6 >> >> 13 36.6 36.2 36.3 36.5 36.4 36.3 36.6 >> >> 14 36.5 36.8 37 37 36.6 36.8 36.8 >> >> 15 36.3 WD N/A N/A N/A N/A N/A >> >> =0D >> >> Here WD =3D Withdrawn, N/A =3D Not available >> >> Can anybody please help me by providing code of this conversion? >> >> Looking forwards for getting reply.=0D >> >> Thanks and Regards, >> >> Madan Gopal Kundu >> >> =0D >> >> >> >> (i) The information contained in this e-mail message is intended only for= >> the confidential use of the recipient(s) named above. This message is= >> privileged and confidential. If the reader of this message is not the= >> intended recipient or an agent responsible for delivering it to the= >> intended recipient, you are hereby notified that you have received this= >> document in error and that any review, dissemination, distribution, or= >> copying of this message is strictly prohibited. If you have received this= >> communication in error, please notify us immediately by e-mail, and delete= >> the original message.=0D >> =0D >> >> (ii) The sender confirms that Ranbaxy shall not be responsible if this= >> email message is used for any indecent, unsolicited or illegal purposes,= >> which are in violation of any existing laws and the same shall solely be= >> the responsibility of the sender and that Ranbaxy shall at all times be= >> indemnified of any civil and/ or criminal liabilities or consequences= >> there.


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