in case bncoxuk wanted to "recode" using a format:
/* a test dataset */
data one;
a=18; b=19; output;
a=15; b=24; output;
run;
/* recoding using a format */
proc format;
value level
0-< 5 = 1
5-<10 = 2
10-<15 = 3
15-<20 = 4
20-<25 = 5
other = .;
run;
/* recoding */
data two;
set one;
a = input(put(a, level.), best.);
b = input(put(b, level.), best.);
run;
/* check */
proc print data=two;
run;
/* on lst
Obs a b
1 4 4
2 4 5
*/
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.