Seite 1 von 1

Neue Variable abhängig von Werten anderer Variablen erzeugen

BeitragVerfasst: So 13. Sep 2020, 14:48
von MarlaP
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!

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

BeitragVerfasst: So 13. Sep 2020, 16:35
von ponderstibbons
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.