PS: I have attached a small portion of my data.
By using a repeated cross sectional data (Demographic and Health Survey; rounds 2008, 2013, and 2018), I am trying to estimate the effect of a refugee shock (influx of refugees) on children's health status. I appended the DHS-2008,2013, and 2018.
The health indicator of children's health is Height-for-age-Z-Score (HAZ).
*The start of the refugee inflow to the country of interest (treatment) started in 2011.
*The country of interest has 81 cities, and the arrivals of the refugees increased year by year.
*For these 81 cities, I have population data from 2008 to 2018, and the number of refugees in each city from 2013 to 2018. Thus, I have created a refugee ratio (Refugee Ratio = Population of City c in year y / Number of Refugees in city c in year y). Since the number of refugees in the cities is available starting from 2013, the refugee ratio takes value of zero before 2013. I have merged the refugee ratio (ranging from 0 and 1) with the city of residence of children so that I can understand whether the child i at the survey year is exposed to any refugee shock.
Please note that each DHS rounds includes the children who born 5 years preceding the survey year. To be more clear,
*DHS 2008 only includes children born between 2003 and 2008. I will use the DHS-2008 to look at the placebo effect.
*DHS-2013 includes children born between 2008-2013.
*DHS-2018 includes children born between 2013-2018.
I am having troubles in creating "time" and "treatment" variables - and hence did variable (treatment*time).
In DHS, I can see the children's year of birth.
1) For the "time" variable, I run this code:
replace time=1 if child_birth_year>=2011
replace time=0 if child_birth_year<=2010. But this is problematic because it is like assuming that those born before 2010 are never treated. But they may be exposed to the presence of refugees later in life. That is way I need to consider the Two Way FE model which is a generalization of DID.
2) My model should be like this
HAZ_ihct= \beta Ref/pop_ct + \alpha_c + \alpha_t + \epsilon
Where i is the individual in household h, in city c, at time t. The treatment variable could be time-lagged (Population/Refugee_ct-1).
My question is how to define the timing of the treatment. I would start by the year of birth. But I cannot define it properly. I would be more than happy if you can help me.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str15 CASEID double haz06 float child_birth_year byte(ref_ratio2008 ref_ratio2009 ref_ratio2010 ref_ratio2011 ref_ratio2012) double(ref_ratio2013 ref_ratio2014 ref_ratio2015 ref_ratio2016 ref_ratio2017 ref_ratio2018) float survey_year " 15220003 02" . 2018 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2018 " 12560019 02" .99 2018 0 0 0 0 0 0 0 .0002882681878477381 .00032848332947102936 .0003680900243030867 .0003833342145614128 2018 " 08360003 02" -3.37 2018 . . . . . . . . . . . 2018 " 331311 2" . 2008 0 0 0 0 0 0 .0016293140344733668 .0014899884519778434 .0020713356178705586 .0023507949691504507 .003313790466479735 2008 " 351016 02" -.47000000000000003 2013 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2013 " 351121 4" 3.36 2008 0 0 0 0 0 .04788275035973622 .0999472747643841 .11175873189629308 .11743237252225154 .11651696452720017 .11183859044012566 2008 " 241024 2" . 2008 0 0 0 0 0 0 .0009685123256973092 .0023463063840160514 .0030950817445735755 .003791346468746906 .004348978375642727 2008 " 08310006 05" 1.6500000000000001 2018 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2018 " 15270016 02" 1.12 2018 0 0 0 0 0 0 .003058014198971529 .01617946120048652 .017461997622404624 .017929279410977463 .018889445600197646 2018 " 05020015 02" . 2018 0 0 0 0 0 0 .00005773732665679883 .00044272332591961336 .0006049068931493858 .0008877145892747302 .0013253948067363278 2018 " 361418 05" -3.64 2013 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2013 " 08840003 02" . 2018 0 0 0 0 0 0 .0003820621806198959 .012800937012466629 .014539319111493854 0 .016161771768778376 2018 " 270203 02" .06 2013 0 0 0 0 0 0 .00027240533914464724 .001320843350189284 .0018435936480313247 .0021550565903887702 .002352538800713619 2013 " 15070004 02" .06 2018 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2018 " 10020016 02" . 2018 0 0 0 0 0 0 .00023380249701066808 .00045309083464366084 .0005070926021381568 .0006098255630834389 .000773722773796144 2018 " 03630018 02" . 2018 0 0 0 0 0 0 .0011833514287489313 .0015244574077174554 .001931277016631255 .0022959288262063876 .002618805023526314 2018 " 13220001 02" . 2018 0 0 0 0 0 0 0 .00038454543092472784 .00042015716990429755 .0005493518161981774 .0006786322016044081 2018 " 3624 4 2" . 2008 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2008 " 14020008 02" . 2018 0 0 0 0 0 0 .0015824092356435922 .007260962835014208 .008873700087596689 .012827431892281782 .01807977328511613 2018 " 15140013 02" .46 2018 0 0 0 0 0 .01706844121744722 .05579131365677821 .03663230331766135 .040618591150628026 .04283047948546196 .04727203436918047 2018 " 300506 07" . 2013 0 0 0 0 0 0 .0001820051507457661 .001454651779024506 .0015804372481581545 .0018795976020213132 .0021050407944305364 2013 " 30823 2" . 2008 0 0 0 0 0 0 .00042050128799544514 .001258123449466077 .00156916707909204 .0028302889052674914 .0034176466991419196 2008 " 15490013 04" 3.14 2018 0 0 0 0 0 0 .0358684560243762 .02910349379580787 .03363500370082111 .03420236069248802 .035309454300846435 2018 " 08720001 06" 3.41 2018 . . . . . . . . . . . 2018 " 01490005 04" . 2018 . . . . . . . . . . . 2018 " 08140014 02" -.73 2018 0 0 0 0 0 0 .0009731488762076778 .027289723967345234 .02992719997245611 .030769056458404935 .031545682890866386 2018 " 13280012 02" 3.2 2018 0 0 0 0 0 0 .0058251612792986195 .01024024892919653 .0125578928192143 .01473730336641184 .017472613024926486 2018 " 340721 04" .06 2013 0 0 0 0 0 .06652216013766796 .13407386002182628 .1532707745377972 .1611138238231951 .16609200130639762 .1860952802550377 2013 " 08130009 02" . 2018 0 0 0 0 0 0 .0044993120551867615 .000057243836018695577 .0001571790230421871 .00019370697632714655 .00029632914543455287 2018 " 2016 4 2" . 2008 0 0 0 0 0 .05016679240964801 .13470861329775055 .22926990225672267 .24379470988608926 .25474312892245304 .27670797885028225 2008 " 322315 2" . 2008 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2008 " 362112 3" . 2008 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2008 " 13140009 02" 4.29 2018 0 0 0 0 0 0 .0001820051507457661 .001454651779024506 .0015804372481581545 .0018795976020213132 .0021050407944305364 2018 " 211117 02" -.62 2013 0 0 0 0 0 0 .0044993120551867615 .000057243836018695577 .0001571790230421871 .00019370697632714655 .00029632914543455287 2013 " 08580019 02" . 2018 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2018 " 020312 02" .59 2013 0 0 0 0 0 .004223024565503383 .022953299495069145 .02451377232877187 .029644525887260003 .033433380590131324 .03681080168444816 2013 " 08780007 06" . 2018 0 0 0 0 0 .02321266219580443 .05621015979240394 .06983977895514358 .0781604732553562 .08195735631500954 .08756423324956697 2018 " 15220005 02" . 2018 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2018 " 3616 3 2" . 2008 0 0 0 0 0 .04788275035973622 .0999472747643841 .11175873189629308 .11743237252225154 .11651696452720017 .11183859044012566 2008 " 191602 02" . 2013 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2013 " 191009 02" . 2013 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2013 " 15240011 02" . 2018 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2018 " 01310015 02" 3.14 2018 0 0 0 0 0 0 .002198727251025549 .008072395591086027 .009833758956685592 .01228752689630511 .013615943558356198 2018 " 321519 2" . 2008 0 0 0 0 0 .008707762760675534 .010841485347166634 .02121220746690404 .026565809766992403 .027556452720052475 .03763569023231071 2008 " 15120013 02" 2.07 2018 0 0 0 0 0 .06652216013766796 .13407386002182628 .1532707745377972 .1611138238231951 .16609200130639762 .1860952802550377 2018 " 360516 10" . 2013 0 0 0 0 0 0 .003058014198971529 .01617946120048652 .017461997622404624 .017929279410977463 .018889445600197646 2013 " 361117 18" . 2013 0 0 0 0 0 .04788275035973622 .0999472747643841 .11175873189629308 .11743237252225154 .11651696452720017 .11183859044012566 2013 " 02480004 02" 1.59 2018 0 0 0 0 0 0 .00042050128799544514 .001258123449466077 .00156916707909204 .0028302889052674914 .0034176466991419196 2018 " 321905 02" . 2013 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2013 " 15400008 05" 2.93 2018 0 0 0 0 0 .04788275035973622 .0999472747643841 .11175873189629308 .11743237252225154 .11651696452720017 .11183859044012566 2018 " 1515 1 3" . 2008 0 0 0 0 0 0 .0058251612792986195 .01024024892919653 .0125578928192143 .01473730336641184 .017472613024926486 2008 " 220902 02" . 2013 0 0 0 0 0 0 .007184038427799658 .033288691896535265 .040787943899100794 .04466624343912569 .052705658856715215 2013 " 2305 4 8" . 2008 0 0 0 0 0 0 .00062882096069869 .015563157546021684 .01961532511731037 .027000495955398218 .028983807011486933 2008 " 362116 15" . 2013 0 0 0 0 0 0 .38875913662708655 .027567199255789664 .0296286803310541 .028966528626727817 .028310345485415594 2013 " 09370016 02" . 2018 0 0 0 0 0 0 .0031986228474722156 .006388068671015908 .009150192905186247 .011309029362651568 .013369636447888305 2018 " 361614 10" . 2008 0 0 0 0 0 .04788275035973622 .0999472747643841 .11175873189629308 .11743237252225154 .11651696452720017 .11183859044012566 2008 " 331414 02" . 2013 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2013 " 03270005 02" . 2018 0 0 0 0 0 0 .003058014198971529 .01617946120048652 .017461997622404624 .017929279410977463 .018889445600197646 2018 " 904 2 4" -.63 2008 0 0 0 0 0 0 .00005773732665679883 .00044272332591961336 .0006049068931493858 .0008877145892747302 .0013253948067363278 2008 " 08470016 02" 2.7 2018 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2018 " 202911 2" . 2008 0 0 0 0 0 .005862441331618374 .02605289896396305 .07233868948402523 .07889778854154687 .08475298102323892 .11341285710191637 2008 " 14200015 02" . 2018 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2018 " 110313 2" . 2008 0 0 0 0 0 0 .007174787509699416 .031019715768991683 .035517040762446765 .04226364519513226 .04788311719971241 2008 " 14250003 02" .06 2018 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2018 " 341322 2" . 2008 0 0 0 0 0 .06652216013766796 .13407386002182628 .1532707745377972 .1611138238231951 .16609200130639762 .1860952802550377 2008 " 281413 2" -1.1500000000000001 2008 0 0 0 0 0 0 .00011045635041172604 .0006433920617217391 .0008220222012608781 .0009968464627442106 .0010674515371820316 2008 " 901 4 2" . 2008 0 0 0 0 0 0 .0007078433287889792 .004006967412537111 .00585145614626821 .006891222912617561 .008190824292140778 2008 " 3008 6 2" . 2008 0 0 0 0 0 0 0 .0007087808072923676 .000769802505839881 .0007990980990104142 .0007202352203496107 2008 " 300820 2" . 2008 0 0 0 0 0 0 0 .0007087808072923676 .000769802505839881 .0007990980990104142 .0007202352203496107 2008 " 230210 08" .58 2013 0 0 0 0 0 0 .007184038427799658 .033288691896535265 .040787943899100794 .04466624343912569 .052705658856715215 2013 " 02540009 02" .79 2018 0 0 0 0 0 0 .00042050128799544514 .001258123449466077 .00156916707909204 .0028302889052674914 .0034176466991419196 2018 " 321622 2" . 2008 0 0 0 0 0 .008707762760675534 .010841485347166634 .02121220746690404 .026565809766992403 .027556452720052475 .03763569023231071 2008 " 03610007 02" . 2018 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2018 " 06140017 02" . 2018 0 0 0 0 0 0 .00023818030248898416 .0018694581396772477 .0023408475608918127 .0026929131727208345 .0029223801510866064 2018 " 031821 02" -.78 2013 0 0 0 0 0 0 .000124912561207155 .014776281434998522 .01615131652647118 .016104017401777047 .015850683307089674 2013 " 08700019 02" -.24 2018 0 0 0 0 0 .05016679240964801 .13470861329775055 .22926990225672267 .24379470988608926 .25474312892245304 .27670797885028225 2018 " 2702 1 6" . 2008 0 0 0 0 0 0 .00027240533914464724 .001320843350189284 .0018435936480313247 .0021550565903887702 .002352538800713619 2008 " 321820 1" . 2008 0 0 0 0 0 0 .0016293140344733668 .0014899884519778434 .0020713356178705586 .0023507949691504507 .003313790466479735 2008 " 3413 7 10" . 2008 0 0 0 0 0 .06652216013766796 .13407386002182628 .1532707745377972 .1611138238231951 .16609200130639762 .1860952802550377 2008 " 160512 02" . 2013 0 0 0 0 0 .009618968606091212 .021339069275154495 .0290470415067701 .03249243627570961 .037346071300631285 .0474086748829915 2013 " 190222 02" 3.2600000000000002 2013 0 0 0 0 0 .008997050147492625 .02827213768040654 .06261454116886157 .06801110066449559 .07022186128875806 .08672574742413153 2013 " 322316 3" . 2008 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2008 " 260219 2" . 2008 0 0 0 0 0 0 .00027240533914464724 .001320843350189284 .0018435936480313247 .0021550565903887702 .002352538800713619 2008 " 161014 2" . 2008 0 0 0 0 0 .009618968606091212 .021339069275154495 .0290470415067701 .03249243627570961 .037346071300631285 .0474086748829915 2008 " 60110 2" . 2008 0 0 0 0 0 0 .0009597122398819938 .005605093848540018 .006927152565854754 .007841130825220038 .009919416695665482 2008 " 15480011 02" 3.52 2018 0 0 0 0 0 .01706844121744722 .05579131365677821 .03663230331766135 .040618591150628026 .04283047948546196 .04727203436918047 2018 " 10380016 02" -.32 2018 0 0 0 0 0 0 0 .0013605880316558115 .0019658040297656156 .003080244808297057 .003557892705015742 2018 " 3606 7 3" . 2008 0 0 0 0 0 0 .003058014198971529 .01617946120048652 .017461997622404624 .017929279410977463 .018889445600197646 2008 " 3623 5 2" . 2008 0 0 0 0 0 .06564723248870687 .25302505814970955 .19301122431724022 .20895875405216974 .22131554125815245 .23438397217027726 2008 " 321923 02" 1.21 2013 0 0 0 0 0 0 .0005527192867710324 .0012878546730791857 .0014915605486325088 .0018673925436199228 .002585906188377838 2013 " 08090017 02" . 2018 0 0 0 0 0 0 .0044993120551867615 .000057243836018695577 .0001571790230421871 .00019370697632714655 .00029632914543455287 2018 " 260116 02" .79 2013 0 0 0 0 0 0 .0003106429376881331 .0004469731536749574 .0006649282520966689 .001218595402075856 .0016888488569159843 2013 " 110919 02" -2.65 2013 0 0 0 0 0 0 .0007183399699369362 .005231954896289372 .007066906324594554 .009549450926769365 .013034530523399625 2013 " 032508 02" -1.35 2013 0 0 0 0 0 0 .0005293736186657138 .005178535253915621 .006102531157651291 .0075278752176857824 .00961912834598957 2013 " 15310014 02" . 2018 0 0 0 0 0 0 .003058014198971529 .01617946120048652 .017461997622404624 .017929279410977463 .018889445600197646 2018 " 030723 02" 1.72 2013 0 0 0 0 0 0 .00042050128799544514 .001258123449466077 .00156916707909204 .0028302889052674914 .0034176466991419196 2013 " 15070001 02" . 2018 0 0 0 0 0 0 .00015178806338669526 .00038953051322353585 .0005659348622776808 .0006848505496186391 .0007857988493412444 2018 " 1011 9 2" 2.23 2008 0 0 0 0 0 0 .007174787509699416 .031019715768991683 .035517040762446765 .04226364519513226 .04788311719971241 2008 " 200603 02" . 2013 0 0 0 0 0 0 .0044993120551867615 .000057243836018695577 .0001571790230421871 .00019370697632714655 .00029632914543455287 2013 " 3104 2 14" . 2008 0 0 0 0 0 0 .0001820051507457661 .001454651779024506 .0015804372481581545 .0018795976020213132 .0021050407944305364 2008 end
0 Response to DID two way fixed effects
Post a Comment