BookmarkSubscribeRSS Feed
Mion
Calcite | Level 5

Hi! I'm having an issue with proc mianalyze process using macro. I imputed data using proc mi process before running the following code.

 

%macro desc(b,a);
proc surveyfreq data=&b; where excl=0;
  tables &a;
  by _imputation_;
  ods output Oneway=freq;

proc mianalyze data=freq;
  by &a;
  modeleffects percent;
  stderr stderr;
  run;

%mend desc; 

I put a dataset name as b and variable names as a. But I still don't understand why I'm getting this error message. 

ERROR: At least two imputations are required for PROC MIANALYZE.
NOTE: The above message was for the following BY group: (description for groups)

Of course, I googled it but I found no one asking this error message. Is it because proc mi process didn't work properly? Thank you in advance!

 

1 REPLY 1
sbxkoenk
SAS Super FREQ

Hello,

There is nothing wrong with your macro as far as I can assess.

I have no experience with PROC MIANALYZE but, to my understanding,

you have only 1 imputation for each by-group (or for some of the by-groups) and you need at least two to run a successful PROC MIANALYZE.

Kind regards,

Koen

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 626 views
  • 0 likes
  • 2 in conversation