```Date: Wed, 27 Feb 2008 13:48:55 -0500 Reply-To: "Long, Stuart (NIH/NIEHS) [C]" Sender: "SAS(r) Discussion" From: "Long, Stuart (NIH/NIEHS) [C]" Subject: Re: How should I code this problem? Comments: To: Reeza In-Reply-To: A<2bacbc46-b98c-4cb6-9eae-7cbd1a094540@e25g2000prg.googlegroups.com> 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; OR 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