Hi all,
I want to find out the month of birth of each child in my dataset. I have two variables from which I believe that I can extract the information of month of birth.
The date of interview (dint) and age in month (agemon). I have tried the following codes:
gen mnth = month(dint)
gen mnthborn = (agemon-mnth)/12
format mnthborn %12.0f
label var mnthborn "Child's month of birth"
But there is codes missing in between but I cannot figure out how to solve it.
Thanks !
I want to find out the month of birth of each child in my dataset. I have two variables from which I believe that I can extract the information of month of birth.
The date of interview (dint) and age in month (agemon). I have tried the following codes:
gen mnth = month(dint)
gen mnthborn = (agemon-mnth)/12
format mnthborn %12.0f
label var mnthborn "Child's month of birth"
But there is codes missing in between but I cannot figure out how to solve it.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(round year) double dint float agemon 1 2002 15637 92.67945 2 2006 0 145.08493 1 2002 15642 98.20274 2 2006 0 150.50958 1 2002 15641 96.72329 end format %tdD_m_Y dint
Comment