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
Create a new column using a column of 1 and 0.Hello! I'd like to ask for advice. I have the following data: I want to make a "var2" using "var1". …
qreg alternate solutions exists - retrieve solutionsHi, I am running a simple quantile (median) regression that has a dummy variable on the RHS. The y-…
Practice post - Help with macro lists (for a mixed logit model)Summary: I am looking for help with a macro to cycle through a list of variables in groups of two or…
a basic question about -if- programming commandI know what -if- -else- does, but what if there is a -if- but not the -else-? For example: if exp {…
connect paired dot in scatter plotHi there, I'm working on a descriptive scatter plot where I need to show values of two variables, X…
Subscribe to:
Post Comments (Atom)
0 Response to Measuring duration between age 13 and 19
Post a Comment