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
Interpreting logistic regression "Odds ratio ouputHello everyone I am investigating the factors that influence Adherence Pre-Exposure Prophylaxis (Pr…
LoopsHi, I have the following code : egen identifier = group(isin) sum identifier scalar max2=r(max) lo…
Export ANOVA OutputHi, I am trying to save the output from running multiple ANOVAs, however the Word output isn't corr…
Problem with time series: repeated time values within panelHi, I want to create a time series variable, but when I enter the commend tsset date, I receive the …
Cox Proportional Hazards Model with multiple failure events and panel dataI would like to use a Cox Proportional Hazards Model to estimate the hazard rate of an individual in…
Subscribe to:
Post Comments (Atom)
0 Response to Measuring duration between age 13 and 19
Post a Comment