Hello,

I want to create the tertiles in SAS to organize my NRF variable into categories. I used the below syntax to do so but the problem is that the number of observations in each category is not similar. I am wondering if there is a potential error that I missed here.

PROC UNIVARIATE DATA=master2.NRF noprint;

VAR NRF;

WEIGHT WTS_M;

OUTPUT OUT=master2.NRFTertile PCTLPTS= 33 67 PCTLPRE=NRF_P;

RUN;

DATA master2.NRF;

SET master2.NRF;

IF NRF le ..... THEN NRFTertile=1;

ELSE IF NRF gt ..... AND NRF lt ..... THEN NRFTertile=2;

ELSE IF NRF ge ..... THEN NRFTertile=3;

RUN;

Thanks,

Elsa

More Pardis Keshavarz's questions See All
Similar questions and discussions