|
Hello, I have a multi valued field that comes in
looking like the following: TR TRýCD TRýCDýCDýCDTR TR TRýCD TR PE TRýPE JSýTRýCDJS Can someone tell me which function will
get me the position of the first occurrence of ý from the right. I have tried
INDEX,RINDEX but this does not do it. Thank you Barbara |
|
Dear list,
I have two variables, (1) Chile (Chile coded as 14) and (2) Argentina (Argentina coded as 15),
I would like to combine them into one variable called Country (and recode them into Chile =0 and Argentina =1).
Can someone suggest syntax for doing this,
All suggestions are appreciated,
Stace
|
|
Not sure what your variable name is for the
country, but something like...
compute country = 2.
if chile = 14 country = 0.
if argentina = 15 country = 1.
val lab 0 'Chile' 1 'Argentina' 2
'Other'.
freq country.
|
|
Stace
No problem. Pleased to be of help.
Check me out on:
You can find all my SPSS learning materials
on:
There's loads more in preparation: keeps me from
going senile in retirement.
John Hall
|
|
Administrator
|
In reply to this post by Lombardo, Barbara
This worked for me (version 17.0.2, Windoze XP Pro). data list list / stringvar (a15). begin data TR TRýCD TRýCDýCDýCDTR TR TRýCD TR PE TRýPE JSýTRýCDJS end data. compute pos = char.rindex(stringvar,"ý"). format pos (f2.0). list. Output (best viewed with a fixed font): stringvar pos TR 0 TRýCD 3 TRýCDýCDýCDTR 9 TR 0 TRýCD 3 TR 0 PE 0 TRýPE 3 JSýTRýCDJS 6 Number of cases read: 9 Number of cases listed: 9
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
| Free forum by Nabble | Edit this page |
