Home » Data » Merging data files » SPSS - Merging Household variables with Individual Women's dataset
SPSS - Merging Household variables with Individual Women's dataset [message #2404] |
Fri, 13 June 2014 05:02  |
aligazan
Messages: 24 Registered: June 2014 Location: UK
|
Member |
|
|
Hello,
I do realise that there have already been lots of posts on this subject. I have read them all, but I am still struggling to understand exactly how to do this on SPSS.
I want to add variables from the HH dataset into the Women's dataset (for Mali 2006). The particular variables I am interested in are to do with the relationships of the household members, and I would ultimately like to know which relatives each woman in the individual dataset, is living with (e.g. no other adult, living with husband, with co-wife, with parent, with parent-in-law, etc.).
This relationship is found from the variables HV101$01 etc. on the HH dataset.
I have seen the code below, but as I am relatively new to SPSS I have been unable to work out how to adapt this for the objective that I am trying to achieve.
I would really appreciate any help with this. THANKS!
Below is an example syntax for merging the HIV Test data with the Women's data in SPSS.
GET FILE='C:\DATAUSER\ZMAR51FL.SAV'.
SORT CASES BY
HIVCLUST (A) HIVNUMB (A) HIVLINE (A).
SAVE OUTFILE='C:\DATAUSER\HIV.sav'
/COMPRESSED.
GET FILE='C:\DATAUSER\ZMIR51FL.SAV'.
SORT CASES BY
V001 (A) V002 (A) V003 (A) .
SAVE OUTFILE='C:\DATAUSER\WOMEN.sav'
/RENAME(V001 V002 V003=
HIVCLUST HIVNUMB HIVLINE)
/COMPRESSED.
GET FILE='C:\DATAUSER\WOMEN.sav'.
MATCH FILES /FILE=*
/TABLE='C:\DATAUSER\HIV.sav'
/BY HIVCLUST HIVNUMB HIVLINE.
EXECUTE.
SAVE OUTFILE='C:\DATAUSER\ZMAR_IR.SAV'
/COMPRESSED.
|
|
|
|
|
|
Re: SPSS - Merging Household variables with Individual Women's dataset [message #2464 is a reply to message #2458] |
Mon, 23 June 2014 13:43  |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
Where are you getting the variables: "s12" and "s36" from (in your syntax)?
The syntax we posted seems perfectly fine, and all you have to do is modify the file names and the path for the file location. See modified syntax below:
get file = 'c:\testing\MLIR52FL.SAV'.
STRING HHID (A12).
COMPUTE HHID = SUBSTR(CASEID,1,12).
VARIABLE LABELS HHID 'Household ID' .
EXECUTE .
MATCH FILES /FILE=*
/TABLE='c:\testing\MLHR52FL.SAV'
/BY hhid.
EXECUTE.
SAVE OUTFILE='c:\testing\HR_IR.SAV'
/COMPRESSED.
[Updated on: Thu, 25 June 2015 13:38] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Apr 24 09:13:13 Coordinated Universal Time 2025
|