Hello,

Could someone show me the codes for grouping a continuous variable as a categorical variable? for instance, BMI in my dataset is a continuous variable, if I want to redefine the variable in a new variable bmigp as

bmigp = 1 if bmi<25

bmigp= 2 if 25<= bmi< 30

bmigp= 3 if bmi>=30

what should the codes be?

Thanks in advance!

Jason