data eq;
input ID y x z w;
cards;
1 1 65 40 0
2 1 34 . 0
3 0 . 23 0
4 1 48 35 0
;
run;
%macro em (missper, n_imp, my_seed);
proc mi data=eq seed=&&my_seed&i simple nimpute=&n_imp out=EMIMP&missper ;
em itprint ;
var y x z w;
run;
%mend em;
%macro mi (missper,n_imp,n_seed);
%em (&missper,&n_imp,&n_seed);
%mend mi;
%macro large(missper,n_imp,n_seed,n_boot);
data seed_long(drop=i);
call streaminit(&n_seed);
do i = 1 to &n_boot;
x_seed = floor(rand("Uniform")*500000); output;
end;
run;
data _null_;
set seed_long;
call symput('my_seed'|| compress(put(_n_,4.)), x_seed);
run;
%let i=1;
%do %until (&i>&n_boot) ;
%mi(&missper)
%let i = %eval(&i+1);
%end;
%mend large;
%large(20, 5, 3456,3); Hello, What I am trying to do is using a random fixed seed to create EM output. but I got the following error. NOTE 137-205: Line generated by the invoked macro "EM". 1 proc mi data=eq seed=&&my_seed&i simple nimpute=&n_imp out=EMIMP&missper ; em --- 22 1 ! itprint ; var y x z w; run; ERROR 22-322: Syntax error, expecting one of the following: an integer constant, PCTMISSING. I know %large has no problem. The problem is the writing of EM and MI macro variable. But I don't know what is the right way to do it. Thanks
... View more