Trying to run this code in SAS 94 windows environment. It takes much time in SAS 9.4 compared with SAS 9.2. Any suggestions on how to improve the performance?
ods _all_ close;
ods preferences;
data heights;
input Family G$ Height @@;
datalines;
1 F 67 1 F 66 1 F 64 1 M 71 1 M 72 2 F 63
2 F 63 2 F 67 2 M 69 2 M 68 2 M 70 3 F 63
3 M 64 4 F 67 4 F 66 4 M 67 4 M 67 4 M 69
;
run;
data input;
set heights;
if g eq 'F' then
gf = 1;
else gf = 0;
drop g;
if family=1 then
do;
indf1=1;
indf2=0;
indf3=0;
indf4=0;
end;
else if family=2 then
do;
indf1=0;
indf2=1;
indf3=0;
indf4=0;
end;
else if family=3 then
do;
indf1=0;
indf2=0;
indf3=1;
indf4=0;
end;
else if family=4 then
do;
indf1=0;
indf2=0;
indf3=0;
indf4=1;
end;
run;
ods graphics on;
proc mcmc data=input outpost=postout nmc=50000 seed=7893 plots= (trace density) diag=none monitor=(b0 b1) STATISTICS=summary
statistics=interval;
ods select postsummaries postintervals tdpanel;;
parms b0 0 b1 0 s2 1 s2g 1;
prior b: ~ normal(0, var = 10000);
prior s: ~ igamma(0.01, scale = 0.01);
random gamma ~ normal(0, var = s2g) subject=family monitor=(gamma);
mu = b0 + b1 * gf + gamma;
model height ~ normal(mu, var = s2);
ods output postintervals=pint postsummaries=psum;
run;
quit;
ods graphics off;
proc print data=pint;
run;
proc print data=psum;
run;
;
... View more