Announcement

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

  • Stata 18 SPSS Export

    Dear all,

    Does anyone have experience with the new SPSS export function? Unfortunately, some errors have occurred with my exports so far, i.e.

    1) Decimal places are not transferred correctly. A number with 2 decimal places in Stata is shown in SPSS with 0 decimal places. However, this only refers to the display, the calculation with the variable is still correct and the display can be adjusted manually (still annoying).
    2) A date is added to a time variable by the export. For example, instead of 12:35:16 in Stata, the SPSS dataset shows 1-Jan-1960 12:35:16,00

    Do you have any suggestions for a solution -maybe there is a workaround that I haven't thought of yet - or have you encountered similar problems?

    regards,
    caro

  • #2
    Let me just get back up on my soap box for a minute: Converting data from one proprietary platform to another is not trivial. The fact that this works at all represents a substantial effort on the part of the Stata team working with a public interface developed by a completely different team at SPSS. The two teams probably don't talk to each other and there is no guarantee the SPSS proprietary format public documentation is complete - I'm not sure public documentation even exists.

    So what's happening here?

    1. Sounds like the data is transferred correctly, but the meta data that tells the software how to format the data in the viewer isn't. That's not really a bug, just an unimplemented feature - one that may or may not be unrealistic to implement - depending on the underlying SPSS standard.

    2. Stata has a date and time type. If you give it just a time, then ask for a time only format in the output, it will hide the date portion from you, and will use the unix epoch (Jan 1st, 1960) as the default date. SPSS works the same way (it has a single type for date/time variables). It doesn't hide Jan 1st, 1960 from you because (as in 1) the formatting meta data isn't transferred between platforms.

    Do you have any suggestions for a solution -maybe there is a workaround that I haven't thought of yet
    Some of these problems might be handled properly if you use an interchange format. Basically, an interchange format is a standard external to both platforms that both platforms know how to read in a way that is convenient to the user. A .csv might work well, but won't necessarily transfer all of the formatting metadata either. You might have better luck with a .xlsx since it supports more formatting data than a plan text file. That said, the .xlsx might have its own problems (it is also a proprietary format) so I recommend a .csv to transfer tabular data between platforms.
    Last edited by Daniel Schaefer; 22 Jan 2024, 13:23.

    Comment


    • #3
      I agree with everything in #2. Here's another thought. SPSS can read Stata data sets directly. So instead of exporting from Stata to SPSS, have you tried just opening the Stata data set in SPSS? That might solve some or all of these problems.

      Comment

      Working...
      X