Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Collapse

    Hello I need help to calculate the average pollution exposure during pregnancy for each child.

    Pollution exposure variables are pm10 pm2p5 pm1 d2m sp t2m u10 si10 v10 tp ti_dum aod1240.

    I want to calculate the pollution exposure during 9 months period , first trimester , second trimester please

    id represents each child please. and the data was expanded to match with pollution data during pregnancy

    Thanks

    clear
    input double(time id time_9 month year pregnancy_month trimester mdate pm10 pm2p5 pm1 d2m sp t2m u10 si10 v10 tp ti_dum aod1240)
    654 1 646 11 2013 1 1 646 2.1848168212500008e-08 1.5490398370833333e-08 1.3244939462916665e-08 251.8695 62499.06 256.9789 -.008176035 1.016907 -.03203929 .0008932568 30 .013052357866666668
    654 1 647 12 2013 2 1 647 2.3386091298387093e-08 1.6567432879032245e-08 1.4193065572580645e-08 250.7096 62054.38 254.6034 -.01461392 .9991802 .02102874 .00124179 31 .02018836067741936
    654 1 648 1 2014 3 1 648 2.5813660141129056e-08 1.8278381967741937e-08 1.5679075500000007e-08 249.3413 62094.52 254.0936 -.006093188 .9859796 .03653177 .0007780698 31 .01598412893548387
    654 1 649 2 2014 4 2 649 2.1429963437499997e-08 1.5179390241071425e-08 1.2967488325446431e-08 251.1532 61674.23 255.3988 .0304513 .8935758 .1507175 .001765706 28 .01969813842857143
    654 1 650 3 2014 5 2 650 1.82283768451613e-08 1.2956697269274203e-08 1.0865822092258058e-08 257.578 62081.92 261.0492 -.004010342 .8330418 .1039103 .003653287 31 .02288081793548388
    654 1 651 4 2014 6 2 651 1.7993312832083336e-08 1.2950031191666678e-08 1.0224498127916668e-08 260.4528 62422.72 264.9268 .01852227 .7906115 .003736913 .001554653 30 .026313025833333333
    654 1 652 5 2014 7 3 652 1.675138060282258e-08 1.2383392073790322e-08 8.529329490322581e-09 267.4797 62526.61 270.457 .04976497 .7091452 .06217138 .001354005 31 .04790162354838709
    654 1 653 6 2014 8 3 653 1.6521321212916673e-08 1.2551625009166673e-08 7.747658777499992e-09 270.9575 62587.21 277.0749 .2597538 .7089566 -.04456096 .000711187 30 .04407622133333334
    654 1 654 7 2014 9 3 654 2.283535381370968e-08 1.775996187983872e-08 9.70539421008065e-09 270.3469 62558.88 283.4774 .5498375 .8081493 -.1599392 .0004057556 31 .05811391322580645
    681 2 673 2 2016 1 1 673 4.6297621810344864e-08 3.287571219827585e-08 2.7895813577586202e-08 252.148 68228 261.7212 -.2823544 1.136466 -.7156629 .001054519 29 .0371121875862069
    681 2 674 3 2016 2 1 674 3.2609308072580675e-08 2.3332434540322578e-08 1.86690671048387e-08 264.2735 68213.05 268.7503 -.223656 .826253 -.384733 .007562214 31 .0547577070967742
    681 2 675 4 2016 3 1 675 2.9131555916666675e-08 2.1077633504166667e-08 1.6309033116666663e-08 267.3606 68250.83 272.1475 -.219869 .7953259 -.4202111 .005483646 30 .05370581833333334
    681 2 676 5 2016 4 2 676 2.3134072028225815e-08 1.710432906975807e-08 1.1794257281451623e-08 271.0709 68359.44 277.405 -.2141885 1.003895 -.689427 .002161057 31 .06809349903225807
    681 2 677 6 2016 5 2 677 2.6952481633333324e-08 2.0581239308333325e-08 1.259425683333334e-08 276.7188 68365.74 285.0174 .05241586 1.045194 -.4380992 .001566544 30 .10628532633333333
    681 2 678 7 2016 6 2 678 3.349041112499998e-08 2.5948173241935474e-08 1.571991937096775e-08 277.1903 68152.45 288.9762 .1804162 1.055 -.1023992 .000998783 31 .10228490483870967
    681 2 679 8 2016 7 3 679 2.6523019274193553e-08 2.0214849604838703e-08 1.331901033467742e-08 277.1058 68276.01 286.5737 .1306173 .9554298 .1006308 .001236588 31 .0725070035483871
    681 2 680 9 2016 8 3 680 3.284204312916668e-08 2.4535541941666662e-08 1.7973121654166676e-08 272.8809 68406.66 285.1635 .08043961 1.045571 -.119691 .0006547082 30 .07146417433333332
    681 2 681 10 2016 9 3 681 3.620743525403226e-08 2.6307643649193538e-08 2.091313598387097e-08 269.0842 68464.9 276.7123 -.02237726 .966556 -.2350692 .002044384 31 .059636619354838716
    684 3 676 5 2016 1 1 676 4.5234980088709676e-08 3.325523276612905e-08 2.391689780241934e-08 281.5515 80513.07 291.6126 -.01404587 1.661848 -.8229915 .002185581 31 .1212945306451613
    684 3 677 6 2016 2 1 677 5.141920795e-08 3.923277697916666e-08 2.4876919037500004e-08 286.1394 80408.4 294.9783 .08744555 1.425747 -.2380506 .001803606 30 .18422583566666662
    684 3 678 7 2016 3 1 678 5.5503324637096766e-08 4.329323651209679e-08 2.7693188633064496e-08 291.1037 80190.38 295.3831 .03916138 1.133826 .3698467 .005814344 31 .18157498161290328
    684 3 679 8 2016 4 2 679 3.838414247177422e-08 2.851092914516128e-08 2.111572093145162e-08 288.3047 80377.7 293.9296 .05771765 1.213972 .03116534 .003082554 31 .10229739741935487
    684 3 680 9 2016 5 2 680 6.292235800833334e-08 4.662730020833336e-08 3.526493208750001e-08 285.4894 80581.55 292.7013 .06301944 1.328251 -.04784045 .001609646 30 .13570991400000001
    684 3 681 10 2016 6 2 681 6.872257551612904e-08 4.9483845403225834e-08 4.044715605241936e-08 277.5158 80835.77 287.4265 .008108037 1.649024 -.7138741 .0003938653 31 .09224596967741934
    684 3 682 11 2016 7 3 682 8.215635716666667e-08 5.855450268333332e-08 4.9173095154166654e-08 271.3455 81019.15 281.1246 -.1477267 1.735582 -1.130965 .001138494 30 .08472968333333336
    684 3 683 12 2016 8 3 683 8.80836876612904e-08 6.231555673387096e-08 5.340627536290324e-08 264.7968 81012.85 275.1247 -.2121056 2.128393 -1.923706 .0008293466 31 .053776930645161286
    684 3 684 1 2017 9 3 684 7.905807221774201e-08 5.6021698306451623e-08 4.758289834677421e-08 265.0782 80812.15 270.878 -.1047444 1.652796 -1.546863 .005186389 31 .06651924999999999
    613 4 605 6 2010 1 1 605 2.0961224570416663e-08 1.553167074208334e-08 1.0695266672500001e-08 278.6508 73061.28 285.71 -.1696913 1.4001 -.3623729 .003090728 30 .06561088500000002
    613 4 606 7 2010 2 1 606 2.5223556133064537e-08 1.9277454834677417e-08 1.2210862842741933e-08 283.7812 73026.65 289.2749 .04635667 1.241882 .1107674 .01241047 31 .08871172509677419
    613 4 607 8 2010 3 1 607 2.6216582379032244e-08 1.9762182931451633e-08 1.3840642677419352e-08 286.0329 73116.37 289.4178 -.01745417 1.111951 .1259723 .006509182 31 .0756601793548387
    613 4 608 9 2010 4 2 608 3.1010728008333347e-08 2.3296803858333356e-08 1.6949104449999996e-08 279.8193 73213.18 284.7057 -.2988278 1.321462 -.2458021 .003259421 30 .07821958166666666
    613 4 609 10 2010 5 2 609 3.3130328165322546e-08 2.3856016459677416e-08 1.9408454669354836e-08 272.322 73335.17 280.5294 -.3340468 1.596977 -.6667688 .000266788 31 .038299980967741946
    613 4 610 11 2010 6 2 610 4.369912799166668e-08 3.104424941666667e-08 2.640474542500001e-08 265.9789 73375.31 275.2762 -.5408167 1.604143 -.8516125 .0003611671 30 .024432938200000007
    613 4 611 12 2010 7 3 611 4.7710019120967764e-08 3.383587405241936e-08 2.887998940322583e-08 258.8819 72995.95 271.0425 -.5394912 1.667317 -.9243574 .0004733815 31 .024130219064516133
    613 4 612 1 2011 8 3 612 5.184421890725805e-08 3.670864946774192e-08 3.1451741733870976e-08 254.7089 72899.15 263.9625 -.8560839 1.689946 -1.38587 .001943317 31 .022159289419354838
    613 4 613 2 2011 9 3 613 4.198227002678571e-08 2.9767969522321433e-08 2.528432807589285e-08 261.9834 72833.82 267.4917 -.6500714 1.193983 -.8092773 .01101188 28 .031908908535714285
    684 5 676 5 2016 1 1 676 4.5234980088709716e-08 3.325523276612902e-08 2.3916897802419333e-08 281.5515 80513.07 291.6126 -.01404587 1.661848 -.8229915 .002185581 31 .12129453064516128
    684 5 677 6 2016 2 1 677 5.141920795e-08 3.9232776979166685e-08 2.4876919037500027e-08 286.1394 80408.4 294.9783 .08744555 1.425747 -.2380506 .001803606 30 .18422583566666664
    684 5 678 7 2016 3 1 678 5.5503324637096825e-08 4.3293236512096776e-08 2.7693188633064516e-08 291.1037 80190.38 295.3831 .03916138 1.133826 .3698467 .005814344 31 .1815749816129032
    684 5 679 8 2016 4 2 679 3.8384142471774224e-08 2.8510929145161274e-08 2.1115720931451614e-08 288.3047 80377.7 293.9296 .05771765 1.213972 .03116534 .003082554 31 .10229739741935484
    684 5 680 9 2016 5 2 680 6.292235800833336e-08 4.662730020833331e-08 3.5264932087500016e-08 285.4894 80581.55 292.7013 .06301944 1.328251 -.04784045 .001609646 30 .135709914
    684 5 681 10 2016 6 2 681 6.872257551612901e-08 4.9483845403225795e-08 4.044715605241936e-08 277.5158 80835.77 287.4265 .008108037 1.649024 -.7138741 .0003938653 31 .09224596967741934
    684 5 682 11 2016 7 3 682 8.215635716666665e-08 5.8554502683333326e-08 4.917309515416667e-08 271.3455 81019.15 281.1246 -.1477267 1.735582 -1.130965 .001138494 30 .08472968333333335
    684 5 683 12 2016 8 3 683 8.808368766129033e-08 6.2315556733871e-08 5.340627536290327e-08 264.7968 81012.85 275.1247 -.2121056 2.128393 -1.923706 .0008293466 31 .053776930645161286
    684 5 684 1 2017 9 3 684 7.905807221774196e-08 5.6021698306451604e-08 4.7582898346774214e-08 265.0782 80812.15 270.878 -.1047444 1.652796 -1.546863 .005186389 31 .06651924999999997
    610 6 602 3 2010 1 1 602 6.354170322580639e-08 4.566742580645161e-08 3.6408531971774184e-08 277.4255 86397.85 287.3594 .2059784 1.738788 -1.439833 .001683217 31 .08808859096774192
    610 6 603 4 2010 2 1 603 5.0016608524999985e-08 3.644028279999998e-08 2.6901560474999997e-08 281.6063 86301.04 291.5108 .1872328 1.85005 -1.466963 .00231786 30 .11376694
    610 6 604 5 2010 3 1 604 3.9274508338709683e-08 2.883562052822579e-08 1.9765311802419347e-08 283.1177 85909.88 295.066 .1887476 1.721062 -1.088928 .002003511 31 .11822881354838709
    610 6 605 6 2010 4 2 605 3.337205588791667e-08 2.493085984749999e-08 1.694596915375e-08 283.2271 85754.04 298.3993 .1478481 1.636013 -.6736259 .0008256309 30 .112968111
    610 6 606 7 2010 5 2 606 4.384752189516131e-08 3.4092910762096775e-08 2.0842184665322567e-08 289.8814 85653.3 299.6449 .06813188 1.369173 .2434375 .01485318 31 .15880465096774193
    610 6 607 8 2010 6 2 607 4.1747617544354854e-08 3.1688017915322584e-08 2.1926293088709686e-08 293.4399 85794.18 297.2716 .1260729 1.067446 .09258115 .009398518 31 .13092584516129033
    610 6 608 9 2010 7 3 608 5.205410647083334e-08 3.940657082916667e-08 2.8316276712500003e-08 287.0372 86042.1 294.7218 .3080379 1.412546 -.691514 .001855626 30 .13001961166666667
    610 6 609 10 2010 8 3 609 5.444816229435485e-08 3.9335256564516136e-08 3.2038724088709686e-08 279.1981 86293.96 291.1169 .2722508 1.538706 -.7648552 .00007654364 31 .0753119041935484
    610 6 610 11 2010 9 3 610 6.402904312916668e-08 4.5455946054166655e-08 3.865147276666666e-08 272.4353 86537.16 284.9741 .3097421 1.597919 -1.015885 .00006762593 30 .03764035066666667
    672 7 664 5 2015 1 1 664 4.505513187903225e-08 3.317670926612902e-08 2.3900326943548385e-08 283.9137 86589.89 294.6861 .057907 1.687872 -1.115462 .002271785 31 .12853324451612902
    672 7 665 6 2015 2 1 665 4.748219824166667e-08 3.5985161841666665e-08 2.3379239175000002e-08 286.5965 86238.87 298.0508 -.08240111 1.414998 -.3522363 .0009943242 30 .150402026
    672 7 666 7 2015 3 1 666 4.3840961463709675e-08 3.424615439919353e-08 2.1651590249999984e-08 293.9027 86083.82 298.9198 .0007233999 1.059903 .3731262 .00693203 31 .15440520483870965
    672 7 667 8 2015 4 2 667 5.408113216532261e-08 4.216646070564514e-08 2.7659346625000026e-08 292.9684 86297.11 297.5584 .07930352 1.052171 -.0287598 .005017696 31 .16293860870967744
    672 7 668 9 2015 5 2 668 4.519225678333333e-08 3.299472789999999e-08 2.5772150387500006e-08 285.6977 86674.11 294.9989 .002048848 1.445547 -.6339739 .0008828528 30 .08338860666666668
    672 7 669 10 2015 6 2 669 5.531074044354836e-08 3.952708291129032e-08 3.2902976721774184e-08 281.5823 87101.47 290.7825 .00678259 1.471571 -.7562093 .002649302 31 .06698778225806451
    672 7 670 11 2015 7 3 670 6.681430149583334e-08 4.731040305833331e-08 4.024417421666673e-08 275.2199 87213.24 283.6311 .09804913 1.794042 -1.603509 .003078838 30 .057185191333333316
    672 7 671 12 2015 8 3 671 8.161724770161285e-08 5.78410594233871e-08 4.943323457661291e-08 269.8111 87188.05 279.4244 .1648896 1.732565 -1.556702 .0008828528 31 .05851215741935484
    672 7 672 1 2016 9 3 672 7.972806354838708e-08 5.637899536290321e-08 4.8181783604838714e-08 270.2508 87105.41 278.932 .104487 1.584908 -1.360231 .002737736 31 .053489567419354865
    659 8 651 4 2014 1 1 651 6.335546062499996e-08 4.5333532208333336e-08 3.653832155416669e-08 282.7653 91803.31 293.0195 -.06592769 1.482132 -.8781465 .002465746 30 .08670659133333333
    659 8 652 5 2014 2 1 652 4.81538515846774e-08 3.474202263709675e-08 2.6109387169354838e-08 285.5806 91422.38 297.4339 -.1818097 1.527579 -.9315127 .002176663 31 .12383080967741934
    659 8 653 6 2014 3 1 653 4.686763920416666e-08 3.517768025416668e-08 2.341758585416669e-08 286.7261 90754.96 303.8245 -.2762952 1.616589 -.4792418 .0005558703 30 .13042144833333336
    659 8 654 7 2014 4 2 654 5.368670059274192e-08 4.138475460887097e-08 2.6035168245967755e-08 294.0372 90784.87 302.7488 -.297881 1.315993 .2341953 .004344409 31 .18713949677419356
    659 8 655 8 2014 5 2 655 5.845345747983869e-08 4.4368659362903225e-08 3.0481062463709696e-08 293.486 90995.01 301.2444 -.2124843 1.151175 -.1653056 .003596808 31 .18053953741935483
    659 8 656 9 2014 6 2 656 5.813987984250003e-08 4.224033801499999e-08 3.390447913166668e-08 291.5723 91327.15 299.4653 -.2516797 1.24471 -.01116984 .002590593 30 .10168597366666667
    659 8 657 10 2014 7 3 657 6.876232653225817e-08 4.933331857258062e-08 4.050106979032257e-08 284.8576 91992.99 293.7575 -.07709932 1.423861 -.651862 .00194183 31 .09240839677419357
    659 8 658 11 2014 8 3 658 8.749317220833332e-08 6.1977315875e-08 5.266068710416667e-08 276.7726 92100.82 286.9405 -.07236557 1.561901 -1.130369 .001166733 30 .041600637833333336
    659 8 659 12 2014 9 3 659 1.0667600685483868e-07 7.549070745967743e-08 6.467633322983869e-08 272.2903 92207.07 282.2014 -.06422354 1.542477 -1.096083 .00001857855 31 .04228088419354839
    651 9 643 8 2013 1 1 643 4.7500453383064527e-08 3.543216268951613e-08 2.6220015173387102e-08 292.7831 84158.69 296.0259 -.05664955 .9450579 .1340219 .007842379 31 .1356626332258065
    651 9 644 9 2013 2 1 644 6.929646732916663e-08 5.101931617916667e-08 3.939910683750001e-08 288.3527 84456.98 293.8549 -.1562475 1.111196 -.2016781 .00191582 30 .14504417333333333
    651 9 645 10 2013 3 1 645 8.068751497177415e-08 5.76603725685484e-08 4.806065291129032e-08 282.7028 84832.41 289.9989 -.2263069 1.253197 -.3710188 .001211322 31 .09510397064516128
    651 9 646 11 2013 4 2 646 8.761401149999993e-08 6.214296612500005e-08 5.290258279166668e-08 271.9648 85033.11 282.0369 -.6127695 1.659019 -1.206393 .001796918 30 .059121760333333336
    651 9 647 12 2013 5 2 647 1.0419749475806455e-07 7.377758475806455e-08 6.303675028225806e-08 269.5316 84866.25 278.8 -.6419294 1.65619 -1.206095 .0007988778 31 .059667851612903236
    651 9 648 1 2014 6 2 648 1.1080518592741937e-07 7.838467520161295e-08 6.713208907258065e-08 268.0865 85024.45 278.0305 -.6180713 1.692963 -1.317598 .0006286982 31 .048484158709677413
    651 9 649 2 2014 7 3 649 1.0107458352678578e-07 7.156814937500001e-08 6.08578396428571e-08 270.2374 84648.24 277.7167 -.5396806 1.513059 -1.174493 .00433995 28 .08726889142857142
    651 9 650 3 2014 8 3 650 7.95134833870968e-08 5.653115241935482e-08 4.682250582258065e-08 275.5762 84835.56 281.8843 -.6381424 1.431215 -.9655 .008445067 31 .09282850483870969
    651 9 651 4 2014 9 3 651 6.335546062499998e-08 4.5333532208333336e-08 3.653832155416665e-08 279.4583 84760.79 287.9481 -.5228285 1.440456 -.8188176 .003680783 30 .08670659133333333
    628 10 620 9 2011 1 1 620 5.227544368333334e-08 3.761865636666665e-08 3.066987652499999e-08 287.7094 84335.78 294.0086 -.1462119 1.113271 -.2094296 .002002025 30 .08458604533333335
    628 10 621 10 2011 2 1 621 6.464201952822573e-08 4.6410549294354844e-08 3.772323223387096e-08 279.9902 84831.62 288.8269 -.43213 1.466668 -.6551415 .002215307 31 .07885083451612904
    628 10 622 11 2011 3 1 622 7.377266187499999e-08 5.226675787916665e-08 4.453245842500001e-08 275.7461 84959.91 284.3702 -.6303791 1.588868 -1.119338 .001921766 30 .0530151083
    628 10 623 12 2011 4 2 623 9.683759927419352e-08 6.883140120967741e-08 5.846715822580643e-08 267.689 84868.61 278.3303 -.6724147 1.739731 -1.284206 .0005729626 31 .057725035161290336
    628 10 624 1 2012 5 2 624 1.1820715169354842e-07 8.373597842741938e-08 7.148275883064518e-08 266.0557 84697.04 274.3563 -.6913497 1.769338 -1.517944 .003170244 31 .06659578064516129
    628 10 625 2 2012 6 2 625 1.0368066422413789e-07 7.364868116379311e-08 6.191332810344826e-08 269.0707 84608.1 276.1344 -.6735508 1.617155 -1.316703 .006470538 29 .0733594503448276
    628 10 626 3 2012 7 3 626 9.699274653225819e-08 7.029102016129033e-08 5.405837370967743e-08 274.1599 84620.69 282.4341 -.6296217 1.611686 -1.19089 .006032828 31 .188466985483871
    628 10 627 4 2012 8 3 627 6.094747162500001e-08 4.3790163866666674e-08 3.503485372500001e-08 279.4554 84576.62 287.8561 -.5783079 1.492881 -.8429666 .003723142 30 .09154156766666667
    628 10 628 5 2012 9 3 628 5.06258037016129e-08 3.670430206854839e-08 2.6172869879032244e-08 281.421 84431.8 291.9978 -.6610537 1.720496 -1.041823 .001438723 31 .13709787903225804
    622 11 614 3 2011 1 1 614 7.808511665322579e-08 5.554349068548391e-08 4.5850659395161277e-08 274.0581 84673.42 283.8475 -.6913497 1.668448 -1.298815 .003697875 31 .06593047451612902
    622 11 615 4 2011 2 1 615 6.042942328749995e-08 4.3483006583333315e-08 3.4597608191666666e-08 277.9143 84696.25 287.8799 -.5332427 1.568124 -.9911397 .004031546 30 .08415677966666665
    622 11 616 5 2011 3 1 616 4.6152747677419376e-08 3.377555521774195e-08 2.4604938649193557e-08 282.0537 84338.14 295.6688 -.4381891 1.607726 -.8006314 .0007438853 31 .11208019903225806
    622 11 617 6 2011 4 2 617 6.94607754166667e-08 5.4227342791666635e-08 3.275143470000001e-08 286.8068 83928.87 298.3722 -.05475606 1.358235 -.0168344 .001819212 30 .21010972000000006
    622 11 618 7 2011 5 2 618 5.795057697580648e-08 4.513705108870972e-08 2.8066149943548387e-08 291.4225 83998.13 297.3257 -.002874244 1.141558 .2353878 .004870553 31 .2136283438709677
    622 11 619 8 2011 6 2 619 4.8173148649193584e-08 3.6099478693548405e-08 2.6187573713709672e-08 292.3827 84131.15 296.6255 .001859498 .9837167 .1340219 .004952299 31 .14313560548387097
    622 11 620 9 2011 7 3 620 5.227544368333333e-08 3.761865636666668e-08 3.0669876525e-08 287.7094 84335.78 294.0086 -.1462119 1.113271 -.2094296 .002002025 30 .08458604533333333
    622 11 621 10 2011 8 3 621 6.464201952822578e-08 4.6410549294354884e-08 3.772323223387096e-08 279.9902 84831.62 288.8269 -.43213 1.466668 -.6551415 .002215307 31 .07885083451612904
    622 11 622 11 2011 9 3 622 7.377266187499993e-08 5.226675787916665e-08 4.4532458425000004e-08 275.7461 84959.91 284.3702 -.6303791 1.588868 -1.119338 .001921766 30 .05301510829999999
    681 12 673 2 2016 1 1 673 1.1257251629310342e-07 7.983491624999995e-08 6.78928194827586e-08 260.8945 75884.43 270.8542 -.401834 1.829118 -1.693248 .002496958 29 .06357642896551724
    681 12 674 3 2016 2 1 674 7.858876862903227e-08 5.594100096774194e-08 4.564224001612902e-08 269.9416 75849.8 276.0846 -.4039169 1.57001 -1.301498 .01017659 31 .08956913161290324
    681 12 675 4 2016 3 1 675 6.675208849583332e-08 4.790843339166667e-08 3.8174434137499984e-08 274.131 75767.16 281.2848 -.4637514 1.505516 -1.023636 .006780429 30 .08373557566666667
    681 12 676 5 2016 4 2 676 5.3291882995967724e-08 3.869456773790321e-08 2.9110581689516113e-08 278.8294 75683.73 286.8854 -.1670404 1.488166 -.636359 .003099646 31 .11078863161290323
    681 12 677 6 2016 5 2 677 5.6870083041666665e-08 4.291277149999998e-08 2.818556132083335e-08 284.4341 75627.85 290.6353 .146712 1.441587 -.1009085 .004382309 30 .15466732033333333
    681 12 678 7 2016 6 2 678 5.7233112604838715e-08 4.4132000584677384e-08 2.914792416935486e-08 288.5774 75415.35 291.8128 .2375998 1.194171 .2717603 .00677597 31 .1561824709677419
    681 12 679 8 2016 7 3 679 4.2703593415322584e-08 3.137962824193548e-08 2.395984173387097e-08 285.7141 75578.27 290.4957 .2483928 1.245465 .2064687 .003675581 31 .0820977148387097
    681 12 680 9 2016 8 3 680 7.139657912083334e-08 5.2448131674999986e-08 4.05929092375e-08 283.7043 75750.63 288.7782 .2533159 1.300341 .01655672 .00243602 30 .11799351
    681 12 681 10 2016 9 3 681 8.910990326612902e-08 6.386837302419354e-08 5.273363852822581e-08 275.5022 75930.87 283.3172 .0323448 1.484018 -.4440619 .001192 31 .07136536225806453
    672 13 664 5 2015 1 1 664 5.4689374875e-08 3.9817811520161274e-08 3.007122507258066e-08 283.0101 84494.76 293.1699 -.5035148 1.595657 -.8775502 .002506618 31 .128533244516129
    672 13 665 6 2015 2 1 665 4.780084386666665e-08 3.569765788749999e-08 2.4577624158333344e-08 286.3718 84172.86 295.6082 -.3029935 1.304867 -.3364351 .001231386 30 .150402026
    672 13 666 7 2015 3 1 666 4.6616648774193567e-08 3.5862548629032266e-08 2.383684424999999e-08 293.4149 84020.96 297.2164 .01909032 .9846596 .2979962 .007469321 31 .1544052048387097
    672 13 667 8 2015 4 2 667 5.90231071451613e-08 4.5107162971774186e-08 3.1434470524193546e-08 292.1705 84224.8 296.0854 -.03335954 .9918256 .001053698 .004562149 31 .16293860870967744
    672 13 668 9 2015 5 2 668 5.176218043333334e-08 3.7348559587499995e-08 3.018536133333332e-08 285.1687 84583.7 293.0422 -.3141651 1.309016 -.5013038 .001045601 30 .08338860666666667
    672 13 669 10 2015 6 2 669 7.062719347177422e-08 5.0268540161290324e-08 4.23089280403226e-08 280.7046 84970.14 289.1461 -.3834671 1.370116 -.592235 .003636938 31 .06698778225806452
    672 13 670 11 2015 7 3 670 9.059508208333333e-08 6.413219200000002e-08 5.4706310512500044e-08 275.1844 85032.32 283.1094 -.6139056 1.576799 -1.129772 .003559651 30 .057185191333333336
    672 13 671 12 2015 8 3 671 1.1326749495967738e-07 8.016681286290326e-08 6.870888907258066e-08 269.5307 84979.59 278.7188 -.6192074 1.596977 -1.217126 .00141197 31 .05851215741935484
    672 13 672 1 2016 9 3 672 1.098179533870968e-07 7.763530197580643e-08 6.654907358870964e-08 269.8235 84888.29 278.3368 -.5162012 1.445547 -1.036158 .003218549 31 .05348956741935485
    602 14 594 7 2009 1 1 594 3.997460514112903e-08 3.018465390725807e-08 2.0630030931451606e-08 287.3541 80847.57 295.2467 .06529164 1.199829 -.168287 .003756583 31 .13129598032258066
    602 14 595 8 2009 2 1 595 5.786914234677421e-08 4.4988697927419384e-08 2.8099524891129036e-08 290.3576 81066.37 294.9274 .1671618 1.065183 .1197114 .005316439 31 .1685515422580645
    602 14 596 9 2009 3 1 596 4.608318822166668e-08 3.360286573583333e-08 2.6271135790416667e-08 283.0802 81341.84 292.3701 -.1005787 1.313165 -.4780493 .001088703 30 .07937183466666667
    602 14 597 10 2009 4 2 597 6.014272044354838e-08 4.319080239919354e-08 3.5470760649193517e-08 275.8124 81625.18 286.538 -.2867094 1.472326 -.8077866 .0005885686 31 .06253991096774193
    602 14 598 11 2009 5 2 598 7.610846591666664e-08 5.403894966666667e-08 4.578510708333335e-08 269.0573 81697.59 279.7437 -.610308 1.668637 -1.169723 .00226807 30 .06350163966666668
    602 14 599 12 2009 6 2 599 8.531340407258063e-08 6.044321274193549e-08 5.161195326612902e-08 266.0547 81654.3 275.1864 -.7744742 2.037309 -1.73439 .001678758 31 .04323823580645162
    602 14 600 1 2010 7 3 600 9.541309060483873e-08 6.750926701612902e-08 5.771190016129029e-08 266.4417 81724.35 276.26 -.7064976 1.657133 -1.277051 .002569785 31 .045913515161290316
    602 14 601 2 2010 8 3 601 8.545920540178571e-08 6.089323928571429e-08 5.0581317500000015e-08 268.7971 81466.98 275.5316 -.6142843 1.376527 -1.027214 .01485095 28 .08709079464285711
    602 14 602 3 2010 9 3 602 7.584009786290321e-08 5.422108544354838e-08 4.443116627419354e-08 273.0239 81558.28 282.4817 -.7153971 1.720685 -1.390044 .004639436 31 .07589444419354839
    617 15 609 10 2010 1 1 609 7.218176314919356e-08 5.1689032189516155e-08 4.2935820116935476e-08 283.3481 87555.6 291.8701 -.3181415 1.299776 -.5582476 .000580394 31 .061103099032258065
    617 15 610 11 2010 2 1 610 9.134842692083329e-08 6.467968603750001e-08 5.5368087554166675e-08 277.0232 87808.25 286.4644 -.2874668 1.252254 -.6250299 .00002229426 30 .03564084133333333
    617 15 611 12 2010 3 1 611 1.110479438709678e-07 7.859171774193551e-08 6.732323790725805e-08 271.4837 87635.88 280.8151 -.3219284 1.234527 -.6843587 .0005588429 31 .0407488064516129
    617 15 612 1 2011 4 2 612 1.0419942375000003e-07 7.371373346370973e-08 6.313220779032257e-08 269.7976 87703.57 279.0099 -.5830417 1.621869 -1.250815 .001740439 31 .0389403
    617 15 613 2 2011 5 2 613 8.513959156250003e-08 6.032920196428568e-08 5.111491116071431e-08 274.3759 87669.73 280.8129 -.6646514 1.546249 -1.123512 .008814409 28 .057174241785714286
    617 15 614 3 2011 6 2 614 7.80851166532258e-08 5.554349068548388e-08 4.585065939516132e-08 276.4269 87605.19 286.8345 -.6218583 1.657133 -1.245151 .003419197 31 .05760009258064518
    617 15 615 4 2011 7 3 615 6.042942328749995e-08 4.3483006583333355e-08 3.4597608191666646e-08 280.551 87592.59 290.4492 -.4991597 1.596034 -1.029897 .003593092 30 .07917332999999999
    617 15 616 5 2011 8 3 616 4.615274767741937e-08 3.37755552177419e-08 2.460493864919354e-08 283.5219 87141.61 298.8928 -.4989704 1.579062 -.7913892 .0007067282 31 .10096209999999999
    617 15 617 6 2011 9 3 617 6.946077541666663e-08 5.422734279166664e-08 3.2751434700000004e-08 289.311 86724.48 300.4923 -.2461886 1.343149 .0538236 .003077352 30 .19007104899999996
    end
    format %tm time
    format %tm time_9
    format %tm mdate
    [/CODE]


  • #2
    Clyde Schechter

    Sir please can you help

    Comment


    • #3
      I want to calculate the pollution exposure during 9 months period , first trimester , second trimester please
      What is the pertinent measure of pollution exposure during these periods? Is it the total? Or the mean? Or the maximum value? Or the median? Or something else?

      To illustrate the general approach, let me assume that the exposure measure should be the mean. Then I would do it as:
      Code:
      local pollution_vars pm10 pm2p5 pm1 d2m sp t2m u10 si10 v10 tp ti_dum aod1240
      
      foreach v of varlist `pollution_vars' {
          by id trimester, sort: egen `v'_trimester = mean(`v')
          by id: egen `v'_pregnancy = mean(`v')
      }
      I don't recommend using -collapse- here because you want more than one level of aggregation. It can be done with -collapse-, but that is less convenient.

      It is also possible that the pertinent exposure measure may be different for different pollutants. Then you would have to create separate local macros for each type of exposure listing the variables it applies to and write a separate loop over that list of variables. In each such loop you wold replace -mean()- by the corresponding -egen- function for the relevant statistic.

      Comment


      • #4
        Thanks Clyde Schechter



        But id represtents the each child I have to these nine observation into one. and that will represent average air pollution during pregnancy period. and than collapse first three months to get air pollution during first trimester

        I have run the code the the number of obs stay the same please , id represent each child and there are nine row for each child , after we do the collapse there should be one obs for each child

        Comment


        • #5
          After the code in #3, you can run:
          Code:
          by id trimester: keep if _n == 1
          keep id trimester *_trimester *_pregnancy
          reshape wide *_trimester, i(id) j(trimester)
          foreach p of local pollution_vars {
              order `p'*, last
          }

          Comment


          • #6
            can you please explain what the code in #3 doing please

            Comment


            • #7
              Code:
              local pollution_vars pm10 pm2p5 pm1 d2m sp t2m u10 si10 v10 tp ti_dum aod1240
              just stores a list of the pollution variables in local macro pollution_vars

              Code:
              foreach v of varlist `pollution_vars' {
              
              }
              creates a loop that iterates over the list of pollution variables. The code between the curly braces is executed once for each of the pollution variables.

              And finally here's what gets done for each of the pollution variables:
              Code:
                  by id trimester, sort: egen `v'_trimester = mean(`v')
                  by id: egen `v'_pregnancy = mean(`v')
              The first of these commands partitions the data into groups defined by a combination of a value of id and a value of trimester. For each such group, a new variable is calculated, whose name is the name of the pollution variable suffixed by _trimester, and it contains the mean value of the pollution variable among observations in the group.

              The second of these commands goes back and partitions the data into groups defined just by a value of id. Each such group then constitutes the totality of observations for the pregnancy defined by id. Then for each such group (pregnancy), the mean value of the pollution variable is calculated and the result is stored in a new variable whose name is the pollution variable name suffixed by _pregnancy.

              Comment


              • #8
                Dear Clyde,


                I have a question regarding plotting of elasticities of individual cross sections in a single stata graph.

                reg lnTFP lnEU, robust
                margins, eyex(lnEU)
                marginsplot, xline(0) xtitle("name") ytitle("name")

                This command gives an elasticity plot with a confidence interval. However, how can I plot the elasticity for each of my cross-sections? I have 17 cross-sections. The cross-section variable is named ID. Further, let's say I divide the cross sections into two categories such as RDE and RDW (both are dummy variables, giving the value of 1 to countries that belong to a particular region and zero otherwise). What can be the commands for plotting individual elasticities in a single graph and then dividing the countries' plots according to the RDE and RDW?

                Comment


                • #9
                  Adeel Dar Your question has absolutely no relationship to the topic of this thread. It is important to keep threads on topic so that people who follow them, or search them, can use their time productively, not being led to matter that is irrelevant to their quest, nor being unable to find something relevant because it is hidden in a thread with an unrelated title.

                  Please repost this as a new thread. Also, it is unwise to address it to me or any other person in particular. There are many people who can answer this kind of question and you are best served by getting an answer from whichever one sees it first. Also, I usually do not respond to topics concerning customizing the appearance graphs--it is an area where I have no real expertise and skills that are probably below average.

                  Comment

                  Working...
                  X