Add values of t2 questionnaires to excitisting variables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Add values of t2 questionnaires to excitisting variables

stracciatella
Hello.

In a SPSS file, we have the values of a time one (t1) questionnaire and a time two (t2) questionnaire.
We add the t2 values in an ongoing process (more and more t2 questionnaires arrive) by ADD CASES.
Than we have them in one file (as new cases), but still needed them for calcuations in the same row as the t1 values.

Key        t1value1     t1value2      t1value3     t2value1    t2value1     t2value3
XXX             1,2           4,2              3,2
YYY             2,3           3,5              5,6
...
XXX                                                             1,4             4,3            3,3
     

We would likle to find a smarter way instead of adding the values handish to the row above. Do you have an idea?

Thanks in advance.
Mandy
Reply | Threaded
Open this post in threaded view
|

Re: Add values of t2 questionnaires to excitisting variables

Bruce Weaver
Administrator
Check out the UPDATE command.  

https://www.ibm.com/support/knowledgecenter/en/SSLVMB_23.0.0/spss/base/syn_update_overview.html


stracciatella wrote
Hello.

In a SPSS file, we have the values of a time one (t1) questionnaire and a time two (t2) questionnaire.
We add the t2 values in an ongoing process (more and more t2 questionnaires arrive) by ADD CASES.
Than we have them in one file (as new cases), but still needed them for calcuations in the same row as the t1 values.

Key        t1value1     t1value2      t1value3     t2value1    t2value1     t2value3
XXX             1,2           4,2              3,2
YYY             2,3           3,5              5,6
...
XXX                                                             1,4             4,3            3,3
     

We would likle to find a smarter way instead of adding the values handish to the row above. Do you have an idea?

Thanks in advance.
Mandy
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Add values of t2 questionnaires to excitisting variables

David Marso
Administrator
UPDATE will certainly work for appending new data to existing records in a sorted file with common key.
To consolidate a file where you have distinct rows for T1 and T2 you can achieve joy with the AGGREGATE command.

DATASET DECLARE consolidated.
AGGREGATE OUTFILE=consolidated
 / BREAK=key
 / t1value1 TO t1value3 t2value1 TO t2value3
 =MAX(t1value1 TO t2value3).
DATASET ACTIVATE consolidated.

---
Bruce Weaver wrote
Check out the UPDATE command.  

https://www.ibm.com/support/knowledgecenter/en/SSLVMB_23.0.0/spss/base/syn_update_overview.html


stracciatella wrote
Hello.

In a SPSS file, we have the values of a time one (t1) questionnaire and a time two (t2) questionnaire.
We add the t2 values in an ongoing process (more and more t2 questionnaires arrive) by ADD CASES.
Than we have them in one file (as new cases), but still needed them for calcuations in the same row as the t1 values.

Key        t1value1     t1value2      t1value3     t2value1    t2value1     t2value3
XXX             1,2           4,2              3,2
YYY             2,3           3,5              5,6
...
XXX                                                             1,4             4,3            3,3
     

We would likle to find a smarter way instead of adding the values handish to the row above. Do you have an idea?

Thanks in advance.
Mandy
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"