|
|
|
||||
|
Stat Computing > FAQ
|
Help the Stat Consulting Group by
giving a gift
| ||||
|
Loading
|
|||||
SPSS supports Stata data files and can easily save an SPSS file as a Stata file through the point and click interface or syntax. Using the pull down menus select File then Save As... and then for Save as type select the type of Stata file needed. Type the file name and click Save to save the Stata file.
To use SPSS syntax use the save translate command as seen below.
save translate outfile='C:\data\hsb2.dta'.
Data written to C:\data\hsb2.dta. 11 variables and 200 cases written. [output omitted for space]
It is fairly straightforward to convert an SPSS data file to Stata via Stat/Transfer. Note: If the file being transferred has more than 2,047 variables and you are going to use Stata/SE, the data file should be converted to Stata/SE, in which case you will need to select Output File Type: Stata/SE.
A Stata user-written command called "usespss" works under Windows environment. You can download it via "findit usespss". Here is an example.
usespss using hsb2.sav, clear
One can also examine the data set before reading it into Stata and here is an example.
desspss using hsb2.sav DESSPSS Report ============== SPSS System file: hsb2.sav Created (date): 12 Jun 07 Created (time): 15:29:10 SPSS product: @(#) SPSS DATA FILE MS Windows Release 14.0.1 File label (if present): File size (as stored on disk): 4029 bytes Data size: 2592 bytes Data stored in compressed format This file is likely to originate from a Windows platform (LoHi byte order) Number of cases (observations): 200 Number of variables: 11 Case size: 88 bytes ---------------------------------------------------------------------- Variables: id female race ses schtyp prog read write math science SOCST
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services