Exporting SPSS variable labels
Asked Answered
D

3

5

I am using Stata for data analysis but had to convert the dataset I am using from SPSS, which includes variable labels, by saving it as a .csv file. However, the variable labels were not exported to Stata in the process.

I have followed the advice in this question (In SPSS, is it possible to export a dataset file to .CSV with the value names instead of the value numbers?) but this one only refers to the value labels, not the variable labels.

How do I export the SPSS variable labels?

Disseisin answered 24/4, 2017 at 5:15 Comment(2)
If you have access to StatTransfer, that will be able to transfer the data labels for youFishbolt
Using OMS. See here: #43524733Laodicea
F
5
  1. 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.
  2. You can export the contents of the output window into formats understood by other software, including html, txt, xls.
  3. Then you can extract the labels from the exported file and re-format them for use in Stata. I would use txt export and a Python script to produce a Stata program.
Feininger answered 3/9, 2021 at 9:30 Comment(1)
Please translate German to English; this is an English-only site.Ashanti
L
1

You can not do it with csv. In SPSS with save as (instead of export data) you can save your dataset as dta, in Stata format. Just chose the most recent Stata format your SPSS knows. I think then you have both the value labels and the variable labels.

Lewandowski answered 24/4, 2017 at 18:54 Comment(0)
R
1

I realize this is an old question, but just in case someone else is looking for how to do this.

If you export your SPSS file to Excel, there is an option to save variable labels instead of variable names as the column headers. It's clunky, but you can:

1) Export to Excel once with variable names,

2) Export to Excel once with variable labels

3) Paste special -> transpose the two next to each other

And you'll get a crosswalk from variable name to variable label

Rabjohn answered 9/4, 2018 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.