Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata 15: SPSS to Stata export drops all label values?

    Hey all

    I have a large dataset saved in SPSS, in which one particular variable has a 5 digit code. Now that 5 digit code not only is an expression on its own, let's say, a town or a city, but a range of those values represent an area

    So for example, 01000 to 02999 represent towns and villages in a particular state
    03000 to 09999 are another state

    and so on, till, let's say 99999

    Now if I go to the SPSS variable view, each of these values are defined i.e each five digit code has the name of the village or town against it

    Now I need to export this data to Stata, my problem is that the import spss command does not work for Stata 15

    I tried saving the dataset in .dta format in SPSS and opening it in Stata, but the labels are gone. Any suggestions?


  • #2
    Although you did not say this, I'm guessing that your variable is stored as a string in SPSS, with value labels assigned that contain the town/village name. Unlike SPSS, Stata does not allow string variables to have value labels, so you would need first to create a numeric version of this variable in SPSS, while retaining the value labels, so that you'll have a labeled version of the variable in Stata. I think the SPSS command AUTORECODE will do that, but I'm not sure, as I have not used SPSS in a long time and don't have access to it.

    Comment


    • #3
      Thank you Mike. You pointed a big error in my thinking!

      For everyone's reference, I changed the code to scalar data in the variable view (first convert it into numeric data) - export it and you're pretty much done.

      Comment

      Working...
      X