I am running Proc Logistic and it works perfectly fine. However, I would like to define reference level. For example, I have a categorical variable of "Race" with 4 levels ; Chinese, Malay, Indian and Others. I would like to make SAS reads "Chinese" as my reference but now SAS is reading "Others" as my reference. I am using this statement.
proc logistic data=WORK.IMPORT3 descending; /* SAS treats the levels of Adenovirus_E in a descending order (high to low)*/
class HDB Sick_Season Race Smoker Service;
model Adenovirus_E= HDB Sick_Season Race HDB*Race Smoker Service age_at_date_of_reprot_sick / expb;
run;
Please let me know how to solve this? Many thanks!
Hi @SSin,
Use the REF= option after the variable name in the CLASS statement, e.g.
class HDB Sick_Season Race(ref='Chinese') Smoker Service;
Hi @SSin,
Use the REF= option after the variable name in the CLASS statement, e.g.
class HDB Sick_Season Race(ref='Chinese') Smoker Service;
@SSin wrote:I am running Proc Logistic and it works perfectly fine. However, I would like to define reference level. For example, I have a categorical variable of "Race" with 4 levels ; Chinese, Malay, Indian and Others. I would like to make SAS reads "Chinese" as my reference but now SAS is reading "Others" as my reference. I am using this statement.
proc logistic data=WORK.IMPORT3 descending; /* SAS treats the levels of Adenovirus_E in a descending order (high to low)*/
class HDB Sick_Season Race Smoker Service;
model Adenovirus_E= HDB Sick_Season Race HDB*Race Smoker Service age_at_date_of_reprot_sick / expb;
run;Please let me know how to solve this? Many thanks!
Use the ref= option on the class statement, like this:
proc logistic data=one;
class x (ref='1');
model y=x;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.