Change must come from within.
August 16, 2007 3:58 AM   Subscribe

SPSS-filter: How can I change the same property field of all my variables simultaneously?

I have 5 databases (don't ask) with a total of nearly 200 respondents and almost 750 variables. The databases contained identical variables in Excel. While importing them from Excel to SPSS the width and type didn't all stay the same for each variable. As a result, SPSS can't merge them to one large database.

I could copy-paste the same value for the two changed fields in each dataset, but that would mean control-v-ing almost 7500 times. Surely, there must be an easier, more automated way?

As a last resort, I could keep the 5 databases seperately and perform all analyses 5 times, but I'd prefer the most efficient way. Time is unfortunately running out, as I've already wasted a week getting the data displayed correctly in Excel. (Curse you, PHPSurveyor!)

Disclaimer: I'm a SPSS novice, so my apologies if this is a very simple question, but I really can't find the answer.
posted by lioness to Computers & Internet (4 answers total)
I don't have SPSS on this computer, so I am working off of memory here.

You could try importing the first Excel spreadsheet, but instead of clicking on 'OK', click on 'Paste'. This puts the syntax to bring the Excel file into a SPSS syntax file. Copy the code, and paste it after the first set of code. Change the name in the 'Get File' statement to the second Excel file. Do this for files 3, 4 and 5. Hopefully, the format that SPSS chooses for the first will be preserved in the code for files 2-5. Select the entire file, and run the code (there's a button in the toolbar that looks like a little triangle pointing to the right).

I hope my memory isn't too wonky. Good luck!
posted by naturesgreatestmiracle at 4:19 AM on August 16, 2007

naturesgreatestmiracle's solution seems sound (also working from memory here, my student license has expired). However, what I would do is copy & paste the excel sheets together in Excel, then import THAT.

By the way, the code referred to above is called "syntax" in SPSS, so in case his/her instructions aren't clear, you'll be pasting to and running a syntax file.
posted by desjardins at 6:06 AM on August 16, 2007

Above sounds like a great solution. But in case you have different variable types so that you can't merge in Excel (list-wise crossed with long format, for example), you can just set one cell in SPSS to what you want, and copy and paste the info to all the other cells. Just highlight the whole column and paste--takes little time.
Good luck.
posted by jujube at 6:42 AM on August 16, 2007

naturesgreatestmiracle, I bet your solution is perfect for anyone who has worked with SPSS before, but I really have zero experience. Still marked as best answer, because it looks like the 'proper' way to solve my problem.

desjardins, I merged the files in Excel, imported them again and it works. So you get marked best answer for an easy work-around solution that works perfectly.

jujube, your solution would have worked, and in very little time, as you indicated. I already solved the problem with desjardins suggestion, but you also get marked as best answer, because you had the simplest and fastest solution.

Thank you all very much, you've saved my sanity! (And I mean that almost literally, I nearly went crazy!)
posted by lioness at 2:26 PM on August 16, 2007

« Older Name that pain!   |   Avoiding duplicate frames while encoding VCR... Newer »
This thread is closed to new comments.