From: Sigurd Hermansen on
Vivian:
I hesitate to speak for Robin High, but to expedite a response to your question will refer you to this lucid account:

http://cc.uoregon.edu/cnews/spring2005/saslogistic.htm

Search for "descending" and "reference".
S

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of wei yi
Sent: Wednesday, October 07, 2009 11:56 AM
To: SAS-L(a)LISTSERV.UGA.EDU
Subject: a question in PROC GENMOD

When I conducted "proc genmod ......" in SAS, is there a way that I can set the level with the highest amount $ as a base level? I know how to set the level with the most frequcy as base level. I just want to know whether I could write the command to set the highest amount as the base level. for exam, I have a class varialble called hazard group 1 to 4, then I wanted to set the hazard group with highest premium as the base level, is there an easy way to do it?

thanks,
Vivian
From: Robin R High on
An easy way would be to make a format and then apply it as in the GENMOD
code below. Or you can automate it my making a format with a DATA step
from the output of a sorted sas dataset, with the "illustrative" example
(only), where age (hazard) groups are sorted from low to high on a
randomly generated characteristic (premium), for which the highest average
value will serve as the reference age category:

data cls;
set sashelp.class;
xyz = 5+rannor(929);

proc means data=cls noprint nway;
class age;
var xyz;
output out=new(drop= _: ) mean=m_xyz;
run;

proc sort; by m_xyz;

proc print; run;

* make a numeric format sorted by mean value of xyz and attach the actual
age to it ;

DATA ctrl; length label $8 ;
SET new end=eof;
KEEP start label fmtname type hlo;
RETAIN fmtname 'ag' type 'n';
start=age;
label = CATT(put(_n_, z2.),'_',put(age,2.)); output;
RUN;

PROC PRINT data=ctrl NOobs; RUN;

proc format cntlin=ctrl; run;

proc genmod data=sashelp.class order=formatted ;
class age;
model height = age ;
lsmeans age;
format age ag. ;
run;





From:
wei yi <wy78712(a)YAHOO.COM>
To:
SAS-L(a)LISTSERV.UGA.EDU
Date:
10/07/2009 11:01 AM
Subject:
a question in PROC GENMOD
Sent by:
"SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU>



When I conducted "proc genmod ......" in SAS, is there a way that I can
set the level with the highest amount $ as a base level? I know how to set
the level with the most frequcy as base level. I just want to know whether
I could write the command to set the highest amount as the base level. for
exam, I have a class varialble called hazard group 1 to 4, then I wanted
to set the hazard group with highest premium as the base level, is there
an easy way to do it?

thanks,
Vivian