COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Re: New Comparison Operators? - WAS: missing numerical values = - #3 132355

• Email
• Follow

```In my (fairly extensive) experience the variance in the quality of code
produced by statisticians is quite high. :-)

Jonathan

On Mon, 4 Jan 2010 17:27:47 -0500, oloolo <dynamicpanel@YAHOO.COM> wrote:

>OT: why so many ppl claim that statisticians are bad SAS programmers? What
>are their sample sizes? After all, SAS was written by Statisticians, LOL
>
>On Mon, 4 Jan 2010 17:07:59 -0500, Jonathan Goldberg
><jgoldberg@BIOMEDSYS.COM> wrote:
>
>>I gave an (and who knows, maybe the) explanation in a post on the old
>>thread before I noticed this new one.  For ease of reference, here it is
>>again.
>>---------------------------------------
>>This is a hoary question.  Logically speaking, having x < 2500 resolve to
>>true when x is missing is absurd, and having x = y resolve to true when
>>both x and y are missing is ludicrous.  Missing means "I don't know."  If
>>x and y are heights, you are claiming that you know that two heights are
>>equal when you don't know what either of them is.
>>
>>It's done that way to spare unsophisticated programmers (such as
>>statisticians :-)) from having to deal with three-valued logic.  That is,
>>logical operators can return three values: true, false, and null.  In
>>three valued logic the only operation that can return true or false when
>>dealing with a null value is "is null."
>>
```
 0
Reply jgoldberg (119) 1/6/2010 6:24:33 PM

See related articles to this posting

0 Replies
149 Views

Similar Articles

12/13/2013 11:47:03 AM
page loaded in 39920 ms. (0)

Similar Artilces:

Re: New Comparison Operators? - WAS: missing numerical values =
OT: why so many ppl claim that statisticians are bad SAS programmers? What are their sample sizes? After all, SAS was written by Statisticians, LOL On Mon, 4 Jan 2010 17:07:59 -0500, Jonathan Goldberg <jgoldberg@BIOMEDSYS.COM> wrote: >I gave an (and who knows, maybe the) explanation in a post on the old >thread before I noticed this new one. For ease of reference, here it is >again. >--------------------------------------- >This is a hoary question. Logically speaking, having x < 2500 resolve to >true when x is missing is absurd, and having x = y resol...

Re: New Comparison Operators? - WAS: missing numerical values =
>"Jonathan Goldberg" wrote >> This is a hoary question. Logically speaking, having x < 2500 resolve to >> true when x is missing is absurd, and having x = y resolve to true when >> both x and y are missing is ludicrous. Missing means "I don't know." If >> x and y are heights, you are claiming that you know that two heights are >> equal when you don't know what either of them is. > Lou replied >At the risk of seeming the fool, I've always thought of it as: > >if X = "I don't know" and ...

Re: missing numerical values =
> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Feyerharm, Robert W. > Sent: Wednesday, December 23, 2009 3:34 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: missing numerical values = - infinity? > > Here's what I get if I assign "NA" to A, then attempt to evaluate the > statement "if A<2500 or A>=2500 then z=1": > > > A<-NA > > if(A<2500 | A>=2500)z<-1 > Error in if (A < 2500 | A >= 2500) z <- 1 : > missing value where TRUE/FA...

Re: Numerical missing values #5 665974
Karovaldas: Try this: proc format; value cnv_mss 991 =.a 992 =.b 993 =.c 994 =.d 995 =.e 999 =.f; run; data test; input x 3.; x1=put(x,cnv_mss.); cards; 991 992 993 994 995 999 ; run; proc print; run; HTH Kumar -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Karovaldas Sent: Wednesday, May 10, 2006 3:18 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Numerical missing values I like the idea of a permanent format. I'd like to retain the information that is coded with missing values so I t...

Re: missing numerical values =
"Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU> wrote >OK, so far two languages mentioned in this thread >(e.g. R and Oracle) return NA ("missing" or "null") >from a comparison such as X=NA (or X=null). > >Out of curiosity, does this mean that such languages >do not provide more than one distinct missing value? > I am pretty sure this is so fro R >My initial guess is they don't, since I don't see >how a language would support a test of whether two >variables have different missing values, if it >doesn&...

Re: missing numerical values =
Speaking from the field of education (who use Census-acquired survey data much of the time :-) ), having specific values for various missings allows you to easily select specific sub-populations, without having additional flags to mark the records. Does it add overhead? Absolutely! Is it difficult to track over time, especially if it's a periodic survey? Most certainly! Could you add the sub-population selection logic to your code? Yes--but then it exists only in your code--not in the data itself. Multiple values for missing may also be used in imputation, to identify the so...

Re: missing numerical values =
This is a hoary question. Logically speaking, having x < 2500 resolve to true when x is missing is absurd, and having x = y resolve to true when both x and y are missing is ludicrous. Missing means "I don't know." If x and y are heights, you are claiming that you know that two heights are equal when you don't know what either of them is. It's done that way to spare unsophisticated programmers (such as statisticians :-)) from having to deal with three-valued logic. That is, logical operators can return three values: true, false, and null. In three valued ...

Re: missing numerical values =
> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Keintz, H. Mark > Sent: Monday, December 28, 2009 8:13 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: missing numerical values = - infinity? > > OK, so far two languages mentioned in this thread > (e.g. R and Oracle) return NA ("missing" or "null") > from a comparison such as X=NA (or X=null). > > Out of curiosity, does this mean that such languages > do not provide more than one distinct missing value? > > My initi...

Re: missing numerical values =
Dale McLerran <stringplayer_2@YAHOO.COM> wrote >Peter, > >I don't like creating additional variables to contain information >about the missing values. It increases file size and complexity. >I much prefer having the information about different kinds of >missing values coded directly with the variable when the response >is missing. > >Dale > I can see the point of that. I guess it's partly a matter of taste, partly what you are used to doing, and partly a question of how often you need these different missing values Peter Peter ...

Re: missing numerical values =
That certainly makes sense (as does Diane's similar response) but couldn't you do the same with a single missing value, and then a separate variable on reason for missing? This latter might be coded in the data step, based on previous questions. I've just been bitten by that missing value problem too many times. Not so much in simple things like crosstabs, but in data step manipulations, where it can be a little more subtle or hidden. Peter -----Original Message----- >From: Dale McLerran <stringplayer_2@YAHOO.COM> >Sent: Dec 29, 2009 10:01 AM >To: SAS-L...

Re: missing numerical values =
On Tue, 29 Dec 2009 08:53:33 -0500, Peter Flom <peterflomconsulting@MINDSPRING.COM> wrote: >In 15 years using SAS, I've yet to use this multiple missing values feature. What do people use it >for? > It's often used in survey data. For example, on a survey I worked on a few years back, we used -1, -7, -8, and -9 for missing values of question was skipped, refused to answer, don't know, and no answer. This could be represented by SAS missing values such as .S, .R, .D, .N I really pushed to convert these to missing as often it was overlooked and ended...

Re: printing missing numerical values w/o output in v9.1 vs. 9.2?
Unfortunately, you don't seem to be missing anything. I get similar results. I suppose on technical grounds you could justify the 9.2 behavior, since the MISSING= system option implies that "a character" will be printed to represent the missing value. According to my limited experimentation, there is no difference between MISSING='' and MISSING=' ' (i.e. whether or not there is a blank between the quotes). As a practical matter, however, in this kind of situation with DSD output, one would certainly prefer not to have the unnecessary blanks in the output file....

Re: proc format value assignment oddity
Paul: An 'empty' character value ('') does not appear to have any meaning in = PROC FORMAT (MSW SAS, V9.13). This program demonstrates that: proc format; value \$miss ' ' =3D 'missing' '00'x =3D 'null '=20 other =3D 'notMiss' ; run; quit; data test; length x \$ 10; x=3D''; output; x=3D' '; output; x=3D'00'x; output; x=3D'z'; output; run; proc freq data=3Dtest; tables x/missing; format x \$miss. ; run; quit; It does not seem to matter how many blanks one uses to make a missing = character...

Re: Find numeric value in xml file, recalculate, and replace old value
On April 14, Mackan wrote > Say i have a tag in the xml source file that is: > <myval="45">, i wan't to recalculate 45 by multiplying it > with 2 and replace 45 in the above tag with the sum (90) > as: <myval="90"> while saving it over to a new xml-file. > > I manage to replace the original value with a predefined > value using 'sed s/myval="45"/myval="90"/', but i wan't to > recalculate it on the fly cause next file might have a > other value than 45 and here's where i'm stuck. I know > i...

Re: Missing values #35
I think that "Options Missing 0" represents missing as zero but in my case I need to actually replace missing by zero. Indeed, using _numeric_ I got what I wanted. Many Thanks >>> SAS_learner <proccontents@GMAIL.COM> 20/02/2009 11:46 am >>> Try something like Options Missing 0 ; But Do you really want to do that . I think you can try something like this too well you can use _numeric_ = . then _numeric_ = 0, Let me know if that Options Missing 0 ; works never tried myself On Fri, Feb 20, 2009 at 10:40 AM, Paolo ORIFICI <Orifici@lacaja.com.ar>wr...

Re: Missing values #20
fkhurshed@HOTMAIL.COM replied: > >On Apr 19, 10:13 am, mkek...@YAHOO.CO.UK (Marina Kekrou) wrote: > > I have a sample including approximately 1,500 firm-year observations. > > Although the sample was much larger there were a lot of missing > > observations. Except from deleting missing observations, what other > > strategies have users found useful? > > > > I would appreciate any ideas or feedback on this. > >Some obvious ones, fill in with the average or median value. If it's >a time series, possibly interpolate for that point with regre...

Re: Missing Values and zeroes
Try value3 = sum ( value1, value2 ) ; instead of value3 = value1 + value2; On Tue, 5 Oct 2004 22:37:47 -0400, Michael Tuchman <mftuchman@YAHOO.COM> wrote: >Can anybody explain the rationale for this? Apparently, options missing=0 >does not replace missing values with 0, it merely *displays* them as 0. >This causes the following interesting bit of code to function as it does. >data d1; > infile datalines; > input key \$ value1; >datalines; >a 50 >b 70 >; > >data d2; > infile datalines; > input key \$ value2; >datalines; >a 50...

missing numerical values =
Going into rant mode... I discovered a feature of SAS that I wish I had known earlier: SAS will assign a value of *negative infinity* to missing numerical values in logical statements. So in the following code: if birth_weight<2500 then low_birth_weight=1; else if birth_weight>=2500 then low_birth_weight=0; SAS will assign all missing values (birth_weight=.) to the category low_birth_weight=1, since negative infinity is less than 2500. Why SAS programmers settled on this convention I don't know. Wouldn't it make more sense if birth_weight=., then low_birth_weight...

Re: retaining new value.... #2
Hi, The RETAIN statement holds its value across observations. The X+Y syntax is a shortcut that RETAINed variables can do which is the same as X=X+Y. data a; input id sal; cards; 1 5 2 10 3 20 4 20 ; run; data result; set a; retain new_var .; new_var + sal; run; Hope this is helpful. Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell Investments Russell Investments Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Madhu G Sent: Tuesday, April ...

Re: trying to eliminate missing values
If you are always dealing with positive values, this works nicely w/o IF..THEN..ELSE: PCT2000_KTHRU12 =3D MAX(0, ( city_KTRHU12 / CITY_TOTALPOPULATION ) ); Cheers, john -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of David Fickbohm Sent: Monday, July 25, 2005 4:51 PM To: SAS-L@LISTSERV.UGA.EDU Subject: trying to eliminate missing values People, I am trying to eliminate missing value due to dividing my zero. Can someone please point me in the right direction? IF CITY_TOTALPOPULATION =3D 0 THEN PCT2000_KTHRU12 =3D 0; else;PCT2000_KTHRU12 =3D...