Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Convert an SPSS file (was: Re: st: simple question)


From   Dirk Enzmann <[email protected]>
To   [email protected]
Subject   Convert an SPSS file (was: Re: st: simple question)
Date   Mon, 05 Jul 2004 17:50:29 +0200

I wrote an SPSS script (for SPSS version 9+) that can be used to convert an SPSS data file (.sav) to a Stata data file (.dta). Among others, it will keep the SPSS MD codes distinct (and will keep its labels).

It can be downloaded from:

http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Software/Enzmann_Software.html
Enzmann_Software

(look for SPSS2stata.sbs)

However, I encountered the following problems:
- variable names containing the character $ have to be renamed
- variable names and labels containing a German "umlaut" (�, �, �, �, �, �, �) are not possible in Stata (really?)
- values of string variables cannot be declared as missing (true?)
- non-integer numeric values cannot get labels attached (right?)

Thus, the script will rename variables containing the character $ (changing $ to d) and will translate a German "umlaut" like � to ue. If SPSS short string variables had been declared as missing, a note will be attached to the respective Stata variable; likewise if non-integer values had value labels in SPSS.

Any solutions or hints to solve the a.m. problems in a better way are welcome.

Dirk

---------------------------------------------

At Wed, 02 Jun 2004, 14:32:38 -0500 Richard Williams <[email protected]> wrote:

> Subject: Re: st: simple question
>
> At 03:17 PM 6/2/2004 -0400, Suzy wrote:
>
>>Hi, I have continuous variables that are coded 99999 or 77777 for unknown
>>or refused to answer. How do I handle this? I don't want to treat them as
>>missing, if possible.
>>Thank you.
>>Suzy
>
> Not a simple question at all! How you handle Missing Data depends on many
> factors. I review a lot of the issues and more conventional options at
>
> http://www.nd.edu/~rwilliam/stats2/l12.pdf
>
> Unless you're willing and able to be fairly high tech about it (e.g. use
> advanced imputation techniques), I think listwise deletion tends to work as
> well as anything (even though the handout describes several other options).
>
> If you search the archives, you'll find some recent discussions of missing
> data issues. I think the feeling was that Stata (at least with its
> built-in routines) is a little on the weak side when it comes to advanced
> methods for handling MD.


*************************************************
Dr. Dirk Enzmann
Institute of Criminal Sciences
Dept. of Criminology
Schlueterstr. 28
D-20146 Hamburg
Germany

phone: +49-040-42838.7498 (office)
+49-040-42838.4591 (Billon)
fax: +49-040-42838.2344
email: [email protected]
www: http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html
*************************************************
*
* 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