How to set a coded value recognized as missing in SAS?

Reply
Contributor
Posts: 46

How to set a coded value recognized as missing in SAS?


I guess my problem is a little complex here.  I need to specify MISSING VALUES to be able to do IMPUTATION.

SoI have a dataset with several variables and each of the variables has missing values, however they are coded in some ways.

for example,  data one looks like this,

vb1vb2vb3
1b4
1a1
2a1
3c3
2b2

actually, in vb1, "1" means missing; in vb2 "a" means messing and in vb3, "4" means missing and so on;  Those values means "missing", "unknown", "unspecified", so they are missings just they've been coded.

I actually use proc sql to create a new table, and doing something like this,

1.

data vb1_index;

set one;

input value $ value_d $;

1    .

2    1

3    2

;

run;

2. use "proc sql" to combine tables together

But in the final results, sas looks at it like vb1 has "no missing values" with "3" (instead of 5) obsetrvations and same as for vb2, vb3...... in this way I have nothing missing since sas only looks at completed cases.  I used proc means n nmiss options to get the results.  so i don't know if my imputation is going to work well.

please let me know a quick way to set those values as missing values because my "several" variables are like.....30+, thank you all very much!!

Super User
Posts: 19,772

Re: How to set a coded value recognized as missing in SAS?

Is the missing value different for every value?

If so there isn't much of a short cut. Formats may help speed it up though if you have some that are similar.

Super User
Posts: 11,343

Re: How to set a coded value recognized as missing in SAS?

What imputation method are you going to use on character values?

PROC Star
Posts: 1,167

Re: How to set a coded value recognized as missing in SAS?

Could you show us exactly what your proc means step looks like? I'm wondering if you're using VB1 to VB3 as analysis variables or classification variables. Either way, you're not coding it exactly right to get the results you want.

Tom

Ask a Question
Discussion stats
  • 3 replies
  • 220 views
  • 0 likes
  • 4 in conversation