The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Fertility » compute key figures
Re: compute key figures [message #20135 is a reply to message #20111] Mon, 28 September 2020 13:08 Go to previous messageGo to previous message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello,

If you are trying to compute mother's age at birth (in BR or KR file) you can use the following Stata code:

* mother's age at birth (years): <20, 20-29, 30-39, 40-49
gen months_age=b3-v011
gen mo_age_at_birth=1 if months_age<20*12
replace mo_age_at_birth=2 if months_age>=20*12 & months_age<30*12
replace mo_age_at_birth=3 if months_age>=30*12 & months_age<40*12
replace mo_age_at_birth=4 if months_age>=40*12 & months_age<50*12
drop months_age

If you are looking to compute any DHS indicator listed in the Guide to DHS Statistics: https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Guide_to_DHS_Statistics_DHS-7.htm

Then please check our code library site on GitHub (both Stata and SPSS code is available). Please read the readme file before attempting to run any code.
Link: https://github.com/DHSProgram

Thank you.

Best,
Shireen Assaf
The DHS Program
 
Read Message
Read Message
Read Message
Previous Topic: Table on Fertility Planning Status from NFHS-4 data
Next Topic: Merging
Goto Forum:
  


Current Time: Thu Apr 25 23:53:41 Coordinated Universal Time 2024