Home » Data » Weighting data » Sample weights disappear after merge household with childs recode
Sample weights disappear after merge household with childs recode [message #10123] |
Wed, 29 June 2016 11:13 |
RKelders
Messages: 9 Registered: June 2016 Location: Amsterdam
|
Member |
|
|
Good afternoon,
After merging the files from household recode and children recode, some of the sampling weights for the household data disappear. I am doing analyses for which I need both sampling weights as sometimes the analyses are on the level of the individual child and other times these are on the level of the household. However, it seems that for a lot of cases the household sampling weight has disappeared after merging these files. It seems to be the case for households with more children where one child gets the household sampling weight in the merged file and the other children from the same household get a missing value.
Could you please help me understand what is happening here and how I can fix this problem?
Thank you very much in advance.
Kind regards,
Rachel Kelders
|
|
|
|
Re: Sample weights disappear after merge household with childs recode [message #10151 is a reply to message #10130] |
Fri, 01 July 2016 08:56 |
RKelders
Messages: 9 Registered: June 2016 Location: Amsterdam
|
Member |
|
|
Dear Tom,
Thank you very much for your swift reply. Yes, I am doing a merge of the PR and KR files. I just looked at B5 and B16. Looking at B5, there are 218 children not alive and looking at B16, there are 25 missing values + the 218 children that have died.
However, when I merge these files I am looking at 1329 missing values for HV005. So B5 and B16 do not explain the total number of missing HV005 cases. Is there anything else I could check for now? It looks like it only merges the HV005 data for one child of the same household. For example, I have checked some cases and they all are alive and they live in the household of the respondent, but, these are all cases of which another child comes from the same household (equal cluster and household number). So, the first child has both the sample weight for children and household, but the second child from the same household only has a sampling weight for children, and nothing for household.
Any thoughts?
Thanks again and kind regards,
Rachel Kelders
|
|
|
|
|
|
|
|
Re: Sample weights disappear after merge household with childs recode [message #10216 is a reply to message #10195] |
Sun, 10 July 2016 09:04 |
RKelders
Messages: 9 Registered: June 2016 Location: Amsterdam
|
Member |
|
|
Hello again,
Apologies,I made a mistake when I confirmed that I am using the PR file because I am not. I am using the HR file, hence I am getting the subscripts. However, I think I do need to use the household file because I will be needing data on the level of the household.
I resolved the error 5132 in SPSS by using another syntax, and this worked. Now I can merge the HR file with the KR file and this seems to have worked!
No further questions at this point..
Thanks for your help!
Regards,
Rachel
[Updated on: Sun, 10 July 2016 10:18] Report message to a moderator
|
|
|
Re: Sample weights disappear after merge household with childs recode [message #10271 is a reply to message #10195] |
Sun, 17 July 2016 10:09 |
RKelders
Messages: 9 Registered: June 2016 Location: Amsterdam
|
Member |
|
|
Dear Tom,
Now that I am working with the children's file (KR file), I am using the sample weights for calculating percentages on stunting, wasting and underweight of the children in Bangladesh. I computed a new variable to be able to work with the sample weights: V005/1000000.
For the years 2004, 2007 and 2014 Bangladesh I had no problems, but for Bangladesh 2011 I am getting an error saying that not all cases have sample weights or these are zero or negative. So I ran a frequency table to check this but there seems to be a positive sample weight for each and every case. I tried this again and again but I am still getting the same error (see below) and I do not understand why that is. Could you please advise what to do?
>Warning # 3211
>On at least one case, the value of the weight variable was zero, negative, or
>missing. Such cases are invisible to statistical procedures and graphs which
>need positively weighted cases, but remain on the file and are processed by
>non-statistical facilities such as LIST and SAVE.
I hope you can help! Thanks again,
Rachel
[Updated on: Sun, 17 July 2016 10:11] Report message to a moderator
|
|
|
|
|
|
Re: Sample weights disappear after merge household with childs recode [message #10957 is a reply to message #10937] |
Wed, 12 October 2016 12:08 |
RKelders
Messages: 9 Registered: June 2016 Location: Amsterdam
|
Member |
|
|
Dear Tom,
I am not working with the merged file at the moment, just in the KR file. I ran a frequency table on the V005 and there were no missing values. All values were above 0. Would you mind trying this in the STATA programme to see if you get the same error? I am using the Bangladesh, 2011, KR file. Below is my syntax:
COMPUTE rweightCH=V005/1000000.
EXECUTE.
FREQUENCIES VARIABLES=rweightCH
/ORDER=ANALYSIS.
WEIGHT by rweightCH
And when I want to analyse my data using the weights, I get the following error:
>Warning # 3211
>On at least one case, the value of the weight variable was zero, negative, or
>missing. Such cases are invisible to statistical procedures and graphs which
>need positively weighted cases, but remain on the file and are processed by
>non-statistical facilities such as LIST and SAVE.
I hope you can help!
Thank you in advance,
Rachel
|
|
|
Re: Sample weights disappear after merge household with childs recode [message #10971 is a reply to message #10957] |
Thu, 13 October 2016 19:08 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Stata Specialist, Tom Pullum:
Quote:I don't use SPSS, but I'm pretty sure I know what is happening. Thanks for the extra detail.
For many purposes, software requires weights to be integers. Why, I don't know, but that's why the DHS weights are multiplied by 1,000,000. Instead of averaging to 1, they will average to 1,000,000. Then there are so many significant digits to the left of the decimal point that the weight can be treated as an integer. When you divide v005 by 1,000,000 and treat that as a weight, I think SPSS is either rounding to the nearest integer or dropping everything to the right of the decimal place. In this KR file there are 8753 children (I just checked). If SPSS is rounding, then 1207 of the values will become 0. If it is truncating, then 4794 of the values will become 0. It's a good thing that you get a warning, because if you didn't, then you would be dropping all of those cases from your analysis without knowing it. This will not show up in the distribution of the variable you call rweightCH. It will only happen when that variable is used by the WEIGHT procedure.
So--If you use SPSS, you have to figure some way to get around this default. I hope other forum users can suggest how to do this.
|
|
|
|
Goto Forum:
Current Time: Sun Dec 22 08:54:38 Coordinated Universal Time 2024
|