Re: Birth Variables - V212 (Tanzania 2012) [message #829 is a reply to message #824] |
Wed, 09 October 2013 16:17  |
Reduced-For(u)m
Messages: 292 Registered: March 2013
|
Senior Member |
|
|
Lisa,
A couple of options. First, it sounds like you are using the "individual recode"? Is that right? If you want to use the birth order and birth date questions, you could write a code for SAS that does the following (except I don't know SAS, so I'll write it in pseudo-Stata that gives the idea).
egen FirstBirthYear = rowmin(b2_01 b2_02 ... b2_N)
*find the smallest value of a birth year for each woman
gen AgeAtFirstBirth = FirstBirthYear - v010
*generate her age as her birth year - that birth year.
This is imperfect in that it could be off by a year (you calculate 22 but the woman was actually 21 or 23). You could add the months to this to make it more perfect.
Or, you could use the Birth Recode that includes all births to woman, and try something like:
egen FirstYearBirth = min(byear), by(womanid)
*for each observation with the same womanid, generate a variable for all those observations with the value of the lowest birth year
gen AgeAtFirstBirth = FirstBirthYear-byear
....I'm not sure which form would work better with SAS, but the "rowmin" command in Stata is pretty good when trying to do something like this. I'd bet stata has something like that.
This help?
|
|
|