BookmarkSubscribeRSS Feed
Wes
Calcite | Level 5 Wes
Calcite | Level 5
i have dataset as following

now i have a question about usin IML in proc sql as the code below

in the code, RollGibbs is the code using IML dsIn is the data read

i can not understand why do this procedure?

please help me~plz



data zachary;
input id x;
cards;
1 4
1 2
1 3
2 3
2 4
2 5
2 4
3 5
3 8
;

%macro zachary(n);
%do i=1 %to &n;
proc sql noprint;
create table set&i as
select id,%RollGibbs(dsIn); as mean_x
from zachary
where id=&i
group by id;
quit;
%end;
%mend;
%zachary(3);
1 REPLY 1
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Wes,

This code contains formal error:
select id,%RollGibbs(dsIn); as mean_x
It is necessary to run %RollGibbs(dsIn) in separate datastep and then combine output
with zahary.

Sincerely,
SPR

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 577 views
  • 0 likes
  • 2 in conversation