Sunday, June 17, 2012

3 Ways of Loading SPSS (sav) files into Stata

1. The easiest and most straightforward way is using the user written package usespss.

  This package however only works for 32 bit windows.

2. The next easiest method if you have it available is using StatTranfer which allows for the conversion of many types of files from one format to another:

  A license could be had for as little as $59 if you are a student.


3. The last option takes a few more steps but is free.

  a. First install R

  b. Next install the package Rcmdr from the Package Menu by selecting "Install Packages" [Packages>Install Package(s)>Select Closest Mirror>Rcmdr].

  c. Next open up the Rcmdr package by going to the menu [Packages>Load Package...>Rcmdr]

 d. When Rcmdr loads it should load the R Commander window.  Select from the menu [Data>Import Data>from SPSS data set]

 e. Name your data set Data1 [select 'ok'], now find your sav file.

 f. If there has been no problem up to this point you should now have a data set in memory called Data1.

 g. Now you can export to a dta file with the following command:
write.dta(Data1, "File Directory/File Name.dta")

(In R you need to specify directory dividers as either / or \\ not \.)

3 comments:

  1. You can do the R method as an ado file (at least on Mac/Linux, not sure about Windows)
    http://codeandculture.wordpress.com/2010/06/29/importspss-ado-requires-r/

    ReplyDelete