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,
vb1 | vb2 | vb3 |
---|---|---|
1 | b | 4 |
1 | a | 1 |
2 | a | 1 |
3 | c | 3 |
2 | b | 2 |
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!!
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.
What imputation method are you going to use on character values?
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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.