use13 - Stata module to import data in Stata 13 format into Stata 10-12
use13 will import to Stata 10-12 the Stata 13 files based on the specification 117 of the new dataset format released by StataCorp in 2013.
use13 facilitates data exchange between users who have not updated to
the new version of Stata and other users, who have Stata 13 already. Stata is
backwards compatible and all new versions read files produced with any previous
version. However older versions of Stata do not understand newer formats.
A proper way of sending data to older version is to use Stata's command
saveold, but it is only an
option for the data producer posessing Stata 13 already.
Here is what the users need to know about the assumptions and limitations of use13:
- All legacy types present in Stata 10 (byte, int, long, float, double, and str1...str244) are transferred without any loss of information or precision.
- Long strings (strF type) which are longer than 244 characters will be truncated to 244 characters (maximum allowed under Stata 10 file format specification 113). A warning is issued if this happens. Format of truncated string variables is set to %str244.
- Long strings (strL type) both ASCII and binary are dropped. use13 notifies the user about the variables that were dropped. There are plans to include them into the resulting file (in truncated form) in a subsequent version.
- Timestamps: every data file created with Stata (at least in the version 8 - version 13 range) contains a timestamp inside the file. This timestamp is in general different from the date/time of creation or modification as reported by the operating system. Timestamp is not disturbed by this conversion, which means the converted file will retain the original timestamp. Inside Stata a dataset's timestamp can be seen in the output of the describe command. Note that when an imported file is saved from Stata, it will get a new timestamp reflecting the date/time of that operation. This is Stata's normal behavior.
- File type 116 is not supported since they are declared "never released" by StataCorp, although one file of that type was spotted out in the wild. use13 will notify the user if the file is in format 116. There are no plans to support this file format due to lack of the documentation and example files.
- It is not clear at the moment whether there are any new variable formats in Stata 13 that might be applicable to legacy data types, but incompatible with earlier versions.
- Users of Stata 9 may further use the use10 command to downgrade the dataset to the format supported by Stata 9, but with the loss of the variable formatting expanded in Stata 10.
- The program has been tested on more than 100 datasets. Any discovered bugs or updates will be posted here if/when discovered.
- The program is tolerant to the bug in Stata, which could produce datasets with incorrect value of the variable labels offset at the file's map table. While Stata 13 has been fixed for this problem (see paragraph #2 in 02jul2013 update to Stata 13 here), datasets affected by it might still be in circulation.
To install use13 type literally the following in Stata's command prompt:
Then click on the link for -use13- in the Stata's viewer and click the -install- link.
The above installation instructions are sufficient in most cases when Stata is permitted
to access the Internet. To transfer files to a computer not connected or not permitted to
connect to the Internet, manually copy the files from the
To install use10 proceed to use10 page for instructions.
To import a file type the following command in Stata's command line:
Filenames with spaces or commas must be enclosed in quotes:
use13 "C:\My Data 13\auto.dta"
If your data in memory is modified, and you want to proceed anyway, specify option clear:
use13 "C:\My Data 13\auto.dta", clear
Web data is also accessible with this command:
Datasets accompanying Stata releases are available on Stata Press website.
To get information about the program, type:
Note that Stata's built-in file manipulation commands are not affected by use13,
and you will continue getting error 610 on attempt to use them with Stata 13 files. Read more
in this clarification.
I am grateful to
Princeton University, and
University of California, Davis for recommending use13 to their users. Chuck Huber (StataCorp) also
to directly read the data from Stata 13 files in the Stata Blog.
Author and support
In case you are experiencing a problem converting a dataset, refere to the following troubleshooting reference first, before requesting assistance.
use13 was written by Sergiy Radyakin.
To contact the author send email to sradyakin/at/worldbank.org.