Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: RE: st: import SPSS files


From   "Bernd Weiss" <bernd.weiss@uni-koeln.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: RE: st: import SPSS files
Date   Wed, 05 Jul 2006 14:27:53 +0200

On 5 Jul 2006 at 8:16, Robert A Yaffee wrote:

From:           	Robert A Yaffee <bob.yaffee@nyu.edu>
To:             	statalist@hsphsun2.harvard.edu
Date sent:      	Wed, 05 Jul 2006 08:16:20 -0400
Subject:        	Re: RE: st: import SPSS files
Send reply to:  	statalist@hsphsun2.harvard.edu

> Nuno,
>  You're quite right. The R package read.spss(foreign)
> will work on SPSS v. 14 files.  If the data set is
> called test.sav, then the command to read it is
> testsav<-read.spss("test.sav").  Then you can use
> the extractors to deal with the variables.
>   I suppose you can then use write.sta("testsav") to produce
> the Stata file?
>  - RY

Two minor remarks: You better use 

testsav<-read.spss("test.sav",to.data.frame=TRUE)

to read your data into R and 

write.dta(testsav,file="testsav.dta")

to save your data as Stata-file.

HTH,

Bernd
-- 
Bernd Weiss, M.A.
University of Cologne / Research Institute for Sociology
Greinstr. 2 / D-50939 Cologne / Germany
E-Mail: <bernd.weiss@uni-koeln.de>
URL: <http://www.uni-koeln.de/wiso-fak/fisoz/>


*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index