Hello,
I am trying to create a dataset where for each year there is an indicator named birth that shows whether a mother (casefe) has given birth or not in that year. In the variables described below 'year' variable is the year of birth of the child. In other words a mother denoted by casefe -21 gave birth in the year 2013 and 2015, my data has years from 2011-2015; hence the birth indicator should take the value 0 for the years 2011, 12 and 14. My research question is to check if the treatment has an impact on the possibility of being born. So any other suggestion to achieve this goal is also appreciated.
I am trying to create a dataset where for each year there is an indicator named birth that shows whether a mother (casefe) has given birth or not in that year. In the variables described below 'year' variable is the year of birth of the child. In other words a mother denoted by casefe -21 gave birth in the year 2013 and 2015, my data has years from 2011-2015; hence the birth indicator should take the value 0 for the years 2011, 12 and 14. My research question is to check if the treatment has an impact on the possibility of being born. So any other suggestion to achieve this goal is also appreciated.
Code:
dataex caseid yrb casefe age_m year ----------------------- copy starting from the next line ----------------------------------------- copy up to and including the previous line ------------------ Listed 100 out of 244486 observations Use the count() option to list moreCode:* Example generated by -dataex-. To install: ssc install dataex clear input double caseid byte yrb float(casefe age_m) int year 100011002 1 3 26 2011 100012302 1 6 25 2013 100022704 2 21 24 2013 100022704 1 21 24 2015 100025802 1 24 43 2014 100027503 1 26 31 2013 100027503 2 26 31 2011 100028202 1 28 41 2012 100028702 2 30 27 2011 100028702 1 30 27 2012 100031002 1 32 38 2014 100037402 1 38 29 2012 100045907 3 53 26 2011 100045907 1 53 26 2015 100045907 2 53 26 2012 100046108 2 55 33 2012 100046108 1 55 33 2013 100046302 1 56 33 2013 100048406 1 60 22 2015 100048903 1 61 27 2014 100052002 1 64 21 2011 100052505 2 65 22 2012 100052505 1 65 22 2013 100056102 1 71 36 2014 100056102 2 71 36 2011 100058712 1 75 27 2012 100064104 1 78 29 2014 100067102 1 82 26 2012 100067102 2 82 26 2011 100067507 1 83 29 2012 100068302 1 84 37 2011 100068602 1 85 34 2012 100070202 1 88 29 2011 100070504 2 89 26 2011 100070504 1 89 26 2012 100077203 1 96 21 2014 100079702 1 100 32 2013 100090402 1 102 23 2013 100094302 2 107 25 2012 100094302 1 107 25 2014 100094604 1 109 26 2015 100094604 2 109 26 2012 100094703 1 110 45 2011 100096204 1 113 19 2014 100099405 1 120 23 2011 100104704 1 125 22 2014 100105404 1 126 26 2013 100105408 1 127 22 2012 100107102 2 129 23 2011 100107102 1 129 23 2015 100111702 1 132 36 2012 100115602 1 140 27 2011 100160302 2 145 28 2014 100160302 1 145 28 2015 100161702 1 148 39 2012 100164802 1 153 30 2011 100165203 1 154 41 2013 100165203 2 154 41 2012 100169507 1 159 21 2015 100173010 1 165 22 2014 100174703 1 168 32 2013 100179704 1 179 20 2012 100180302 1 181 23 2013 100180602 1 182 30 2013 100180602 2 182 30 2011 100181202 1 183 38 2011 100181304 1 184 28 2015 100181402 2 185 20 2012 100181402 1 185 20 2013 100182702 1 186 32 2011 100186302 1 189 17 2013 100187302 1 190 26 2012 100188002 1 191 31 2012 100194802 1 199 27 2014 100196203 1 202 29 2015 100198402 1 207 28 2011 100199203 1 209 28 2012 100214404 1 217 26 2014 100218602 2 223 28 2011 100218602 1 223 28 2013 100222102 1 227 34 2011 100223905 2 231 23 2013 100223905 1 231 23 2014 100225610 1 234 23 2014 100228403 1 241 33 2011 100230102 1 244 22 2013 100230102 2 244 22 2012 100233002 2 248 25 2011 100233002 1 248 25 2013 100234402 1 250 26 2012 100239203 1 256 24 2011 100274602 1 260 24 2012 100276102 1 262 29 2011 100277202 1 263 37 2012 100278403 1 266 27 2015 100278603 1 267 22 2013 100290702 1 269 39 2011 100290706 1 270 26 2014 100290706 2 270 26 2012 100291402 1 271 31 2012 end
Comment