Announcement

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

  • SPSS syntax into Stata do-file

    Dear all,

    I would like to transfer a SPSS-syntax
    Code:
    SPSS Statistics Syntax File (.sps)
    into a Stata do-file. I tried using the programme Stat/transfer (but only .sav documents are allowed), I tried saving the syntax in SPSS as another format (but only .sps allowed) and when I googled and read this forum I only found tricks to convert .sav files from SPSS to Stata, which is not what I am looking for. Does anyone have a suggestion how to format the SPSS syntax to a proper Stata do-file?

    Thanks in advance,
    Mariska


  • #2
    I think this needs a human being who knows both languages. I don't know of any translation programs. Transfer of datasets is as much as any program offers.

    Comment


    • #3
      Haha thanks Nick, but this human being was hoping that some other intelligent human being had come across this issue and had figured out a handy tool for this . It was worth trying!

      Comment


      • #4
        Nick has answered this question. As a short addition, do not waste time trying to save files with different extensions (i.e. .sps, .do, .foo). Technically, these are all plain ASCII text files and the fact that Stata will open and show the contents of an SPSS syntax file, saved as .do, does by no means imply that Stata understands this file in terms of commands to execute.

        Best
        Daniel

        Comment


        • #5
          I was serious and took the question seriously. After all, there was no point to your asking if you thought otherwise. To develop this further, I fear that

          1. a non-trivial translation program would require there to be a much closer resemblance between SPSS syntax and Stata syntax than there is.

          2. few Stata users with programming experience also use SPSS.

          Comment


          • #6
            Actually, I think a non-trivial translation program would be a rather major artificial intelligence project. Apart from the differences in syntax between the two languages, there are commands in both that have no exact semantic equivalent in the other and require the construction of "paraphrases" that capture the intended meaning. I don't expect to see that kind of program any time soon.

            Comment


            • #7
              When I 'migrated' from SPSS to Stata I bumped into below project once. Quite soon figured out it was probably quicker, easier and more useful to learn the new language by looking to 'translate' or redo specific analyses. If you have some specific tests you are looking to do, people could help out, although I guess more likely so when you explain what you're after in words rather than SPSS syntax.

              http://www.bristol.ac.uk/cmm/software/statjr/

              Comment


              • #8
                As a one-time long-time SPSS user, I'd be more optimistic on the ease of translation. At least as SPSS existed 10 years ago, there was nearly a one to one correspondence for most common Stata commands. People who know the syntax of both languages are fairly common among quantitative sociologists aged 55 or so and above. Another population with relevant skills would be graduate students who work part-time in statistical user support at major U.S. universities. Someone like that might work for an affordable price, and someone clever might be able to do it pretty fast with a good text editor. Now, if this stuff involves things such as SPSS's newer output handling features, I can't speak to that. I think it's worth posting more detail about the size and the nature of the task, as someone here might know someone who would be interested in taking it on, at some price. (Summer break is upon us here in the U.S. and graduate students are short on cash :-})

                Regards, Mike

                Comment


                • #9
                  This might give you a fighting chance:

                  http://www.ats.ucla.edu/stat/stata/f...d_to_stata.htm

                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #10
                    Mariska may want to clarify what sort of SPS file she has. In many cases that turns out to be just a machine generated labels file. In that case attempts can be made to automate the process.

                    Stataspss.exe is translating from Stata to SPSS:
                    http://radyakin.org/transfer/stataspss/stataspss.htm

                    SASdecoder should transfer from SAS to Stata.

                    If this is a generic SPSS script, then good luck with that. Even for simpler tasks you stop at the differences in implementation or definitions. Common example is quintiles, which was discussed already multiple times in the forum.

                    Perhaps posting the SPSS script will produce more helpful suggestions.

                    Best, Sergiy Radyakin

                    Comment


                    • #11
                      Dear all,

                      Thank you for your helpful recommendations. As I used both the website from Richard for more detailed information and the website from Sergiy, I managed to get my SPSS file into a Stata file. So learned a lot again!

                      Regards,
                      Mariska

                      Comment


                      • #12
                        Hello Mariska!

                        I seem to be running into the same problem that you had. How did you finally go about uploading your .sps file into Stata?

                        Much appreciated,
                        Taylor

                        Comment

                        Working...
                        X