![]() |
||
Converting Files Across Formats With StatTransferStatTransfer 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 ConversionsBasic 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: 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: 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:" "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: Once we're done here specifying the input file type and specification, we should see the following: "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: [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: 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: Other StatTransfer Options and FeaturesYou'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: 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: 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. 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: 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). 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"): 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" 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
|