The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Sample weights disappear after merge household with childs recode
Re: Sample weights disappear after merge household with childs recode [message #10170 is a reply to message #10162] Sat, 02 July 2016 10:36 Go to previous messageGo to previous message
RKelders is currently offline  RKelders
Messages: 9
Registered: June 2016
Location: Amsterdam
Member
Dear Tom,

I am using the Bangladesh 2007 DHS KR and PR recode files in SPSS. As I am looking at data on the household level as well as on the children's level, I need both sample weights in the merged file. I will use the sample weights from the KR file when I am analyzing data on the children's level and I will use the household sample weights from the PR file when I am working with household level data. I also need to know from which households the children's are to check for certain correlations, hence the need for a merged file where children are linked to their household's data.

I merged the files on V001 and V002 like you showed in your example but I used the KR file as the basic file, so I merged the PR data into the KR data file (because there can be more children in one household). I do get the error 5132 below after the merge. I tried deleting the cases from the PR file without children before the merge to see if that helped, but it did not. Perhaps the missing values for HV005 after the merge have something to do with this error?

GET
FILE='C:\Users\Rachel\Dropbox\WASH\Bangladesh\SPSS niet-werkbestanden\2007\Childs recode 2007 - Bangladesh.sav'.
SORT CASES BY V001(A) V002(A).
DATASET ACTIVATE DataSet1.
MATCH FILES /FILE=*
/FILE='C:\Users\Rachel\Documents\HH for merge 2007.sav'
/BY V001 V002.
EXECUTE.
File #1
KEY: 1 11

>Warning # 5132
>Duplicate key in a file. The BY variables do not uniquely identify each case
>on the indicated file. Please check the results carefully.

FREQUENCIES VARIABLES=HV005
/ORDER=ANALYSIS.

Statistics
Sample weight
N Valid 5183
Missing 1921


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using iweights for districts
Next Topic: Mozambique weighting after merging datasets
Goto Forum:
  


Current Time: Sun Dec 22 07:22:51 Coordinated Universal Time 2024