Recode values to random number

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

Recode values to random number

winterversion
Hello.  Is there an easy way to recode the values of a variable to random
numbers?  I am trying to de-identify elements of a dataset.  For example, if
you had a long list of zip codes that you want to recode to some random
number.  Is there any easier way to do it instead of having to manually
recode every single zip code?

Thank you in advance!



--
Sent from: http://spssx-discussion.1045642.n5.nabble.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: Recode values to random number

Jon Peck
You can just do a compute like
compute id = rv.uniform(0,1).

But if you want this to be reversible (by you), you might consider the SPSSINC ANON extension command, which you can install from the Extensions > Extension Hub menu.  It can create a mapping file that you can use to recover the original values.  It provides three ways to anonymized data values (sequential, random, and transform), and can optionally assign random names for the anonymized variables.

SPSSINC ANON appears on the Transform menu after installation.



On Fri, Feb 5, 2021 at 2:13 PM winterversion <[hidden email]> wrote:
Hello.  Is there an easy way to recode the values of a variable to random
numbers?  I am trying to de-identify elements of a dataset.  For example, if
you had a long list of zip codes that you want to recode to some random
number.  Is there any easier way to do it instead of having to manually
recode every single zip code?

Thank you in advance!



--
Sent from: http://spssx-discussion.1045642.n5.nabble.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


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