Hi guys
I'm trying to figure out if there is an easy way of combining my variables to create a new one, rather than doing it all manually. I have 3 variables (first two letters of mothers maiden name, day of birth, and last two digits of phone number) for each participant. Put together, I want to produce a unique 6-digit code for each participant. Does anyone know how this is possible? I'm wondering if it's in 'commute variables' but can't find anything suitable?
Purpleflower x
======= Date Modified 26 Mar 2012 14:16:51 =======
======= Date Modified 26 Mar 2012 14:15:37 =======
I'm not sure if there's a way you can do it in SPSS... but there certainly is in Excel, using the CONCATENATE function (http://spreadsheets.about.com/od/excelfunctions/qt/07-concatenate.htm)
I normally arrange all my data in Excel precisely how i want it in SPSS and then open the .xls file through SPSS (if that makes sense) as i tend to find SPSS doesn't do most of the things i want. Also, doing it this way, SPSS won't override the data in your .xls file so you can always reopen your original dataset if SPSS has a paddy (which i find it does sometimes).
Afraid i don't know what commute variables means... However, a quick google finds this: http://www.slideshare.net/ay17071951/using-spss-tranform-variable-compute-presentation which might help you do it within SPSS itself.... but i'm not sure. I think it takes "compute" to mean "do computations on" rather than just a simple text transform.
I can't think of a way in SPSS but if you copy and paste into Excel it can be done there and then copied back. This link shows how it works, but basically if you have "name" in cell A1 "day" in cell A2 and "digit" in cell A3 to combine them you'd type =A1&A2&A3 into cell A4.
http://www.youtube.com/watch?v=P6NDbViRQW4
There is also a concatenate function in SPSS (now what I know what it's called I could google it!) I just tried to make it work and it came up with errors that I don't understand. But if you look it up it may work for you.
I used Excel in the end, but CaitlinBond's right, it can be done in SPSS also. If anyone needs to do this in the future here it is:
If your three variables are string variables ... then they can be concatenated to a six digit string variable using the concat function i.e. Transform >>> Calculator >>> then it would be Concat(variable1, variable 2, variable 3) ... concatenation will only work with string variables ... =Concatenation() in Excel should work with either string/text variables or with numeric/scale variables.
Cheers guys :-)
PostgraduateForum Is a trading name of FindAUniversity Ltd
FindAUniversity Ltd, 77 Sidney St, Sheffield, S1 4RG, UK. Tel +44 (0) 114 268 4940 Fax: +44 (0) 114 268 5766
An active and supportive community.
Support and advice from your peers.
Your postgraduate questions answered.
Use your experience to help others.
Enter your email address below to get started with your forum account
Enter your username below to login to your account
An email has been sent to your email account along with instructions on how to reset your password. If you do not recieve your email, or have any futher problems accessing your account, then please contact our customer support.
or continue as guest
To ensure all features on our website work properly, your computer, tablet or mobile needs to accept cookies. Our cookies don’t store your personal information, but provide us with anonymous information about use of the website and help us recognise you so we can offer you services more relevant to you. For more information please read our privacy policy
Agree Agree