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 message
Janet-DHS is currently offline  Janet-DHS
Messages: 698
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]
Previous Topic: Cambodia DHS (all years) - Regional labels appear in duplicate and triplicate
Next Topic: Cambodia DHS (all years) - Regional disaggregation not available from the API endpoint
Goto Forum:
  


Current Time: Sat Apr 27 03:46:07 Coordinated Universal Time 2024