In SPSS, is it possible to export a dataset file to .CSV with value names instead of value numbers?

In my SPSS file, I have a variable called "X". It has four meanings: 1 = "dog", 2 = "cat", 3 = "hyena", 4 = "parrot".

If I export my data to a .CSV file, here is what it looks like:

X 1 2 3 4 

I want the exported .CSV to look like this:

 X dog cat hyena parrot 

Is it possible?

+7
source share
3 answers

Yes, it is possible (at least in SPSS 20). In the File menu, select "Save As ..." in the pop-up menu in the dialog that opens, select "Save as type: Comma (* .csv)", and select "Save Value" labels at the bottom, where they are defined instead of values data "(or press" Alt-a ") and select" Save. "

+11
source

Other answers relate to the graphical interface, but some prefer to use a syntax editor. If you fall into this category, from a programming point of view, you can do something like:

 SAVE TRANSLATE OUTFILE='path\to\file.csv' /TYPE=CSV /MAP /REPLACE /FIELDNAMES /CELLS=LABELS. 

Note the last line, /CELLS=LABELS. - If you want to use the values ​​instead, you can change them to (surprise!) /CELLS=VALUES.

+12
source

In my version of SPSS (17) in the save window there is a checkbox β€œSave value labels if they are defined instead of data values”, which will save the accompanying labels, not numerical values.

+3
source

All Articles