/* 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
*/
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.