How to copy from one variable to another on SPSS

How to copy from one variable to another on SPSS



I have a data set with two parent/carer respondents (main and partner) for each participant (child). For one of the variables, only one respondent has given an answer - usually the main respondent, but in some cases it was the partner respondent. I therefore need to fill in some missing main respondent data with data from the partner respondent.

My data looks roughly like this:


MAIN PARTNER I would like the final var as below:
2 -1 2
1 -1 1
-1 2 2
1 . 1
-9 2 2
-8 1 1
2 . 2
1 . 1
etc.



(-1, -8 and -9 are missing values)



All variables are numeric. Where a response is missing from the main respondent, I would like to fill it in from the partner. I cannot seem to get the DO IF/RECODE commands to work.



Any advice on how to do this in SPSS would be hugely appreciated!




1 Answer
1



More than one way to skin a cat. Depending on your taste, you might create your final variable responder like so:


responder


MISSING VALUES main (-1,-8,-9) .
IF (MISSING(main)) responder=partner .
IF (NOT(MISSING(main))) responder=main .
EXE .



First assign your missing values. Then assign a value to responder based on whether main is missing. Note that MISSING(main) will evaluate true when main has a specified missing value (in this case: -1, -8, or -9) or a system missing value.


responder


main


MISSING(main)






Thank you so much, this was a huge help!

– Amelia M.
Oct 14 '18 at 14:04






No problem @AmeliaM. -- happy to help! If you feel it answered your question please consider selecting it (using the check mark next to the response)

– user45392
Oct 26 '18 at 15:55



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế