Announcement

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

  • Opening SAS, SPSS or ASCII data in STATA

    Dear Statalisters,

    I am trying to replicate a paper using the data provided here - https://www.icpsr.umich.edu/web/ICPS...adocumentation

    When I try to download this, I get the option to save a SAS, SPSS or ASCII version of the files. None of them seem to work when I import in STATA... I get a .txt file with 100 lines of jumbled letters every time - it should be a fairly large dataset of historical voting data.

    Is there any way to import and use this dataset in STATA? Any help would be much appreciated.

    Thanks in advance for your help,
    Vivek

  • #2
    What ICPSR offers there are ASCII files, likely in fixed format, with SAS or SPSS syntax to read them. Perhaps there is an option to download an SPSS or SAS native data file, but I sure didn't find it. If you haven't worked with fixed format ASCII files before, you have a fair amount to learn, and I'd recommend that you contact the ICPSR representative at the institution through which you have access to these data. (Every ICPSR member institution has such a person.) That person can point you to where to get help. To do this in Stata will require using the -infix- command, which is more quirky than most Stata commands. It's possible that if you are adept with a text processor, you *might* be able to use its commands to translate the SPSS or SAS data description into a format that would satisfy - infix-. If I'm wrong and there are native SPSS or SAS native data files available, post back here and there are other solutions.

    Comment


    • #3
      Thank you - I have been in touch with the ICPSR representative but to no avail - they do not seem to be able to advise me here. Is there anywhere I can learn about this infix command? or otherwise if there is a way to convert this data into a usable file type I would be very grateful.

      Comment


      • #4
        The obvious first place to look is in Stata: type help infix. Don't forget the pdf manual, which is more detailed. Mike is correct that infix can be a bit tricky, but I think you got scarred a bit too much by Mike's comments. It is perfectly doable with a little bit of patience.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Maarten is right here: I should not have said that the amount to learn is large, but rather that the documentation for reading fixed format is not as clear as most Stata documentation. (I say this as someone who spent the first 15 years or so of my data life reading fixed format files all the time.)

          Re your ICPSR local rep not offering much help: I've occupied that role, and while I wouldn't do all the work for a user with your problem, seeing that you didn't at least get pointers in the right direction is disappointing.

          Comment

          Working...
          X