Hi, I am trying to create 10 tertile variables (TERT1-TERT10), which based on a variable titled PA_AVG on a five point scale, increase by 0.1, and have lower bound second tertile cut offs starting at 2.5, and ending at 3.4. The second tertile upper bound cutoffs start at 3.5 and end at 4.4, increasing by .10. So, category one in TERT1 would be 0 to 2.4, category two 2.5 to 3.5, and category three, 3.6 to five. Category one in TERT2 would be 0<CAT_ONE<2.6, category two, 2.6<=CAT_TWO<=3.6, and category three, 3.6<CAT_THREE<=5, and so on until TERT10 with a second tertile cut off of 3.4 and 4.4 has been completed. I am using a nested do loop, but the code isn’t executing (it just keeps running): data temp; set rank_tert; do I=2.5 to 3.4 by 0.1; do J=3.5 to 4.4 by 0.1; do TERT=1 to 10 by 1; if 0<PA_AVG<(I) then TERT=1; else if (I)<=PA_AVG<=(J) then TERT=2; else TERT=3; end; end; end; keep PID_PDE TERT1-TERT10; run; Not sure what I am doing wrong, but it may have something to do with how I am creating the 'TERT' variable? Thanks in advance for any help! Emily
... View more