[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
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
I assume some identifier variable
and a variable containing dates of birth
of children, as in
I also assume -birthdate- is a Stata
Your problem at its simplest is that
the birthdates are in the reverse order
fom what you want.
bysort mother (birthdate) : gen first = birthdate
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: