The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Other countries » PDHS 2017-18 Table 4.3: Age at first Marriage Table (Table 4.3: Percentage first married by exact age)
PDHS 2017-18 Table 4.3: Age at first Marriage Table [message #27238] Wed, 05 July 2023 07:30 Go to next message
waqas is currently offline  waqas
Messages: 35
Registered: June 2015
Location: Islamabad, Pakistan
Member

Hi!

I have been using following STATA code for computing "First marriage by exact ages"

____________________________________________________________ ________________________________
FILE: IR women file
____________________________________________________________ ________________________________

gen wt=v005/1000000

//Married by specific ages
recode v511 (.=0) (0/14 = 1 "yes") (15/49 = 0 "no"), gen (fma15)
label var fma15 "First marriage by age 15"

recode v511 (.=0) (0/17 = 1 "yes") (18/49 = 0 "no"), gen (fma18)
replace fma18 = . if v012<18
label var fma18 "First marriage by age 18"

recode v511 (.=0) (0/19 = 1 "yes") (20/49 = 0 "no"), gen (fma20)
replace fma20 = . if v012<20
label var fma20 "First marriage by age 20"

recode v511 (.=0) (0/21 = 1 "yes") (22/49 = 0 "no"), gen (fma22)
replace fma22 = . if v012<22
label var fma22 "First marriage by age 22"

recode v511 (.=0) (0/24 = 1 "yes") (25/49 = 0 "no"), gen (fma25)
replace fma25 = . if v012<25
label var fma25 "First marriage by age 25"

////////Table 4.3 column//////////////


tab v013 fma15 [iw=wt], row nofreq
tab fma15 if v013>=2 [iw=wt]
tab fma15 if v013>=3 [iw=wt]

tab v013 fma18 if v013>=2 [iw=wt], row nofreq
tab fma18 if v013>=2 [iw=wt]
tab fma18 if v013>=3 [iw=wt]

tab v013 fma20 if v013>=2 [iw=wt], row nofreq
tab fma20 if v013>=2 [iw=wt]
tab fma20 if v013>=3 [iw=wt]

tab v013 fma22 if v013>=3 [iw=wt], row nofreq
tab fma22 if v013>=3 [iw=wt]

tab v013 fma25 if v013>=3 [iw=wt], row nofreq
tab fma25 if v013>=3 [iw=wt]

____________________________________________________________ _________________


It is not producing the exact figures as reported in final report of PDHS 2017-18 Table 4.3 page75.

Kindly guide for correction of error if any in above code.

Regards
Waqas Imran


Waqas Imran

[Updated on: Thu, 06 July 2023 01:25]

Report message to a moderator

Re: PDHS 2017-18 Table 4.3: Age at first Marriage Table [message #27295 is a reply to message #27238] Thu, 13 July 2023 12:49 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 938
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

Age at marriage is calculated differently for surveys that are limited to ever-married women. Below I will paste the Stata code for age 18 (you can extend to other cutoff ages) for the Bangladesh 2017 survey. It should only need to be modified by entering the correct IR file name for the PDHS. There are other ways to do it but this way should work. Note that there are separate all-women factors for each covariate.

* Construction of table 4.4 (marriage before age 18) in the Bangladesh 2017 final report

* General strategy for EMW surveys: for each original case, add a second case
* with residual weight and never-married status

* Specify a workspace
cd e:\DHS\DHS_data\scratch

* Read the IR file
use "....BDIR7RFL.DTA", clear

* Must match the covariates in the table with the correct version of awfact
* Total: awfactt
* Residence: v025, awfactu
* Division: v024, awfactr
* Education: v149, awfacte
* Wealth quintile: v190, awfactw

local letters t u r e w

* restrict to age 20-24
keep if v013==2

keep v001 v002 v003 v005 v024 v025 v149 v190 v511 awfact*
gen EMW=1
gen afm=v511

* Construct weights wt* for the original EMW cases
foreach ll of local letters {
gen wt`ll'=v005
}

save EMW.dta, replace

replace EMW=0
replace afm=99

* Construct corresponding weights wt* for the artificial NMW cases
foreach ll of local letters {
replace wt`ll'=int(((awfact`ll'-100)/100)*v005)
}

* Combine the EMW and NMW cases
quietly append using EMW.dta

* Construct the outcome, married before age 18
gen by18=0
replace by18=100 if afm<18

*save ALL.dta, replace

* Table 4.4. Marriage before age 18
* Note; the %'s and n's are produced separately.
* Ignore (!!) the totals rows for the separate panels.

* Total
summarize by18 [iweight=wtt/1000000]

* Residence
tab v025 [fweight=wtu], summarize(by18) means
tab v025 [iweight=wtu/1000000]

* Division
tab v024 [fweight=wtr], summarize(by18) means
tab v024 [iweight=wtr/1000000]

* Education
tab v149 [fweight=wte], summarize(by18) means
tab v149 [iweight=wte/1000000]

* Wealth quintile
tab v190 [fweight=wtw], summarize(by18) means
tab v190 [iweight=wtw/1000000]
Re: PDHS 2017-18 Table 4.3: Age at first Marriage Table [message #30666 is a reply to message #27295] Thu, 16 January 2025 15:14 Go to previous messageGo to next message
paneves is currently offline  paneves
Messages: 7
Registered: October 2019
Member
Hi Janet, Tom, and team. Thanks for sharing the code to calculate this indicator. It worked well for the survey years I am investigating (2004-2017). However, the estimate for the 2022 survey doesn't match with STAT Compiler. I wonder if there's anything I should consider for that specific year that you could help figure out, please. I am calculating an estimate of 34% (num obs 5964).

Thanks,
Paulo
Re: PDHS 2017-18 Table 4.3: Age at first Marriage Table [message #30703 is a reply to message #30666] Tue, 21 January 2025 16:02 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 938
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

Users must always be wary of potential subsampling. It happens that the BD 2022 survey had a more complex design than earlier rounds. For subsamples (indicated by seligbm and sbpbg), biomarkers were included. In order to keep the interview duration down, some of the usual questions were skipped for the women with biomarkers. Age at first marriage was NA for those women.

The easiest way to modify the program for those cases will be to insert the line "drop if v511==." right after opening the IR file.

This is a short response but it took a while to make this diagnosis! Frankly, I thought that v511 was never NA in an EMW survey.
Re: PDHS 2017-18 Table 4.3: Age at first Marriage Table [message #30708 is a reply to message #30703] Tue, 21 January 2025 17:17 Go to previous message
paneves is currently offline  paneves
Messages: 7
Registered: October 2019
Member
Very appreciated!

Best
Previous Topic: Senegal - problem merging data from main survey and GPS
Next Topic: Lesotho Data sets
Goto Forum:
  


Current Time: Wed Jan 29 01:01:14 Coordinated Universal Time 2025