Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: creating age at first birth from birth history data

From   Henry DOCTOR <>
To   "''" <>
Subject   st: RE: RE: creating age at first birth from birth history data
Date   Mon, 26 Apr 2004 12:28:35 -0000

Thanks to Nick Cox for the reply. I will try what you have suggested and get
back to you if I experience any problems. In the interim it looks like you
have guessed right about the data. 

Henry V. Doctor
Navrongo Health Research Centre
P.O. Box 114 
Navrongo, Upper East Region
tel/fax: +233 (0)742 22320; cell: +233(0)244 433706

-----Original Message-----
From: Nick Cox [] 
Sent: 26 April 2004 10:57
Subject: st: RE: creating age at first birth from birth history data

I'll guess at your data structure. If this 
isn't correct, you may need to say more 
about it. 

I assume some identifier variable 
and a variable containing dates of birth
of children, as in 

mother birthdate 
1       1feb2001
1       1mar1999
1       4jul1996 
1       28feb1994
2       2nov2003 
2       etc. 

I also assume -birthdate- is a Stata
elapsed date. 

Your problem at its simplest is that 
the birthdates are in the reverse order
fom what you want. 

bysort mother (birthdate) : gen first = birthdate[1] 

will generate a variable with firstbirths from 
these data. The same value of -first- will be 
repeated for each -mother-. To get the age
of the mother at the first birth, you may 
need to subtract the mother's date of birth, 
possily in another variable. 



> I need to create a variable called "age at first birth" 
> for women from birth history data. The variable has information 
> for births beginning with the last child (most recent birth) 
> to the first child (first pregnancy). So, every woman has n 
> children and the last (nth child) in the data is the first born. 
> I want to reverse this so that the variable gives me the nth 
> child for every woman as the first born.

*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index