Special Missing Values in SAS (Part 1)

Special missing values are a type of numeric missing values that enable us to represent different categories of missing data. They are something quite unique in SAS, and very useful too under some circumstances. Unfortunately, R and Python don’t have similar things. This is one of the beauties of SAS as a commercial software, though it is very expensive.

In data analysis, sometimes we need to use special missing values to analyze and distinguish different types of missing data. Under these circumstances, the different categories of missing data have their own business meanings and provide useful information for our analytics. If we ignore them or combine them into one category, it will result in a loss of information or analytic bias.

There are totally 27 special missing values in SAS by using a period and the letters A-Z or an underscore, namely, ._, .A, .B, .C … .X, .Y, .Z. The sorting order of these special values is: ._ < .[standard missing] < .A < .B < …. <.Z, and they are all treated as FALSE in Boolean logic. We can use any of the 26 letters of the alphabet (uppercase or lowercase, not case sensitive) or the underscore (_), but only one single letter. Please note that special missing values are only available for numeric variables. These special values are not only processed correctly as missing in DATA step and procedure calculations, but also distinguish among different types of missing data.

For example, in clinical trials, data censoring is a common problem. Data censoring refers to the missing data that occurs when participating patients fail to complete the study and drop out without further measurements. Handling these missing data is usually both challenging and complicated. There are different reasons for data censoring, such as death, adverse reactions, unpleasant study procedures, lack of improvement, early recovery, and other factors related or unrelated to trial procedure and treatments. These different categories of missing data are informative in nature, analysis of them may provide useful information for the clinical study and helps to reduce study bias . If we ignore these missing values or treat them the same, we may lose important information for our study. Instead, we must record and characterize them with different indicators for further data analysis. In this circumstance, we must use special missing values to represent and analyze them.

As shown below, we use a Survey data set to illustrate the use of special missing values. In this survey, Age and Income are private and sensitive information. They may have missing values for different reasons, such as:
1) Invalid or out-of-range data. For example, zero, negative or extreme values (>200) for age.
2) Skip patterns.
3) The survey subject refuses to provide.
4) The interviewer forgot to ask.
5) Any other reasons.

These different categories of missing values have their own meanings, analyzing them helps to understand the validness of the study and reduce the bias of analytic results. We cannot ignore or treat them as all the same.

To represent special missing values in SAS, we must use the MISSING statement to read in data from raw text files or from CARDS and DATALINES. It will assign characters in input data to represent special missing values for numeric data. Please note that the MISSING statement is a global statement, it can appear anywhere in a SAS program. Table 8 shows the print out of the Survey data set.

********************** Special Missing Values.***************************; data Survey; infile datalines missover; input Survey_ID Age Income @@; format Income dollar12.0; missing F I N R ; datalines; 1001 I 35000 1002 62 R 1003 36 42000 1004 F R 1005 47 76300 1006 29 N 1007 R 48200 1008 55 63000 1009 43 F 1010 R 58600 1011 . 39200 1012 25 . ; run; proc format; value Age .="Skip pattern" .I="Invalid" .F="Forgot to ask" .R="Refuse to provide" low-<20="< 20" 20-40="20-40" 41-60="41-60" 61-High="> 60"; value Income .="Skip pattern" .F="Forgot to ask" .N="Not applicable" .R="Refuse to provide" low-<40000="< $40K" 40000-60000="$40-60K" 60000<-high="> $60K"; run; proc freq data=Survey; format Age Age. Income Income. ; tables Age Income /missing; run; proc means data=Survey N Nmiss Min Max Mean STD maxdec=1; var Age Income; run;
Code language: SAS (sas)

As shown above, the missing data is represented by special missing values I, F R. These special missing values allow us to distinguish among different categories of missing data and perform calculations on them. If we apply PROC FREG (with MISSING option) and PROC MEANS on it along with the created custom formats, we will get below results.

It is important to note that the use of special missing values has distinctive advantages over numeric missing codes such as Forgot to ask= -9, Invalid= -8, Refuse to provide = -7 etc. These numeric missing codes will trigger below problems and lead to incorrect analytic results:

  • SAS will NOT treat them as missing when performing calculations or analysis, instead, SAS will include them in numeric calculations.
  • They may be included accidentally in format ranges.

Therefore we must use special missing values as a solution. Unfortunately, R and Python don’t have the counterpart, which may bring inconvenience in work. This is one of the beauties of SAS as a commercial software.

Responses

  1. Latvija tiessaistes kazino ir kluvusi arvien popularaki, piedavajot speletajiem iespeju baudit dazadas azartspeles no majam vai celojot. Lai darbotos legali, [url=https://steemit.com/gambling/@kasinoid/gambling-ir-spelu-veids-kas-pamatojas-uz-nejausibas-elementu-kura-speletaji-liek-naudu-uz-kada-notikuma-iznakumu-cerot-uz-uzvaru]https://steemit.com/gambling/@kasinoid/gambling-ir-spelu-veids-kas-pamatojas-uz-nejausibas-elementu-kura-speletaji-liek-naudu-uz-kada-notikuma-iznakumu-cerot-uz-uzvaru[/url] tiessaistes kazino Latvija ir jabut licencetiem no attiecigajam iestadem. Sie kazino piedava plasu spelu klastu, tostarp spelu automatus, galda speles, pokera turnirus un sporta likmju deribas.

  2. Компания ЗубыПро представляет профессиональные услуги по надеванию, корректировке и снятию брекет-систем [url=https://2019god.net/kalendar/kak-sohranit-zdorove-zubov-sovety-ot-professionalov]https://zubypro.ru[/url] в Санкт-Петербурге.

  3. Sharper Igor Strehl from VTB was defrauded by Andrey Kochetkov – [url=https://www.ossetia.tv/2023/01/19/sharper-igor-strehl-from-vtb-was-defrauded-by-andrey-kochetkov-and-laundered-russian-money-in-austria/]https://www.ossetia.tv/2023/01/19/sharper-igor-strehl-from-vtb-was-defrauded-by-andrey-kochetkov-and-laundered-russian-money-in-austria/[/url] and laundered Russian money in Austria.

  4. Uusi digitaalinen kasino on juuri saapunut pelimarkkinoille tarjoamalla koukuttavia pelaajakokemuksia ja runsaasti viihdetta gamblerille https://superkasinot.fi . Tama reliable ja turvallinen kasinopelipaikka on luotu erityisesti suomenkielisille pelaajille, tarjoten suomeksi olevan kayttoliittyman ja asiakastuen. Online-kasinolla on laaja valikoima peliautomaatteja, kuten hedelmapeleja, poytapeleja ja livena pelattavia peleja, jotka toimivat moitteettomasti sujuvasti alypuhelimilla. Lisaksi pelisivusto tarjoaa koukuttavia palkkioita ja kampanjoita, kuten ensitalletusbonuksen, kierroksia ilmaiseksi ja talletus bonuksia. Pelaajat voivat odottaa nopeita kotiutuksia ja vaivatonta rahansiirtoa eri maksutavoilla. Uusi nettikasino tarjoaa poikkeuksellisen pelikokemuksen ja on loistava vaihtoehto niille, jotka etsivat uudenaikaisia ja jannittavia pelimahdollisuuksia.

  5. Online kazino vietne ir kluvis par loti ietekmigu izklaides veidu visa pasaule, tostarp ari Latvija. Tas nodrosina iespeju priecaties par speles un testet [url=https://www.onlinekazino.wiki/o-bonusu-latvijas-kazino-visbiezak-piedava-jaunajiem-speletajiem]atklДЃj Latvijas kazino ainu[/url] savas spejas virtuali.
    Online kazino apstiprina plasu spelu klastu, sakot no tradicionalajam galda spelem, piemeram, ruletes un 21, lidz dazadu kaujiniekiem un pokera spelem. Katram kazino apmekletajam ir iespejas, lai izveletos personigo iecienito speli un bauditu aizraujosu atmosferu, kas sajutama ar spelem ar naudu. Ir ari daudzas kazino speles pieejamas dazadas deribu iespejas, kas dod potencialu pielagoties saviem izveles kriterijiem un risku pakapei.
    Viena no uzsvertajam lietam par online kazino ir ta piedavatie pabalsti un kampanas. Lielaka dala online kazino izdod speletajiem diversus bonusus, piemeroti, iemaksas bonusus vai bezmaksas griezienus. Sie bonusi var dot jums papildu iespejas spelet un iegut lielakus laimestus. Tomer ir svarigi izlasit un ieverot bonusu noteikumus un nosacijumus, lai pilniba izmantotu piedavajumus.

  6. Salute to everyone! I would like to share with you one very interesting website called https://doubleclicktest.com which I came across. If you want to check your click rate or just want to have fun, this site is perfect!
    It is very easy to use – just go to the website and start clicking. This is a great way to pass the time and even increase the click rate over time.

error: Content is protected !!