The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » Estimation of percentage of 20-24 year old women who married before the age of 18
Re: Estimation of percentage of 20-24 year old women who married before the age of 18 [message #26308 is a reply to message #26290] Mon, 06 March 2023 11:13 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member

Following is a response from DHS staff member, Tom Pullum:

Below I will paste the full Stata code that I wrote to calculate table 6.2 in the NFHS-5 report. It borrows from the original CSPro code for this table. There are some small discrepancies from the published table (mostly only one-tenth of a percentage point) that I cannot account for.

In the procedure, afm (for age at first marriage) is set to 99 for women who are never-married. In your code you do this by setting v511x to 99. The point is that you cannot have "." or NA for afm for any women, because then you would be omitting unmarried women from the calculation. The never-married women have to be given a numerical value for afm that is greater than their current age. This is the only way you can calculate median age at marriage or the % married by an age that is less than current age. I don't know what you mean by "they will anyway get a value of 0 when we run the loop". Binary variables (such as "marr_by_18") are constructed, based on afm, but afm itself is NOT set to 0.

use "....IAIR7DFL.dta" , clear

gen never_married=0
replace never_married=1 if v501==0


* Procedure that allocates cases with month missing to month 6 and uses the earlier of
*   the reported dates at first marriage and first cohabitation (if both are given)
gen     cmc_first_mar=s308c
replace cmc_first_mar=12*(s308y-1900)+6 if s308y<9998 & s308m==98
replace cmc_first_mar=. if s308y==9998

gen cmc_first_cohab=12*(v508-1900)+v507

gen afc=int((cmc_first_cohab-v011)/12)
gen afm=int((cmc_first_mar-v011)/12)

replace afm=min(afc,afm)


* Procedure used in the CSPro construction of the table
gen v511x=.
replace v511x=s309 if s309>=0 & s309<=96
replace v511x=int((s308c-v011)/12) if s308c>=500 & s308c<=1500
replace afm=v511x

replace afm=99 if v501==0

* afm should be over-ridden as NA if v501==0

local lcutoffs 15 18 20 21 25
foreach lc of local lcutoffs {
gen     marr_by_`lc'=0
replace marr_by_`lc'=1 if afm<`lc'
}

tab v013 marr_by_15           [iweight=v005/1000000], row
tab v013 marr_by_18 if v013>1 [iweight=v005/1000000], row
tab v013 marr_by_20 if v013>1 [iweight=v005/1000000], row
tab v013 marr_by_21 if v013>2 [iweight=v005/1000000], row
tab v013 marr_by_25 if v013>2 [iweight=v005/1000000], row
tab v013 never_married        [iweight=v005/1000000], row
 
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: Percentages to numbers
Next Topic: NFHS-5, Household structure
Goto Forum:
  


Current Time: Mon Dec 2 03:04:54 Coordinated Universal Time 2024