Recoding numeric variable to string

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

Recoding numeric variable to string

Johnny Amora
A numeric variable X is recoded into string variable
XX.

For example, the values of x are recoded as follows:

lowest thru 10 should be recoded as easy
20 thru highest should be recoded as difficult
else should be recoded as average

How to do this using spss syntax?

Thank you.

John

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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
Reply | Threaded
Open this post in threaded view
|

Re: Recoding numeric variable to string

Albert-Jan Roskam
Hi,

This will probably work, or else you can also use
three IF statements.

string strvar (a10).
recode numvar (lo thru 10 = "easy") (20 thru hi =
"difficult") (else = "average") into strvar.

Cheers!!
Albert-Jan


--- John Amora <[hidden email]> wrote:

> A numeric variable X is recoded into string variable
> XX.
>
> For example, the values of x are recoded as follows:
>
> lowest thru 10 should be recoded as easy
> 20 thru highest should be recoded as difficult
> else should be recoded as average
>
> How to do this using spss syntax?
>
> Thank you.
>
> John
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.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
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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