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
xtpcse produces different coefficientsHi all, I hope someone can help me understand why xtpcse produces different coefficients. I specify…
Split destring and crosstabsHello Statalist, this is my first post and so I will try to follow the rules as best I can. I have …
🐛 Stata crashes on command executionThe following example demonstrates a sequence of commands that when executed crash Stata without pos…
mi impute chained error msg: right-hand variables or weights missing values--but they are notHello, I'm using the mi impute chained command on Stata SE 15.1. After encountering the perfect pre…
marginal effects for indirect effect in gsem mediation modelI would appreciate instruction how to generate the marginal effects in a gsem mediation model such a…
Subscribe to:
Post Comments (Atom)
0 Response to Measuring duration between age 13 and 19
Post a Comment