PROC MI procedure

Reply
Occasional Contributor
Posts: 9

PROC MI procedure

I am trying to impute the missing values in a dataset with categorical variables (ordinal variables each can take the number from 1-5). I did the following:

 

1. check for missing

proc means data=cabl nmiss;
var pn1 pn2 pn3 pn4 pn5;
run;

 

2. check for patterm

proc mi data=cabl nimpute=0 ;
var pn1 pn2 pn3 pn4 pn5;
ods select misspattern;
run;

 

and there is no obervious pattern of missingness, so i proceed to impute missing values

 

proc mi data=cabl nimpute=10 out impca;

class pn1 pn2 pn3 pn4 pn5;

var pn1 pn2 pn3 pn4 pn5;

fcs logistic(pn1 pn2 pn3 pn4 pn5 /link=glogit);
run;

 

I got an error message "The table "WORK.IMPNEEDS" cannot be opened because it does not contain any columns."

 

Can anyone help?

 

I also am not sure how to proceed. I need to produce a dataset with imputed missing values and save it for analysis.

 

Thanks

SAS Super FREQ
Posts: 3,475

Re: PROC MI procedure

 

There is an error in your Staep 3. The correct syntax is

...OUT=impca; /* note the equal sign */

 

The error message you report does not agree with the code that you have posted. You do not refer to "work.impneeds" in your code, so you can't get that error. If you still experience problems after you add an equal sign, then please post the full SAS log.

 

Occasional Contributor
Posts: 9

Re: PROC MI procedure

Thanks. I put the equal sign back and still have problem. I used a simpler dataset to trun before I use the full dataset.

 

Here is the full version

 

/*1. check missing pattern*/
proc means data=cabl nmiss;
var pn1 pn2 pn3 pn4 pn5 pn8 pn9 pn10 pn11 pn12 pn13 pn14 pn15 pn16 pn17 pn18 pn19 pn20
pn21 pn22 pn23 pn24 pn25 pn26 pn27 pn28 pn29 pn30 pn31 pn32 pn33 pn34 pn36 pn37 pn38
pn39 pn40 pn41 pn42 pn43 pn44 pn45 pn46 pn47 pn49 pn50 pn51 pn52 pn53 pn54 pn55 hsin2
hsin3 hsin11 hsin16 hsin19 hsin20 hsin21 hsin22 hsin23 hsin24 hsin25 hsin26 hsin27
hsin28 hsin1 hsin4 hsin5 hsin6 hsin7 hsin8 hsin9 hsin10 hsin12 hsin13 hsin14 hsin15
hsin17 hsin18 hsin29 hsin30 hsin31 pdln1 pdln2 pdln3 pdln4 pdln5 pdln6 pdln8 pdln9
pdln10 pdln11 pdln12 pdln13 pdln14 pdln15 pdln16 pdln17 pdln18 pdln19 pdln20 pdln21
pdln22 pdln23 pdln24 pdln25 sn1 sn2 sn3 sn17 sn18 sn5 sn6 sn7 sn8 sn9 sn10 sn11 sn12
sn13 sn14 sn15 sn16 lpn1 lpn2 lpn3 lpn4 lpn5 lpn6 lpn7 lpn8 lpn10 cn1 cn2 cn3 cn4 cn5
cn6 cn7 cn8 cn9 cn10 cn11 cn13;
run;
/*2. check pattern of missing value*/
proc mi data=cabl nimpute=0 ;
var pn1 pn2 pn3 pn4 pn5 pn8 pn9 pn10 pn11 pn12 pn13 pn14 pn15 pn16 pn17 pn18 pn19 pn20
pn21 pn22 pn23 pn24 pn25 pn26 pn27 pn28 pn29 pn30 pn31 pn32 pn33 pn34 pn36 pn37 pn38
pn39 pn40 pn41 pn42 pn43 pn44 pn45 pn46 pn47 pn49 pn50 pn51 pn52 pn53 pn54 pn55 hsin2
hsin3 hsin11 hsin16 hsin19 hsin20 hsin21 hsin22 hsin23 hsin24 hsin25 hsin26 hsin27
hsin28 hsin1 hsin4 hsin5 hsin6 hsin7 hsin8 hsin9 hsin10 hsin12 hsin13 hsin14 hsin15
hsin17 hsin18 hsin29 hsin30 hsin31 pdln1 pdln2 pdln3 pdln4 pdln5 pdln6 pdln8 pdln9
pdln10 pdln11 pdln12 pdln13 pdln14 pdln15 pdln16 pdln17 pdln18 pdln19 pdln20 pdln21
pdln22 pdln23 pdln24 pdln25 sn1 sn2 sn3 sn17 sn18 sn5 sn6 sn7 sn8 sn9 sn10 sn11 sn12
sn13 sn14 sn15 sn16 lpn1 lpn2 lpn3 lpn4 lpn5 lpn6 lpn7 lpn8 lpn10 cn1 cn2 cn3 cn4 cn5
cn6 cn7 cn8 cn9 cn10 cn11 cn13;
ods select misspattern;
run;
/*3. impute missing values*/
proc mi data=cabl nimpute=10 out=impneeds;
class pn1 pn2 pn3 pn4 pn5 pn8 pn9 pn10 pn11 pn12 pn13 pn14 pn15 pn16 pn17 pn18 pn19 pn20
pn21 pn22 pn23 pn24 pn25 pn26 pn27 pn28 pn29 pn30 pn31 pn32 pn33 pn34 pn36 pn37 pn38
pn39 pn40 pn41 pn42 pn43 pn44 pn45 pn46 pn47 pn49 pn50 pn51 pn52 pn53 pn54 pn55;
var pn1 pn2 pn3 pn4 pn5 pn8 pn9 pn10 pn11 pn12 pn13 pn14 pn15 pn16 pn17 pn18 pn19 pn20
pn21 pn22 pn23 pn24 pn25 pn26 pn27 pn28 pn29 pn30 pn31 pn32 pn33 pn34 pn36 pn37 pn38
pn39 pn40 pn41 pn42 pn43 pn44 pn45 pn46 pn47 pn49 pn50 pn51 pn52 pn53 pn54 pn55;
fcs logistic(pn1 pn2 pn3 pn4 pn5 pn8 pn9 pn10 pn11 pn12 pn13 pn14 pn15 pn16 pn17 pn18 pn19 pn20
pn21 pn22 pn23 pn24 pn25 pn26 pn27 pn28 pn29 pn30 pn31 pn32 pn33 pn34 pn36 pn37 pn38
pn39 pn40 pn41 pn42 pn43 pn44 pn45 pn46 pn47 pn49 pn50 pn51 pn52 pn53 pn54 pn55/link=glogit);
run;

 

and here is the error message I got

 

ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [MI (2) ]
Segmentation Violation
 
Traceback of the Exception:
 
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sas(+0x15aa6e) [0x7f0e52370a6e]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sas(+0x4cb0b) [0x7f0e52262b0b]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/tkmk.so(bkt_signal_handler+0x144) [0x7f0e50c2e3c4]
/lib64/libpthread.so.0(+0xf7e0) [0x7f0e51de67e0]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/tkmk.so(skm_unlinke+0x76) [0x7f0e50c41986]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/tkmk.so(skmMemRelease+0x190) [0x7f0e50c3fcf0]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sasmi(+0x4c557) [0x7f0de3a03557]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sasmi(+0x56dde) [0x7f0de3a0ddde]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sasmi(mipfcs0+0x1e4) [0x7f0de39f89a4]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sasmi(+0x1a76a) [0x7f0de39d176a]
/opt/sasinside/SASHome/SASFoundation/9.4/sasexe/sas(vvtentr+0x13d) [0x7f0e522626ad]
/lib64/libpthread.so.0(+0x7aa1) [0x7f0e51ddeaa1]
/lib64/libc.so.6(clone+0x6d) [0x7f0e5146c93d]
 
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.IMPNEEDS may be incomplete. When this step was stopped there were 0 observations and 376 variables.
NOTE: PROCEDURE MI used (Total process time):
real time 2:39.19
cpu time 2:38.39
 
 
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
 
The SAS task name is [MI (2) ]
Segmentation Violation
 
67
68 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
80
SAS Super FREQ
Posts: 3,475

Re: PROC MI procedure

The SAS log tells you what to do:

"Please contact technical support and provide them with the following traceback information:"

Also include the example, your operating system, and the version of SAS that you are running.

 

There is no way for us to know what is causing the problem, but the sheer size of the model is probably part of the problem.

 

You can greatly simplify your code by using the SAS shortcut notation for variable names. The syntax

proc means data=cabl nmiss;
var pn1-pn5 pn8-pn55 
    hsin1-hsin31 pdln1-pdln25 
    sn1-sn3 sn5-sn18 lpn1-lpn8 lpn10 
    cn1-cn11 cn13;
run;

is much easier to read and type than listing all the variable names one by one.

 

Occasional Contributor
Posts: 9

Re: PROC MI procedure

Thank you, good advice.

Ask a Question
Discussion stats
  • 4 replies
  • 352 views
  • 0 likes
  • 2 in conversation