Write program and data for use in RATS econometrics package -----------------------------------------------------------
^torats^ [varlist] [^if^ exp] [^in^ range] ,^File^(string) [^noCASE^ ^Repla > ce^]
Description -----------
^torats^ facilitates the transfer of data to the RATS package via ASCII text files (that is, it does not create a RATS binary database, but then neither does Stat/Transfer). If executed in simplest form, ^torats,file(filename)^, it creates two files: ^filename.rat^, containing a shell RATS program that will read the data, and ^filename.raw^, the data themselves. If files with those names already exist, the ^replace^ option must be used. It is left to the user to write the appropriate timeseries calendar statements, if the data are indeed in timeseries format, or modify the allocate statement to indicate that these are panel data, etc.
Since RATS does not handle string variables, only numeric variables are transferred. The numeric values of variables which appear in Stata as their value labels (e.g. foreign in the auto.dta dataset) are transferred, since the value labels could not be used in RATS. Unless the ^nocase^ option is utilized, casewise deletion is performed so that only observations with complete data are transferred to the output file.
If no ^varlist^ is given, all variables are transferred to the output files. An explicit ^varlist^ overrides this behavior.
Although the .rat file is specific to RATS (www.estima.com), its format is very similar to that used by TSP, eViews, or other commonly used econometrics packages.
Example -------
. ^use http://fmwww.bc.edu/ec-p/data/greene2000/tbl15-1.dta,clear^
. ^reshape wide i f c,i(year) j(firm)^ . ^torats,file(grunfeld)^ . ^torats i1 i2 i3 i4 i5 if year>1940, file(grunfeld2)^ . ^webuse auto^ . ^torats mpg rep78 weight length, file(autodat) nocase replace^
Authors -------
Christopher F Baum, Boston College, USA baum@@bc.edu
Nicholas J. Cox, Durham University, UK N.J.Cox@@durham.ac.uk
Also see --------
On-line: help for @outfile@; @outdat@ (if installed)