BookmarkSubscribeRSS Feed
Lulus
Obsidian | Level 7


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!!

3 REPLIES 3
Reeza
Super User

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.

ballardw
Super User

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

TomKari
Onyx | Level 15

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

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 511 views
  • 0 likes
  • 4 in conversation