The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Tanzania » Maternal age at first birth
Re: Maternal age at first birth [message #13195 is a reply to message #13065] Mon, 02 October 2017 18:15 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 789
Registered: January 2013
Senior Member
In Stata, you could do something like the following:
use ZZIR62FL.DTA
rename b*_0* b*_*

gen age_2nd_birth = .
forvalues i = 1/20 {
  replace age_2nd_birth = int((b3_`i' - v011)/12) if bord_`i' == 2
}
tab age_2nd_birth
This code loops through all 20 entries in the birth history and finds the second birth (where bord = 2) and calculates the age at the second birth using the century month code of that birth.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stratification for 1996, 1999, 2004-2005 dataset
Next Topic: Difference between key indicator report and final report
Goto Forum:
  


Current Time: Sat Apr 27 20:23:19 Coordinated Universal Time 2024