Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The VeryTime,Stay informed and read the latest news today from The VeryTime, the definitive source.

Dealing With Missing Values In Sas

45
Before knowing about the missing values in SAS, first we need to know, what is SAS? And what is a dataset? SAS is statistical analysis system, which is used to analyse the data and to generate a report. Dataset is a special structured file which is used to store the data within the SAS environment. These values are in the form of character-values and numeric-values and these values are utilised to arrange the data in a structured format to be analysed to generate a finalised report.

Data usually contains data-values and these datavalues can be in the form of real characters or numeric values. Sometimes within the data there might be missing datavalues, and these missing data-values are not utilized for analysis. There are different types of missing -values in the data and their representation is different in the dataset, they are as follows:

Numeric missing data-values are represented by a single decimal point, whereas character missing data-values are represented by single blank space. And the special missing datavalues are represented by decimal point followed by a letter or a decimal point followed by an underscore.

How to identify a missing datavalue in a variable?

There are different syntax's to identify missing data-values in a variable, because there are different types of missing datavalues in a variable. They are as follows:

If the programmer wants to know how many missing data-values are present in a variable, programmer can use NMISS function to identify total missingvalues in a variable, where this function is only used to know how many missing data-values are present in variable.

To extract only-missing values-from the numerical data, the programmer can use conditional statements to extract the missing datavalues. Here is the code to completely extract the numerical missing data from the variable.

Syntax: If =. then output;

And to extract the character missing data-values from the character variable, conditional statement should be used with-blank-value-specified-within the quotes. Here is the code to extract-the character missing datavalues from the variable.

Syntax: If =" " then output;

If the data-contains special missing datavalues that can be checked by normal condition that is used for character-missing data-values, or that can also be checked by conditional statement-where-missing-value-is written with dot and character datavalue. Here is an example for that code:

Syntax: If lessthan.z then output;

Sometimes the programmer has no idea whether the missing -value-is a-numerical variable or a character variable, then he/she can utilize one of the function "Missing" that works for both numeric and character variables. Here is an example to utilize that function.

Syntax: If Missing ( ) then do;

How to handle missing datavalues while updating a dataset:

Handling of datasets should be in a proper order, while updating two datasets; first data set is taken as a master dataset, where as second dataset is taken as transaction dataset, this is a dataset that just follows the master dataset. During this process of update, the two datasets should have matching variable names and non-matching variable names will be added to the master dataset. This update not only depends on variable names but also depends on observations. So while updating the two datasets, there must be common -values too. If-uncommon -values are present they get added to the master dataset.

During the update process, if transaction dataset has missing -values, these missing -values will not be updated to the master dataset because during update process it doesn't update-the-missing-values, which is been stopped by the "UPDATEMODE" of the update concept. But if the programmer really needs to update the data with-missing-values-also, then he/she can change the update mode, not to check for any missing -values while updating. This option is always written in this syntax.

"UPDATEMODE= nomissingcheck"

Conclusion: Thus, to deal with missing datavalues, the programmer has to first know what type of missing data-values are present, and how he/she can control them at different situations of analysis.
Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.