| Date: | Fri, 26 Jun 2009 15:31:05 -0700 |
| Reply-To: | Dale McLerran <stringplayer_2@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Dale McLerran <stringplayer_2@YAHOO.COM> |
| Subject: | Re: code for categorical predictor variables |
| Content-Type: | text/plain; charset=utf-8 |
--- On Fri, 6/26/09, Jose <jsotosh@GMAIL.COM> wrote:
> From: Jose <jsotosh@GMAIL.COM>
> Subject: code for categorical predictor variables
> To: SAS-L@LISTSERV.UGA.EDU
> Date: Friday, June 26, 2009, 2:27 PM
>
> Hi,
>
> I am running a logistic regression with categorical predictor
> variables, for these I need to model the reference levels as 1 0, not
> 0 1 (the default reference level for categorical predictor variables).
> I can’t find the code to change the default reference level. Can
> anyone give me this code? Thank you.
>
Jose,
You don't state what version of SAS you have available. I will
assume that you have 9.x. The CLASS statement of PROC LOGISTIC
in recent SAS versions supports a REF=?? option. In order to
specify the value 0 as the reference level when X takes on
values 0 or 1, you can specify the option REF=FIRST. Thus, your
code would look something like:
proc logistic data=mydata;
class x(ref=first);
model y = x;
run;
The above code uses a variable-specific option. You can also
specify that all variables should use the first level as the
reference level as follows:
proc logistic data=mydata;
class x / ref=first;
model y = x;
run;
HTH,
Dale
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
|