SPSS-Datensatz in Stata-Format umwandeln

Allgemeine Fragen rund um Statistik mit Stata.

SPSS-Datensatz in Stata-Format umwandeln

Beitragvon Marnie » Mo 20. Okt 2014, 14:20

Hallo,

ich habe auf zweierlei Arten versucht, einen SPSS-Datensatz in Stata-Format umzuwandeln:

1. Abspeichern als .dta (sowei ich weiß, war die neueste angebotene Version Stata 8, wobei ich 12 benutze).
2. Abspeichern als ASCII.

Bei beidem kommt es beim Öffnen in Stata zu Problemen: Insbesondere bei Variablen mit nominalem Niveau wird die Ausprägung nicht als Zahl (also der jeweils zugeordnete Code) angezeigt, sondern die Ausprägung als Wort.

Ist es darüber hinaus vllt möglcih, dass Stata-Variablenlabels weniger Zeichen haben dürfen als in SPSS?

Weiß hier jemand Abhilfe zu schaffen?

Gruß
Marnie
Marnie
 
Beiträge: 14
Registriert: Mi 30. Jul 2014, 19:27
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon daniel » Mo 20. Okt 2014, 14:36

Insbesondere bei Variablen mit nominalem Niveau wird die Ausprägung nicht als Zahl (also der jeweils zugeordnete Code) angezeigt, sondern die Ausprägung als Wort.


Was meinst Du mit "angezeigt"? Sind die variablen in SPSS nummerisch und in Stata strings (mit Skalenniveuas kann Stata nichts anfangen)?

Ist es darüber hinaus vllt möglcih, dass Stata-Variablenlabels weniger Zeichen haben dürfen als in SPSS?


Mag sein. Stata erlaubt 80 Zeichen als Variablenlabel. Zu den internen Limitierungen von SPSS kann ich nichts sagen.
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon Marnie » Mo 20. Okt 2014, 14:51

hi daniel,
danke schonmal für die schnelle antwort.

Statt "angezeigt" hätte ich auch "übernommen" schreiben können. Genau, in Stata sind sie strings. Dies führt z.B. dazu, dass man beim tab-Befehl, die "nolabel"-Option nicht nutzen kann (und das ist noch das unproblematischste...).
Marnie
 
Beiträge: 14
Registriert: Mi 30. Jul 2014, 19:27
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon daniel » Mo 20. Okt 2014, 20:08

Das ist seltsam. Sicher, dass die Variablen in SPSS nummerisch sind? Im Zweifelsfall könnte es helfen das Skalenniveau aller Variablne SPSS auf metrisch zu setzen?

Alternativen wären Stat/Transfer (kostenpflichtig), Foreign-Package in R, oder in Stata value labels erzeugen und anschließend -encode-n.
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon Marnie » Di 21. Okt 2014, 11:18

Ich sehe gerade, dass das Problem mit den Labels meine eigene Doofheit war (beim tab-Befehl Variable klein statt groß geschrieben). Wo es hingegen definitiv hakt ist z.B. bei der neunstelligen Befragten-ID (in SPSS numerisch, Messniveau Skala): Statt diese korrekt zu übernehmen, ist im Stata-Data-Editor jeweils eine seltsame Kommazahl mit dem Anhängsel "e+08" zu sehen..
Marnie
 
Beiträge: 14
Registriert: Mi 30. Jul 2014, 19:27
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon daniel » Di 21. Okt 2014, 11:47

Ist potentiell nur ein Darstellungsproblem. Was gibt

Code: Alles auswählen
describe <id>


wobei <id> der Name Deiner Variable sein soll, zurück?
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon Marnie » Di 21. Okt 2014, 12:43

Das ist der Output:
Code: Alles auswählen
        storage  display     value
variable name   type   format      label      variable label
--------------------------------------------------------------------------------------------------------------
ID              double %10.0g                 ID f. Matching
Marnie
 
Beiträge: 14
Registriert: Mi 30. Jul 2014, 19:27
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon daniel » Di 21. Okt 2014, 12:55

Code: Alles auswählen
form ID %12.0g


näher dazu

Code: Alles auswählen
help format
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon Marnie » Di 21. Okt 2014, 14:04

ok, danke!

nochmal zu der Variante mit Stata und dort value labels zu erzeugen: Muss ich dazu vorher in SPSS alle Variablen (also auch die Strings) auf numerisch setzen?
Marnie
 
Beiträge: 14
Registriert: Mi 30. Jul 2014, 19:27
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: SPSS-Datensatz in Stata-Format umwandeln

Beitragvon daniel » Di 21. Okt 2014, 14:07

Wenn es string Variablen sind, dann kannst Du sie in SPSS auch nicht auf numerisch setzen. Zur Umwandlung tipp mal in Stata

Code: Alles auswählen
help encode


dort v.a. die -label- option.
Stata is an invented word, not an acronym, and should not appear with all letters capitalized: please write “Stata”, not “STATA”.
daniel
 
Beiträge: 1060
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post


Zurück zu Statistik allgemein

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast