The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » I need help constructing a variable in Stata
Re: I need help constructing a variable in Stata [message #75 is a reply to message #74] Wed, 20 February 2013 11:56 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3117
Registered: February 2013
Senior Member
Here is a response from one of our STATA experts Tom Pullum that should answer your question.

Go to the IR (women's) file, GHIR4BDT.DTA.  Use the following variables:

The woman's cmc (century month code) of birth is v011
The child's cmc of birth is b3
The birth order is given by bord.  For the second birth, the cmc of birth is b3_02

Define a new variable, which I will call mageb02, the mother's age at the birth of the second child, with

gen mageb02=int((b3_02-v011)/12)

In Stata, this will be coded "missing" (.) if there was no second birth. The int command gives the integer part of any number.

The only possible issue arises when the mother and child are both born in the same calendar month.  My formula would say that if, for example, the mother was born in March 1980 and the child was born in March 2000, then the mother was 20 years old at the time of the birth.  However, it is possible that the mother was born on March 20, say, and the child was born on March 10, so that the mother was actually only 19 at the time of the birth (and turned 20 ten days after the birth).  This is the sort of issue that gives demographers gray hair.  The usual way to resolve it would be to say that all births, for the mother and her children, occur on the same day of the month (the 15th, for example). Then the child would have been born right on the mother's 20th birthday and the formula would be ok.

I suggest that if you are comparing with something given in the final report, you try to replicate with this formula.  You will need to use weights (v005) for any means or tabulations, etc.

I hope this helps.

Bridgette-DHS

[Updated on: Mon, 18 March 2013 08:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calculating median age at first sex and percentage of respondents with sex before the age of 15
Next Topic: Opening DHS data on STATA 13
Goto Forum:
  


Current Time: Sun Jul 28 02:30:03 Coordinated Universal Time 2024