Announcement

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

  • #16
    You don't say what methods you tried. I would be a little surprised if they all had the exact same problem. Like Maarten, I suspect the problem is somewhere on SPSS's side. Or the data set isn't what you think it is; or you are making a consistent error with your commands. But if you want to try one more free method,

    https://gallery.shinyapps.io/rioweb/

    SPSS itself should be able to save in Stata format. I also like stat/transfer (costs money, but can be worth it if you need to do a lot of data conversions). I also like usespss. To get it, from within Stata type

    net from http://radyakin.org/transfer/usespss/beta
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

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

    Comment


    • #17
      Originally posted by Victor Lopez View Post
      Hi guys,

      I have tried all of the options above but none of them work.

      When I save an SPSS file to stata, only the first 1000 observations appear on stata. Does anyone know why? How can I solve the issue?

      Thanks in advanced!!
      I am unable to duplicate the problem using Stata 15.1 (IC).

      Code:
      * SPSS syntax to generate a dataset with 1,000,000 observations.
      NEW FILE.
      DATASET CLOSE ALL.
      MATRIX.
      SAVE (TRUNC(UNIFORM(1000000,4)*5) +1)/OUTFILE * /VARIABLES=x a b c.
      END MATRIX.
      DESCRIPTIVES ALL.
      * Results show n = 1,000,000 for all variables.
      * Export data to .dta file.
      SAVE TRANSLATE OUTFILE='C:\Temp\DataFromSPSS.dta'
        /TYPE=STATA
        /VERSION=14
        /EDITION=INTERCOOLED
        /MAP
        /REPLACE.
      Code:
      . clear *
      
      . use "C:\Temp\DataFromSPSS.dta"
      
      . summarize
      
          Variable |        Obs        Mean    Std. Dev.       Min        Max
      -------------+---------------------------------------------------------
                 x |  1,000,000    2.997973    1.414668          1          5
                 a |  1,000,000    3.000221    1.414363          1          5
                 b |  1,000,000    3.000429    1.414036          1          5
                 c |  1,000,000    2.998325     1.41399          1          5
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 18.5 (Windows)

      Comment


      • #18
        Hi guys,

        Thanks for your responses.

        I have tried all of the above options but I still can't get around the problem. While I should have over 50,000 observations, I cannot see all of them.

        The conversion sites (the free ones) don't work because the file is too large and thus cannot be uploaded.

        When I save the SPSS file to a stata file and then open it on stata, I can only still see the first 1000 observations. My stata version is the 64 bit 2015 one.

        You may find the dataset I used in the following link

        https://drive.google.com/open?id=1_N...vOGdSc7c87Gu29

        As you can see, SPSS shows all of the observations.

        If you find a solution to the problem, please let me know.

        Thank you in advanced!!

        Comment


        • #19
          I just downloaded the file and opened it with usespss, I got

          Code:
          . des
          
          Contains data from C:\Users\rwilliam\AppData\Local\Temp\ST_03000001.tmp
            obs:        38,201                          
           vars:           392                          
           size:   103,944,921
          Stat/Transfer was less kind, saying the number of encoding errors exceeded the user-defined limit. I don't really understand this and didn't bother to find out.

          PSPP, an SPSS pseudo-clone, opened it without problems, and again said 38,201 cases.

          So, have you tried usespss, like I suggested above? There does seem to be something weird about the file, but usespss seems to be able to handle it (although I would check as much as I could to make sure results aren't getting lost in translation).
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

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

          Comment


          • #20
            I did get Stat/Transfer to read it ok by telling it to use the unicode character set.

            So it seems like it can be done. Do you maybe have small stata? They don't even sell it anymore, but I see that it had a limit of 1,200 cases. Type -help limits- and see what it says about # observations.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

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

            Comment


            • #21
              I downloaded the file from the link in #18, opened it with SPSS, used SAVE TRANSLATE in SPSS to save it as a .dta file, then opened it with Stata. All records were there.

              Here is my SPSS syntax:
              Code:
              NEW FILE.
              GET FILE "C:\Temp\EH2017_Persona.sav".
              COMPUTE RecNum = $CASENUM.
              FORMATS RecNum (F8.0).
              DESCRIPTIVES RecNum.
              * Output shows maximum RecNum = 38201.
              * I.e., there are 38201 records in the file.
              * Save to .dta file (version 14, intercooled).
              SAVE TRANSLATE OUTFILE='C:\Temp\EH2017_Persona.dta'
                /TYPE=STATA
                /VERSION=14
                /EDITION=INTERCOOLED
                /MAP
                /REPLACE.
              And here is my Stata code with output:

              Code:
              . * NOTE:  I am using Stata 15.1 (IC).
              . clear *
              
              . use "C:\Temp\EH2017_Persona.dta"
              
              . summarize RecNum
              
                  Variable |        Obs        Mean    Std. Dev.       Min        Max
              -------------+---------------------------------------------------------
                    RecNum |     38,201       19101    11027.82          1      38201

              Finally, note that Richard W and I both report that the SPSS file has 38,201 observations. Where are you getting the 50,000 figure you mentioned in #18?

              HTH.
              --
              Bruce Weaver
              Email: [email protected]
              Version: Stata/MP 18.5 (Windows)

              Comment


              • #22
                OK, there seem to be at least 3 ways to make the file Stata ready. Use SPSS; use -usespss-; and Stat/Transfer. Victor seems to have access to the first two options. If he can't get them to work, I suspect he has small Stata or there is something wrong with his Stata installation.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                StataNow Version: 19.5 MP (2 processor)

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

                Comment


                • #23
                  To Richard's point in #22, Victor, please execute the -about- command and share the first 3 lines of output. Here's what I get when I do it:

                  Code:
                  . about
                  
                  Stata/IC 15.1 for Windows (64-bit x86-64)
                  Revision 08 May 2018
                  Copyright 1985-2017 StataCorp LLC
                  --
                  Bruce Weaver
                  Email: [email protected]
                  Version: Stata/MP 18.5 (Windows)

                  Comment


                  • #24
                    My stata version is the 64 bit 2015 one.
                    Code:
                    . ssc install usespss
                    . usespss test.sav
                    This command works only in 32-bit Stata for Windows
                    Your operating system is: Windows
                    Your machine type is: PC (64-bit x86-64)
                    Make sure to install the beta version, it works also on 64 bit.
                    Code:
                    . net from http://radyakin.org/transfer/usespss/beta
                    . usespss test.sav
                     
                    usespss is converting file test.sav
                    Last edited by Simon Kaiser; 12 Jun 2018, 11:34.

                    Comment


                    • #25
                      Somewhat resurrecting the conversation because it is solving an issue I have...

                      Originally posted by Simon Kaiser View Post
                      Make sure to install the beta version, it works also on 64 bit.
                      I already have the non-beta version of usespss installed but my computer is 64-bit, is there any reason not to do a force installation of the beta version (and thus replace the already-installed files)?

                      Comment


                      • #26

                        Hi! The databases with which I work are originated from spsss. But I have always used the usespss command and that's it. But this week all the bases I try to open return error 3598. stata(): 3598 Stata returned error usespss_convert(): - function returned error <istmt>: - function returned error r(3598); What can I do to open my file? I have tried several * .SAV and the result is the same. I will appreciate your response and helpe.

                        Comment


                        • #27
                          The version I have (-which usespss-) is 2.0.1. My guess would be that you either have an older version of -usespss-, or your installation has become corrupt, so you could re-install. Perhaps the author can comment here as well. Take a look at:
                          Code:
                          net describe usespss, from(http://radyakin.org/transfer/usespss/beta)
                          If this looks good to you, you could install it:
                          Code:
                          net install usespss, replace from(http://radyakin.org/transfer/usespss/beta)
                          This has long been marked as a beta version, but it has worked fine for me.

                          Comment


                          • #28

                            Thanks, I'll prove it.

                            Comment


                            • #29
                              I did it:

                              net install usespss, replace from(http://radyakin.org/transfer/usespss/beta)
                              checking usespss consistency and verifying not already installed...
                              all files already exist and are up to date.


                              But I can not open the bases.

                              Comment


                              • #30
                                I don't know what you mean by "open the bases." Do you mean "usespss can't translate the files for me?"

                                It sounds like the install did not replace your old installation. Look at -help net install-. Perhaps you need the -force- option, or, alternatively, you need to first uninstall your current version of -usespss- so that a version can be installed. If this doesn't help you get a version of -usespss- that works, I don't know what to tell you.
                                One last thought: Perhaps you are trying to open some newer SPSS files that -usespss- cannot handle. You didn't say what version of SPSS files you were trying to open. You might try -usespss- on some older SPSS files to see if that works.

                                Comment

                                Working...
                                X