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

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

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: creating age at first birth from birth history data
Date   Mon, 26 Apr 2004 10:56:45 +0100

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. 

[email protected] 


> 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:

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