| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: from stata to SAS
Juzhi Wang <[email protected]> wrote,
> [...] I need to import Stata data sets to SAS. What I need to do is to
> export the Stata into Excel and from Excel to SAS.
One easy way to export data from Stata to SAS is using Stata's -fdasave-
command, which will save the dataset in SAS XPORT format. That will allow
you to skip the Excel step. For example,
. use auto, clear
(1978 Automobile Data)
. fdasave forsas
the following variable(s) have names that must be changed to fit
into .xpt format: (suggested renamings shown):
displacement -> DISPLACE
gear_ratio -> GEAR_RAT
specify option rename to save .xpt file with suggested names
r(110);
. fdasave forsas, rename
the following variable(s) were renamed in the output file:
displacement -> DISPLACE
gear_ratio -> GEAR_RAT
file forsas.xpt saved
file formats.xpf saved
Another alternative, as Michael McCulloch <[email protected]> mentioned, is to use
Stat/Transfer, which will allow you to go directly to a SAS format dataset.
Stat/Transfer is available either from www.stattransfer.com or from
www.stata.com.
-- Bill
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/