Posted by: Yatree August 3, 2004
SPSS
Login in to Rate this Post:     0       ?        
It looks like you havenýt done much with SPSS. You will learn. Itýs not complicated like SAS. RE: you question: N<50=1, >50=2,then 50=? I suppose you know how to open SYNTAX window and run the program you write. IF not, from menu FILE-->SYNTAX then type the following (#1 or #2) or similar commands. To run the program, open the data file, highlight the syntax commands you want to run then click on the forward pointing triangle - or simply go to Menu->Run->selection. I almost always highlight the section I want to run, 'cause I may have a lot more programming than I want to run at a given time. Three ways: (i guess yow know about the comment line/section starting with "*" below) 1. MISSING VALUE AGE (99). RECODE AGE (0 THRU 49 =1)(50 THRU HI=2). * YOU NEED TO DEFINE ONLY IF YOU HAVE ANY MISSING VALUE. *PLUG IN THE VALUE IF YOU KNOW HIGHEST AGE. *BUT ýHIý IS EASY. EXECUTE. /*NEED ONLY IF NO PROCEDURE TO RUN*/ 2. if you want to keep the old AGE variable COMPUTE NEWAGE=99. MISSING VALUE AGE (99). IF (AGE LT 50) NEWAGE=1. IF (AGE GE 50) NEWAGE=2. MISSING VALUE NEWAGE (99). EXECUTE. /*NEED ONLY IF NO PROCEDURE TO RUN*/ 3. Another option is munu driven. It is a bit hard to WRITE how to do it. Example: Once your data file is open, go to Menu->Transform->Into Same variables ... (as in #1 above) or Menu->Transform->Into Different variables ... (as in #2 above) As I said, it's hard to write all the steps. One way is: Menu->Transform->Into Same variables ... select AGE and move to right_hand box. click on "Old and new values" click on "Range" fill "0 through 49" in the "new value" box write "1" then click on "Add" etc. (I have version 11.0)
Read Full Discussion Thread for this article