The DHS Program User Forum      
Discussions regarding The DHS Program data and results
Home » Topics » General » Wrong numbers
Wrong numbers [message #1958] Fri, 11 April 2014 11:52 Go to next message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
Please help, the totals that I am getting are higher than those published in the reports

Mercy
Re: Wrong numbers [message #1963 is a reply to message #1958] Fri, 11 April 2014 13:12 Go to previous messageGo to next message
Erica-DHS is currently offline  Erica-DHS
Messages: 22
Registered: January 2013
Member
Mercy, can you provide some more details? What report and indicators are you working with, and what software package? Please be as specific as possible- once I know more I can direct you to some resources.
Thanks,
Erica
Re: Wrong numbers [message #2012 is a reply to message #1963] Sun, 13 April 2014 13:31 Go to previous messageGo to next message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
Thanks Erica

Apologies for not providing details:

As a data quality assessment, I want to calculate age ratios across the population. I ran the table "Household population by age, sex, and residence" for the 2009 Lesotho, 2010 Malawi and Zimbabwe DHS but the numbers I get are higher than those published in the respective countries' reports. I also the de facto population so I do not know what is wrong




Mercy
Re: Wrong numbers [message #2013 is a reply to message #2012] Sun, 13 April 2014 13:31 Go to previous messageGo to next message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
I am using STATA

Mercy
Re: Wrong numbers [message #2016 is a reply to message #2013] Sun, 13 April 2014 21:22 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 535
Registered: January 2013
Senior Member
Hi Mercy,

We still need more information. Can you provide your code and your output for us to review and see where the difference lies.

Regards. Trevor
Re: Wrong numbers [message #2017 is a reply to message #2016] Mon, 14 April 2014 06:54 Go to previous messageGo to next message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
Dear Trevor

I use:

generate weight= hv005/1000000
tab hv105 hv104 [aweight = weight]
The results attached are different from that found on page 303 of Lesotho's 2009 report.
  • Attachment: age_sex.xlsx
    (Size: 108.44KB, Downloaded 212 times)
Re: Wrong numbers [message #2857 is a reply to message #1958] Tue, 02 September 2014 17:26 Go to previous messageGo to next message
JanSchuele is currently offline  JanSchuele
Messages: 5
Registered: August 2014
Member
Hi Mercy,

have you found the cause, that was responsible for the different numbers, in the meantime? I'm interested, because I have the same problem of receiving higher total sample numbers, just for a different country! Would be glad about a short update from your insights.

Kind regards,
Jan
Re: Wrong numbers [message #2860 is a reply to message #2017] Wed, 03 September 2014 09:55 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 535
Registered: January 2013
Senior Member
Hi Mercy,

Your problem is two fold:
1) You are not selecting the de facto sample - you need to select on hv103==1
2) You should use iweights, not aweights. In fact we actually recommend that you use the svy commands in general, but for a simple crosstab like this iweights will suffice. Other posts in the forum describe the svy commands.

The following commands will produce the results to match the report:
generate weight= hv005/1000000
tab hv105 hv104 if hv103==1 [iweight = weight]
Re: Wrong numbers [message #6857 is a reply to message #2860] Thu, 23 July 2015 10:12 Go to previous messageGo to next message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
Dear DHS team

I have numbers that are not matching those in the report for Lesotho 2009 but matching for Malawi and Zimbabwe. I want to calculate the % of children <18 living with both parents, father only, mother only and none of the parents. The following is the syntax:

generate weight= hv005/1000000
svyset [pw=weight], psu( hv021) strata(hv022)
*restrict to usual residence
keep if hv102==1
*restrict to <17
keep if hv105<=17
*Living arrangements of children
recode hv114 (0=0 "Not present") (1/30 =1 "Present"), gen(father_presence)
recode hv112(0=0 "Not present") (1/30 =1 "Present"),gen(mother_presence)

gen parental_presence =.
replace parental_presence =1 if father_presence == 1 & mother_presence ==1
replace parental_presence =2 if father_presence == 1 & mother_presence ==0
replace parental_presence =3 if mother_presence ==1 & father_presence ==0
replace parental_presence =4 if father_presence == 0 & mother_presence ==0

label var parental_presence parental_presence
label define parental_presence 1 "Both" 2 "Father only" 3 "Mother only" 4 "None"
label val parental_presence parental_presence
svy:tab parental_presence


Mercy
Re: Wrong numbers [message #8437 is a reply to message #6857] Tue, 27 October 2015 20:21 Go to previous messageGo to next message
Liz-DHS
Messages: 1103
Registered: February 2013
Senior Member
Dear User,
Do you still need assistance with this post?
Thank you!
Re: Wrong numbers [message #8446 is a reply to message #8437] Wed, 28 October 2015 10:30 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 535
Registered: January 2013
Senior Member
Your code does not take into account a few things:

1) The code did not consider whether the father or mother was dead. This is added by checking for . in the recode statements.

2) In Lesotho all family members are listed in the household schedule, including those that do not usually live in the household. To see if they live together you need to check if both the child and the parent usually live in the household. The important piece for this is to check hv102 for the father or mother. This is done with the following logic:
hv102[_n-hvidx+hv114] != 1
This logic refers to the data record for the father (or mother) by taking the current record number (_n), subtracting the child's line number (hvidx) to find the record before the start of the household, and then adding the father's (or mother's) line number (hv114 or hv112) to find the record for the parent. For this to work, all household members must be kept in the dataset, so the "keep if" commands have been removed, and the selection for children under 18 who were usual members of the household has been put on the svy:tab command instead (if hv102==1 & hv105 <= 17).

3) The code also needs to take into account cases where it was unknown if the father or mother was still alive, that is if hv113 was 8 or 9, or hv111 was 8 or 9.

Try the below code:

use LSPR60FL.DTA, clear

generate weight= hv005/1000000
svyset [pw=weight], psu(hv021) strata(hv022)

* sort to ensure that the household listing is in order
sort hhid hvidx

*Living arrangements of children
recode hv114 (0=0 "Not present") (1/30 = 1 "Present") (.=0), gen(father_presence)
recode hv112 (0=0 "Not present") (1/30 = 1 "Present") (.=0), gen(mother_presence)
replace father_presence=9 if inrange(hv113,8,9)
replace mother_presence=9 if inrange(hv111,8,9)

* need to take into acount whether father or mother usually live in the household
replace father_presence=0 if father_presence==1 & hv102[_n-hvidx+hv114] != 1
replace mother_presence=0 if mother_presence==1 & hv102[_n-hvidx+hv112] != 1

* 
gen parental_presence = 9
replace parental_presence = 1 if father_presence == 1 & mother_presence == 1 
replace parental_presence = 2 if father_presence == 1 & mother_presence == 0
replace parental_presence = 3 if father_presence == 0 & mother_presence == 1 
replace parental_presence = 4 if father_presence == 0 & mother_presence == 0

label var parental_presence parental_presence 
label define parental_presence 1 "Both" 2 "Father only" 3 "Mother only" 4 "None" 9 "DK/Missing"
label val parental_presence parental_presence 
svy:tab parental_presence if hv102==1 & hv105 <= 17

Re: Wrong numbers [message #12742 is a reply to message #8446] Thu, 06 July 2017 12:01 Go to previous message
Mercysh is currently offline  Mercysh
Messages: 22
Registered: April 2014
Member
I have two follow up questions on the response below:

1. I want to categorise children whose parents are de jure household members, whose parents are migrants (living elsewhere for extended periods), those whose parents are not part of the household because they are dead or are "absent". I am having challenges to do it in stata. I copied your code below for the first two categories but having problems with the rest.

2. Are there other countries besides Lesotho that include individuals who are neither de jure nor de facto members?


Mercy

[Updated on: Sun, 09 July 2017 07:57]

Report message to a moderator

Previous Topic: Afghanistan DHS Survey Persian Calendar
Next Topic: Head of house hold determinants
Goto Forum:
  


Current Time: Fri Nov 17 21:38:39 Eastern Standard Time 2017