Home » Topics » General » Wrong numbers
Re: Wrong numbers [message #6857 is a reply to message #2860] |
Thu, 23 July 2015 10:12 |
Mercysh
Messages: 35 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
|
|
|
Goto Forum:
Current Time: Mon Jan 6 15:58:40 Coordinated Universal Time 2025
|