I have string data like:
1/2/4
2/3/7
1/2/3/4/5
4/2/1
2
The numerals represent an affirmative answer to the items on a checklist. A 1 anywhere in the series means the participant answered yes to item 1. A pattern like 2/3/7 means the person affirmed items 2,3, & 7. Etc. So the strings vary in length and a numeral will only appear once in a string, but could be located in any position.
Is there a string function or some kind of wildcard character that would let me create an indicator variable coded 1 if a "1" appears anywhere in the string? I've not worked much with string variables. I've read through the string function section of the manual and don't see a function that would do that.Thanks.
1/2/4
2/3/7
1/2/3/4/5
4/2/1
2
The numerals represent an affirmative answer to the items on a checklist. A 1 anywhere in the series means the participant answered yes to item 1. A pattern like 2/3/7 means the person affirmed items 2,3, & 7. Etc. So the strings vary in length and a numeral will only appear once in a string, but could be located in any position.
Is there a string function or some kind of wildcard character that would let me create an indicator variable coded 1 if a "1" appears anywhere in the string? I've not worked much with string variables. I've read through the string function section of the manual and don't see a function that would do that.Thanks.
Comment