/* test data */
data p;
input id job weight;
cards;
1 1 10
2 0 20
3 1 30
;
run;
/* create dataset n from p */
data n;
set p;
if job = 1 then do;
job = 0;
weight = 0.2;
output;
job = 1;
weight = 0.8;
output;
end; else if job = 0 then do;
job = 0;
weight = 0.5;
output;
job = 1;
weight = 0.5;
output;
end;
run;
/* check */
proc print data=n;
run;
/* on lst
Obs id job weight
1 1 0 0.2
2 1 1 0.8
3 2 0 0.5
4 2 1 0.5
5 3 0 0.2
6 3 1 0.8
*/
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.
Ready to level-up your skills? Choose your own adventure.