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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 964 views
  • 0 likes
  • 2 in conversation