LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 27 Feb 2008 13:48:55 -0500
Reply-To:     "Long, Stuart (NIH/NIEHS) [C]" <long3@NIEHS.NIH.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Long, Stuart (NIH/NIEHS) [C]" <long3@NIEHS.NIH.GOV>
Subject:      Re: How should I code this problem?
Comments: To: Reeza <fkhurshed@HOTMAIL.COM>
In-Reply-To:  A<>
Content-Type: text/plain; charset="us-ascii"

The ordering of values in PROC LOGISTIC is done by the encoded values. If the variable is not encoded, then the ordering is based on the actual values of the variable. I often remove the formatting if the actual values have the orders that I want:

For a variable, say, truant(how many days missed)

VALUE 1 = "0-4 days" 2 = "5-9 days" 3 = "10-20 days" 4 = "21+ days" ;

The CLASS order in the modeling will be

0-4 days 10-20 days 21+ days 5-9 days

Two solutions to this are:

1)Get rid of encoded values with FORMAT truant;


2)Make sure the encoded values are in the order you want: VALUE 1 = "1) 0-4 days" 2 = "2) 5-9 days" 3 = "3) 10-20 days" 4 = "4) 21+ days" ;

Stuart Long Contractor Westat Senior Analyst 919-941-8307

-----Original Message----- From: Reeza [mailto:fkhurshed@HOTMAIL.COM] Sent: Wednesday, February 27, 2008 1:36 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: How should I code this problem?

On Feb 27, 11:21 am, Melodyp <> wrote: > Hello! > > I have a file with 589 varialbes, and in order to do the Logistic > regression, I have to transfer many of the variables with letters in > to numbers. Many of them contains the same results : such as N-->>No, > Y-->> Yes, is there a way I can code them all together to let N-->>"0" > and Y-->>"Y"? > > Thank you in advance for your help. > > Regards, > > Melody

Use a format and apply the format to all the variables you need. Though I'm not 100% sure how the regression would work, would it use the recoded or original value.

Back to: Top of message | Previous page | Main SAS-L page