Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

spss

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

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

X
1
2
3
4

I want the exported .CSV to look like this:

X
dog
cat
hyena
parrot

is this possible?

like image 680
user1626730 Avatar asked Dec 28 '12 22:12

user1626730


People also ask

How do I export value labels in SPSS?

You can export the variable labels using the DISPLAY DICTIONARY. SPSS syntax. You can also find this in the menu: File -> Display Data File Information -> Working File. A table with the category labels of all variables appears in the output window.

How do I export labels from SPSS to Excel?

It's right there in the SAVE AS menu - once you change the file type into Excel you have a checkbox option to "Save value labels where defined instead of data values".


2 Answers

The other answers relate to the GUI, but some people prefer using the syntax editor. If you fall into that category, from the programming perspective, you can do something like:

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

Notice the last line, /CELLS=LABELS. -- If you wanted the values instead, you can change it to (surprise!) /CELLS=VALUES.

like image 113
A5C1D2H2I1M1N2O1R2T1 Avatar answered Sep 20 '22 14:09

A5C1D2H2I1M1N2O1R2T1


Yes, it is possible (at least in SPSS 20). In File Menu, choose, "Save As...", in the drop down menu in the dialog box that opens choose "Save as type: 'Comma delimited (*.csv)')", and underneath that select "Save value labels where defined instead of data values" (or hit "Alt-a") and choose "Save".

like image 36
user765195 Avatar answered Sep 18 '22 14:09

user765195