|
Hi,
Can someone help me with the necessary syntax to convert 901-24 to the number 1, 902-24 to the number 2, etc? TIA, Leah |
|
Open a new instance of SPSS. Copy the syntax below to a syntax file.
Click <run>. Click <all>. Is this what you are looking for? data list list/ mystring (a6). begin data 901-24 902-24 ab3-xx --5mmm end data. numeric mynumber (f1). compute mynumber= number(substr(mystring,3,1),F1). LIST . Art Kendall Social Research Consultants leah rubin wrote: > Hi, > > Can someone help me with the necessary syntax to convert 901-24 to the > number 1, 902-24 to the number 2, etc? > TIA, > Leah ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants |
|
Open a new instance of SPSS. Copy the syntax below to a syntax file. Click <run>. Click <all>. Is this what you are looking for? data list list/ image_v1 (a6). begin data 901-24 902-24 903-24 9 11 19 25 31 34 39 48 51 54 58 76 77 80 84 86 88 89 92 93 96 98 100 108 113 119 122 125 137 141 150 153 161 166 168 171 end data. numeric IMAGE_V1_R (f2). RECODE IMAGE_V1 ('901-24' = 0)('902-24' = 1)('903-24' = 2)('9' = 3)('11' = 4)('19' = 5) ('25' = 6)('31' = 7)('34' = 8)('39' = 9)('48' = 10)('51' = 11)('54' = 12)('58' = 13)('76' = 14) ('77' = 15)('80' = 16)('84' = 17)('86' = 18)('88' = 19)('89' = 20)('92' = 21)('93' = 22)('96' = 23) ('98' = 24)('100' = 25)('108' = 26)('113' = 27)('119' = 28)('122' = 29)('125' = 30)('137' = 31) ('141' = 32)('150' = 33)('153' = 34)('161' = 35)('166' = 35)('168' = 36)('171' = 37)('173' = 38) INTO IMAGE_V1_R. autorecode variables = image_v1 /into image_v1A /print. LIST . Art Kendall Social Research Consultants leah rubin wrote: Dr. Kendall, |
| Free forum by Nabble | Edit this page |
