Subscribe to DSC Newsletter

Hello All,

I need help in defining ordinal variables in SAS. I have age buckets given for each person. Say 26 Years-30 years as bucket 1, 31 years to 35 years as bucket 2, 36 years to 40 years as bucket 3, and so on. If I include these bucket numbers in the model, then SAS considers it as continuous numeric variable. I want to make SAS understand that these buckets are ordinal. I did not get any useful information regarding this online. 

Can you please help me out.

Thanks a lot in advance :)



Tags: Ordinal, SAS, Variables

Views: 764

Reply to This

Replies to This Discussion

Hey Raghu, I got your DM and responding here.

I'm not sure what you're looking for here. Do you have age as a continuous variable - like 25, 26 ... 70? If you want to group them into buckets, you could quickly use any grouping algorithm to bucket them into your groups of 25-30, 31-35, 36-40 etc. And that way, proc logistic will automatically take it as a character variable. If you need it to be ordinal, then you could recode it into 1,2,3,4,5 for each of the ascending groups and while logistic regression will through out the odds for this as a continuous variable, not a character variable, so you may not be able to get an idea of 1 vs 2 for odds like if you had put it as a char variable.

Does this make sense?

Hello Arun,

Thanks a lot for the response!

I do not have the exact age values. I am given the age bucket for each person. And as you suggested, I have created the buckets 1,2,3,4,5,etc. So according to you, I can use these bucket numbers directly. It is correct but the interpretation of the odds ratio would not be simple. Am I right?

Thanks a lot once again!

Best Regards,



On Data Science Central

© 2020 is a subsidiary and dedicated channel of Data Science Central LLC   Powered by

Badges  |  Report an Issue  |  Privacy Policy  |  Terms of Service