03-08-2017 11:23 AM
Hello, is there any way of treatming missing values in the dataset? I have a lot of missing values because of which my results are not reliable. SAS shows me that 71% of the data is missing, which is a large number. Pleas elet me know how this can be solved.
03-08-2017 11:35 AM
Well, from the embeded picture, i can't really tell what those results say, or what you are trying to do with the data (i.e. what Proc you are using); however here would be my solutions for missing values:
03-08-2017 11:38 AM
It is unclear how this is a problem. Would you like to have them converted to zeroes? Or minus 1? Or delete the rows or colmns containg them? A value is generally missing because, well, it is. Probably born that way. There is no generic treatment for that; you'll need to inform us how you want if 'fixed'. Many procs (also the ones yuou are using like FREQ) have options designed to deal with missing values. Please elaborate on your intentions with the data so we can better advice.
03-08-2017 12:03 PM
First thing I would consider is where did the data come from? If you used Proc Import to bring the data into SAS then you may have issues with variables having been guessed to be the wrong type. If the first rows of data have numeral values but some of the values in the column are text then the Proc could guess that the data is supposed to be numeric based on the first few rows and then all of the character values would be set to missing.
Also did you look at the raw data source and the result after being brought into SAS to see that things look right?
Another common issue for getting many missing values is combining two or more data sets. If a variable does not exist in one data set when two sets are appended (proc append with force or as set statement like set data1 data2 then the records from the other data set will have missing values for those variables.
Or if you match merge two or more sets (MERGE or proc sql joins of some types) if there is not a matching variable you can get additonal rows with missing.
So you need to examine the entire process from start to the displayed output to consider where these come from.
Then you can decide what to do.
03-08-2017 01:11 PM
If you want the missing values converted to zeroes, you can use code like this to replace them all at once.
array nums _numeric_;
do over nums;
if nums=. then nums=0;