/* 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
*/
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.
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.