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