BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Gilles-Protais
Obsidian | Level 7
proc mi data=missing nimpute=2 seed=14823 out=outmi;
      class sex smoking;
        fcs reg(bmi=smoking **bleep**e time sex);
        fcs logistic (smoking=bmi **bleep**e time sex);
      
      	do i = 0 to 6 by 0.1 ;
         mnar adjust( bmi / shift=i);
      	end;
      mnar adjust (smoking/shift=2);
      



74 do i = 0 to 6 by 0.1 ;
__
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
How can I handle this please?
 


var bmi smoking sex time **bleep**e; run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

I don't thing PROC MI allows DO loops.

Are you saying you want generate multiple different MNAR statements?

I have not idea if that is valid for PROC MI either so first try generating the multiple statements by hand and see if it actually works.

 

If it does then use code generation to create the multiple statements.

For example you could make a macro so that you can use the macro %DO statement.

%macro mnr ;
%local i;
%do i=0 to 60 ;
  mnar adjust(bmi / shift=%sysevalf(&i/10));
%end;
%mend mnr;

Which you could then call using %MNR; where you want the 61 MNR statements generated.

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

I don't thing PROC MI allows DO loops.

Are you saying you want generate multiple different MNAR statements?

I have not idea if that is valid for PROC MI either so first try generating the multiple statements by hand and see if it actually works.

 

If it does then use code generation to create the multiple statements.

For example you could make a macro so that you can use the macro %DO statement.

%macro mnr ;
%local i;
%do i=0 to 60 ;
  mnar adjust(bmi / shift=%sysevalf(&i/10));
%end;
%mend mnr;

Which you could then call using %MNR; where you want the 61 MNR statements generated.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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