Hi people,
Supposed i want to measure marriage timing among pregnant and non pregnant adolescents (age 13 to 19) using cmc variables, how do i go about creating my duration variable in this case. I have already created the event, which is experiencing 1st marriage. Below are some of the steps i followed:
Event Variable (1st Marriage):
tab v509 /*date of 1st cohabitation (cmc)*/
tab v511 /*age at first cohabitation in years*/
gen EVENT_1STMAR = .
replace EVENT_1STMAR = 1 if v509 !=. & v511 >= 13 | v511 <=19
replace EVENT_1STMAR = 0 if v509 ==. & v511 <=12 | v511 >=20
tab EVENT_1STMAR, m
Now Duration:
tab v010 /*respondent's year of birth*/
tab v508 /*respondent's year of first cohabitation*/
tab v011 /*date of birth (cmc)*/
tab v008 /*Date of interview (cmc)*/
gen DURATION =.
replace DURATION = (v508 - v010 )*12 + v011 - v509 if EVENT_1STMAR == 1
replace DURATION = v008 if EVENT_1STMAR == 0
Note: the duration should start at age 13 and end when the respondent turns 20 or month of interview or at 1st cohabitation. This is where my problem!
Your comments and guidance will be highly appreciated.
Thanks in advance.
Related Posts with Measuring duration between age 13 and 19
stataHello I have the household code, the ratio of household members to the guardian and the age of the h…
How i can see only interesting for me models.For example i have 100 columns named var... I wrote code for them like this: Code: xtmixed Y X1 X2…
Problem manipulating large database based on conditional statements to eliminate specific observationsHello world of stats and analysis, I have dibbled a bit in STATA over my university years but my wo…
How to create an indicator of total vocabulary score for bilingual childrenHi all, I am using a dataset with vocabulary data for 5585 children who are 2 years old. We have a…
Setting a dummy if names appear in the previous year!Dear All, Suppose that I have data Code: * Example generated by -dataex-. To install: ssc install …
Subscribe to:
Post Comments (Atom)
0 Response to Measuring duration between age 13 and 19
Post a Comment