Converting Files Across Formats With StatTransfer

StatTransfer is a very useful tool for converting data files across formats. While the Data Gods are often mercurial and unforgiving, StatTransfer can be a loyal and invaulable friend. It can read and transfer data to and from various statistical packages (e.g. SAS, SPSS, Stata), spreadsheet and database formats (e.g. Excel, Access, DBF), and delimited text file (e.g. .csv files). StatTransfer is both simple and powerful - it is very easy to use, and it also provides a variety of options for dealing with the quirks and personality traits of different formats. This guide provides an introduction to file conversions, with some additional discussion of its more specific features and links to additional StatTransfer guides. Users who want more detail should consult StatTransfer's technical documentation.


Basic File Conversions

Basic file conversions in StatTransfer are very straightforward. Say, for instance, that we have a data file in SPSS that we wish to use in Stata:



Click Here for Full-Size Image

We can get the data from SPSS into Stata in a few easy steps. First, open up StatTransfer. The version we're using here is StatTransfer 8, but the interface for the program is pretty similar across versions, so you should see something like the following when you open the program up:



Click Here for Full-Size Image

The "Input File Type" box refers to the format of the file which you wish to convert into another format. If you browse through the list of available file types, you'll see that StatTransfer can handle data in many formats. In this case, our file is an SPSS data file, so we'll browse through the list of available file options and choose "SPSS Data File:"



Click Here for Full-Size Image

"File Specification," meanwhile, refers to the name and location of the file which you wish to convert. You can locate that file by clicking on the "Browse…" button towards the right and navigating to where you've saved the file that you wish to convert:



Click Here for Full-Size Image

Once we're done here specifying the input file type and specification, we should see the following:



Click Here for Full-Size Image

"Output File Type" and the 2nd "File Specification" box work pretty-much the same way as above, only here you're telling the program the format you want to transfer data into (Stata, in our example), where you want to save the new file, and what you want to call it:



Click Here for Full-Size Image

Click Here for Full-Size Image

[Note - by default, StatTransfer 8 will use Stata 8 as the default if you are converting data into Stata. You can change this default setting via the "Options (3)" tab, which is discussed below.]

By default, StatTransfer saves your new file in the same location as the original, but you're not required to do so. Here, we'll just go ahead and save the new Stata file in the same location as the original SPSS file. Once we're done making our choices here for the output file, we should see the following:



Click Here for Full-Size Image

Now, all we need to do is click on the "Transfer" button. StatTransfer will perform the desired conversion, and we'll have a new data file for use in our desired statistical package:



Click Here for Full-Size Image

Click Here for Full-Size Image


Other StatTransfer Options and Features

You'll note that there are multiple buttons and tabs in the StatTransfer interface. We won't provide an exhaustive overview of them all here (and some of them may not be available if you're not using StatTransfer 8), but we will discuss some of them in brief. The "View" button, for instance, will open up StatTransfer's internal data viewer and let you browse through your input file:



Click Here for Full-Size Image

You probably will not need to use the data viewer that often. It can be useful, however, if you are working with something like an Excel file with multiple worksheets in it. With such files, StatTransfer will ask you to specify which worksheet you want, and you can use the data viewer to make sure you've chosen the correct sheet:



Click Here for Full-Size Image

Click Here for Full-Size Image

The "Variables" tab at the top, meanwhile, will let you see a full list of the variables in the original file that will be transferred over into your new file. This tab gives you the ability to select only certain variables for transfer - if you do not want a particular variable in your output data file, you can just uncheck the box next to it. This tab will also let you see what formats your variables are in and gives you the option of specifying a particular format for a particular variable (though you should proceed with caution here - experimentation in this area can lead to undesired and unexpected results). Similarly, the "Observations" tab will let you filter the data by values of particular variables, in case there you need only particular cases in your new data file. In effect, then, StatTransfer provides you with some capability for creating data in one format that are a subset of the data in the original format.



Click Here for Full-Size Image

Click Here for Full-Size Image

The "Options (1)" and "Options (2)" tabs, meanwhile, give you control over things such as how you want the program to handle particular variable formats and missing values, whether to automatically overwrite files, and how to read delimited ASCII files:



Click Here for Full-Size Image

Click Here for Full-Size Image

The "Options (3)" tab provides options specific to particular data formats. If, for example, you are transferring data into Stata, StatTransfer 8 will by default use Stata 8 as the output file type. If that's not what you want, however, you can tell StatTransfer which version of Stata you what the data in. Since Stata data files are not always backwards-compatible (e.g. Stata 7 cannot read Stata 8 or Stata 9 files), you should keep this option in mind. Similarly, if you're transferring data into SAS, you can tell StatTransfer which particular operating system you'll be using the data in; this is important because SAS can be picky about these things. This tab also provides you with options for how to handle value labels when you're transferring data to or from SAS (addtional guides are available for using StatTransfer to convert data to and from SAS).



Click Here for Full-Size Image

Click Here for Full-Size Image

[Note - the "Options (3)" tab and some of its functionality are new to StatTransfer 8 and were not in previous versions of the program.]

StatTransfer's "About" tab will let you check for updates to the program, which you can get free of charge assuming that your license is in order. Finally, don't forget that there is also a command-line interface for StatTransfer (the "Command Processor"):



Click Here for Full-Size Image

The Command Processor is a DOS interface for using StatTransfer. It is probably not something you will generally need to use, but it is helpful for some tasks such as doing batch conversions where you want multiple files in one format converted into a new format (e.g. multiple Excel files that you want to convert into Stata). StatTransfer's technical documentation will provide you with more guidance for using the Command Processor.


Other Guides for File Conversion

"Moving OSIRIS Data into Other Formats"

"Converting SAS Data Files into Other Formats"

"Moving SPSS or Stata Files into SAS"

"Using StatTransfer to Get ASCII Data into Stata"

"Tips On Using StatTransfer," UCLA Academic Technology Services

"SAS Frequently-Asked Questions: How Do I Convert Among SAS, Stata and SPSS Files?," UCLA Academic Technology Services

Once again, this is more an introduction to StatTransfer than a comprehensive review of it. If you need additional assistance in converting files across formats, feel free to contact the Data Center staff for assistance.



Home | Analyze Data Online | Help Resources | Contacts & Hours | Emory General Libraries