- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have a SAS dataset where I see a letter "I" (Capital i) in numeric column. What does it mean?
I don't understand as it is a numeric variable and it should not contain this unless it means something else. I tried to add/subtract a number to it and it returned "." (null).
See below picture:
Here, "Factor" variable in 2nd row has letter "I" as Highlighted. The 3rd variable "db" is same as "factor" but with no format applied.
Table properties:
Compressed: CHAR
Encoding: wlatin1 Western (windows)
SAS version: 9.4m5
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @kumarayas,
While programmers are free to use special missing values such as .I for arbitrary purposes, there are contexts in which .I has a special meaning: infinity. For example, the DIVIDE function and PROC TTEST produce this particular special missing value with the meaning "infinity" in certain situations (see code examples below). But even then it's still a missing value and recognized as such, e.g., by functions like MISSING, NMISS or CMISS.
/* Example 1 (Result: x=.I) */
data test;
x=divide(1,0);
run;
/* Example 2 (Result: UpperCLMean=.I) */
ods output conflimits=cl;
proc ttest data=sashelp.class sides=u;
var age;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Most likely it is a special missing value. In addition to the normal missing value, which is represented by a period, SAS allows 27 special missing values. They are represented in code by period followed by a letter or underscore. In listing/printing the period is not displayed.
Try something like this to see how many observations have .I for the DB variable.
proc print data=MYDATA;
where db=.i ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
"Special Missing" values are created like this:
data test;
db = .I;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @kumarayas,
While programmers are free to use special missing values such as .I for arbitrary purposes, there are contexts in which .I has a special meaning: infinity. For example, the DIVIDE function and PROC TTEST produce this particular special missing value with the meaning "infinity" in certain situations (see code examples below). But even then it's still a missing value and recognized as such, e.g., by functions like MISSING, NMISS or CMISS.
/* Example 1 (Result: x=.I) */
data test;
x=divide(1,0);
run;
/* Example 2 (Result: UpperCLMean=.I) */
ods output conflimits=cl;
proc ttest data=sashelp.class sides=u;
var age;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Sir @FreelanceReinh for sharing. Always spot on and to the point. Kudos! Interestingly, I ran into something similar a week ago viz. special missings, though was able to figure the details after having read an amazing paper by @Quentin on special missings for BY GROUP processing that I used for scoring. Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@novinosrin wrote:
... read an amazing paper by @Quentin on special missings ...
I assume you mean "How to Represent Missing Data: Special Missing Values vs. 999999999." Indeed, this is really good and timeless. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your kind words about my paper, @novinosrin and @FreelanceReinh . That was the first UG paper I ever wrote. (I was too scared to present, so I did it as a poster for long-lost NESUG). Always nice to know that a paper has been read!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.