Showing posts with label categorize. Show all posts
Showing posts with label categorize. Show all posts

Tuesday, February 13, 2007

quartiles (or x-tiles) for the lazy

data composite;
set data.composite;
proc rank groups=4 out=ranked;
var srcalc srprot sriron srmagnes srphos srzinc srvitc srvitd packyrs bmi;
ranks rank_srcalc rank_srprot rank_sriron rank_srmagnes rank_srphos rank_srzinc rank_srvitc rank_srvitd rank_packyrs rank_bmi;
run;

Sunday, February 11, 2007

create a categorical variable in one fell swoop

categorize a variable with "lazy elegance"

if age ne . then agecat= int(iage/5-1);