Statalist The Stata Listserver


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

Re: st: import SPSS files


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: import SPSS files
Date   Wed, 5 Jul 2006 00:07:35 +0100 (BST)

Peggy Chrisman wrote:

> I have received several SPSS files. I do not have SPSS nor do I have the
> Stata file transfer program. I tried following the suggestions from the
> help file using infile, insheet, etc, but have not been able to transfer
> the files into Stata thus far. There must be a way to import these
> files, but I can't seem to do it. Thanks in advance for any assistance.

You obviously didn't look at -whelp insheet- close enough! Had you done,
you'll have noticed there are two rather neat options for -insheet-: -tab-
and -comma-. For instance, try this:

(1) make sure that your SPSS file is comma-delimited (easy enough,
    especially when (re-)opening the .sav file in SPSS as I recall);

(2) move what should now be your .csv file into "C:/data", where all your
    Stata .dta files ought to be (if not, why not?);

and

(3) open up Stata and type -insheet using file.csv, comma-.

More details on this and how to convert datafiles from other formats into
Stata (and back again) are available at

http://www.ats.ucla.edu/stat/stata/faq/convert_pkg.htm

There, you'll learn something quite important. The UCLA-ATS crew don't
make this explicit, although Michael Blasnik did in a post to this list a
couple of years back: Stata doesn't care where the file comes from: it
only cares about what format it comes in! Your SPSS file could just as
well have originated from MS Excel or Epidata. Once it's told the
_format_, it can ably do the rest.

Hope that helps.

CLIVE NICHOLAS        |t: 0(044)7903 397793
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps

Whereever you go and whatever you do, just remember this. No matter how
many like you, admire you, love you or adore you, the number of people
turning up to your funeral will be largely determined by local weather
conditions.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index