Neue Variable abhängig von Werten anderer Variablen erzeugen

Alles rund um SPSS Syntax und Programmierung.

Neue Variable abhängig von Werten anderer Variablen erzeugen

Beitragvon MarlaP » So 13. Sep 2020, 14:48

Liebe community,

Ich bin ein absoluter Anfänger in SPSS und brauche etwas Hilfe bei der Syntax. Ich studiere zwar Deutsch, aber es ist immer noch nicht so gut, deshalb werde ich meine Anfrage auf Englisch schreiben. Ich hoffe, es ist kein Problem für Sie!

I have a data set that roughly looks as the one in the attached picture. I need to generate a new variable that contains, for each user (ID) the hour and the date only referred to one of the questions.
For example: I want to compute a new variable, TIME_Q1, in which the value is "11.04 1/10/2019"
for the user 1 (ID =1), "15.07 04/09/2019" for the user 2 (ID =2) and so on. Can anyone help me with the syntax?

Also, my DATE variable is nominal and when I run "alter type" to change it into a date, all the values become ".". May it be because in front of the each value there are brackets " (see picture)? This does not happen when I alter the type of the HOUR variable that is nominal and has brackets as well.

Any suggestion is more than welcome :)





Ganz herzlichen Dank schon jetzt!
Dateianhänge
1599637417586.png
1599637417586.png (12.24 KiB) 1167-mal betrachtet
MarlaP
 
Beiträge: 1
Registriert: So 13. Sep 2020, 14:34
Danke gegeben: 0
Danke bekommen: 0 mal in 0 Post

Re: Neue Variable abhängig von Werten anderer Variablen erze

Beitragvon ponderstibbons » So 13. Sep 2020, 16:35

Can anyone help me with the syntax?

Kopiere die beiden Spalten in Word oder ein anderes Textverarbeitungsprogramm,
entferne die brackets, kopiere das Ergebnis, füge es in SPSS in eine neue Spalte ein,
definiere den Variablentyp, zum Beispiel als dd-mmm-yyyy hh:mm (siehe
https://www.ibm.com/support/knowledgece ... rmats.html).
Also, my DATE variable is nominal and when I run "alter type" to change it into a date, all the values become ".". May it be because in front of the each value there are brackets " (see picture)?

Ob es daran liegt, lässt sich doch superschnell herausfinden, wenn Du "1/10/2019
änderst in 1/10/2019 und dann alter type anwendest.
ponderstibbons
 
Beiträge: 2477
Registriert: Sa 1. Okt 2011, 17:20
Danke gegeben: 1
Danke bekommen: 255 mal in 254 Posts


Zurück zu SPSS Syntax

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast

cron