string to number but in structured sequence

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

string to number but in structured sequence

Maguin, Eugene

Probably not an uncommon problem, so is there a better way.

I’ll be getting an excel format file in which the survey item responses are text strings. (Can the originating software provide numeric codes rather than the text string? Answer is believed to be No.) Nearly all the items have predefined response sets. Some are yes/no, others are 5 or 7 point likert type, and others are a numbered list of options. Predefined means per the survey. Functionally, I have to go from alpha string to numeric value.

 

I thought of Autorecode but I think Autorecode has to be ruled out because it numbers responses per sort order. However, Autorecode has a template subcommand. So a question is whether I could write a template file that matches the codebook. One other bit of information. I’ve read the codebook into spss so that for each item i have four variables: item number, variable name, item text, and response options in option number-option text format. I think that with a “little” restructuring I could put the response options into the structure shown in the example.

 

If Autorecode won’t work, are there any other methods to do what I describe?

 

Thanks, Gene Maguin

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: string to number but in structured sequence

David Marso-2
What is wrong with RECODE?

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: string to number but in structured sequence

Jon Peck
AUTORECODE has a number of advantages over RECODE when doing a 1-1 mapping.
You can save a template file (which gets extension sat) and then edit it in the Data Editor.  It is actually a regular sav file, but don't change the structure when you edit.  Be sure to close the file before using it as input or having AUTORECODE update it.

- AUTORECODE automatically generates value labels based on the input value labels or values.
- The sat file can be referenced in different job streams as appropriate - define a file handle at the top, and then the rest of the syntax need not change.
- AUTORECODE can print a map of the recode, and it is easier to read than RECODE syntax.
- The GROUP subcommand allows to create a combined recode mapping across a whole set of variables.


If you have user missing  values, read the details of how these are handled in the CSR.

On Thu, Apr 11, 2019 at 9:24 AM David Marso <[hidden email]> wrote:
What is wrong with RECODE?

=====================
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


--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: string to number but in structured sequence

hillel vardi
In reply to this post by Maguin, Eugene
Shalom

you can use vartocases to create a long file
then match the long file with the codebook
finally use caesestovar to get the working file



On 11/04/2019 17:01, Maguin, Eugene wrote:

Probably not an uncommon problem, so is there a better way.

I’ll be getting an excel format file in which the survey item responses are text strings. (Can the originating software provide numeric codes rather than the text string? Answer is believed to be No.) Nearly all the items have predefined response sets. Some are yes/no, others are 5 or 7 point likert type, and others are a numbered list of options. Predefined means per the survey. Functionally, I have to go from alpha string to numeric value.

 

I thought of Autorecode but I think Autorecode has to be ruled out because it numbers responses per sort order. However, Autorecode has a template subcommand. So a question is whether I could write a template file that matches the codebook. One other bit of information. I’ve read the codebook into spss so that for each item i have four variables: item number, variable name, item text, and response options in option number-option text format. I think that with a “little” restructuring I could put the response options into the structure shown in the example.

 

If Autorecode won’t work, are there any other methods to do what I describe?

 

Thanks, Gene Maguin

===================== 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


בלי וירוסים. www.avast.com
===================== 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