Any SAS expert here ?

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

hello friends, I am having trouble with one thing in SAS. I have a huge data set and of course there are number of missing observations in the data set. I have been asked to find the "missing code" the data set is using. ? Well i understand the question, the missing data code can be ".", " " or "-99" or it can be anything. but how do i find what code the data set is using for missing values ? what program statemetn should i use to find out the missing code the data set is using  ? Any help would be appreciated. thanks. Racheeta.

racheeta · Oct 21, 2009 6:58 PM · 9,935 views

2 Replies

The questions seems quite tricky, or unsolvable in itself. You are saying that you have a huge data and asked to find the missing code?? So, where comes SAS here, the data is raw, its upon those guys who wrote data in any format. As you said youself it could be anything like ".", "-99", yeas, very true. So, if u have to import data in SAS,u need to say in statement that missing data is "this". but, u r trying to find missing data using SAS. ............oops.......... What about looking into the data (well part of data) for something that does not look like what should have been manually, or with some code. If you are going to analyze the data, u should know that what values you expect i.e 1-100, or some numeric, positive. if u know that u can select the data thats reading(or delete that's coded). for example, i made a dummy data data hello; do a=1 to 100; b=ranuni(0); output; end; run; Now, i replaced some with some missing code; data hello2; set hello; if a=50 then a=-99; if (b<0.5 and b>0.4) then b="."; run; Now, only data that does not fit in what I expect, could be missing data hello3; set hello2; where a<0; run; or coding what could be missing to my code,"." data hello4; set hello2; if a<0 then a="NA"; run; I don't know whether it helps you or not...but this is definitely what I will do.

shivanagar · Oct 21, 2009 7:55 PM

Look at the distribution of each variables - using proc freq for nominal and ordinal variable and even interval data, and proc univariate for interval/continous data.  While developing database or importing database into SAS, missing values are coded by such a number that is unlikely to be usual data point of that particular variable (would be an extreme observation but, has higher frequency distribution than any other extreme observation if several observation are missing). So, if ".", "9", "99", "999", "-9", "-99" or any other value that is repeated more frequently than usual value, they are likely to be missing values. Easiest way would be to inspect the extreme observation. Replace any missing values with "." and do the analysis.

bnu · Oct 21, 2009 11:04 PM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all