Announcement

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

  • Callaway and Sant'Anna Diff in Diff with continuous Treatment

    Hello,
    I want to estimate the effect of childhood exposure to conflict intensity on adult height using a DID with continuous treatment.
    I have used cohort groups to capture exposure to conflict at different ages, with 3 treated groups : age 0-5, age 6-11 and 12-17 at the onset of conflict (1996).
    individuals between the ages of 18 and 33 at the beginning of conflict are the control groups.

    Here is how I generate the gvar
    gen first_treat=.
    replace first_treat=0 if ages>18
    replace first_treat=7 if ages>=1 & ages<=7
    replace first_treat=13 if ages>=13 & ages<=18

    Note ages correspond to the age of the individual, which I include as time.

    runing the Callaway and Sant'Anna Diff in Diff

    csdid mtheight conflict, time(ages) gvar(first_treat) method(dripw), The model cannot be identified since I have Units always treated.

    I guess the problem is in the way I define the gvar. Is this the right way to generate the gvar variable in a repeated cross section dataset ?

    Thank you in advance.

    Emmanuel



  • #2
    Hi Emmanuel
    two points
    1. CS cannot be used for cases with continuous treatment. At best you can adjust it so you estimate effects for treatments with selected intensities, assuming the intensity doesn't change. And using different models to do so.
    2. the best way to see if your gvar is correctly identified is:
    tab ages first_treat

    If you do not see observations for every combination of ages and first treat, then your gvar is incorrectly identified.

    Also, if you have repeated crossection probably your "time" variable will be the "year" of the survey. not the age of the person.
    for your gvar

    gen gvar1 = 1996 if inrange(age_in_1996,0,5)
    replace gvar1 = 0 if inrange(age_in_1996,18,33)

    gen gvar2 = 1996 if inrange(age_in_1996,6,11)
    replace gvar2 = 0 if inrange(age_in_1996,18,33)

    gen gvar3 = 1996 if inrange(age_in_1996,12,17)
    replace gvar3 = 0 if inrange(age_in_1996,18,33)

    I think that would work for your case
    F

    Comment


    • #3
      Hi Fernando.
      Thank you for your comment.

      I have used age of individuals because the years of the survey are 2007 and 2013.
      Yet, the individuals in my sample are born between 1963 and 1996. Could year of birth used as time?


      I have also checked if gvar is not correctly identified and I realized that is not


      tab ages first_treat

      | first_treat
      ages | 0 1 7 13 | Total
      -----------+--------------------------------------------+----------
      1 | 0 742 0 0 | 742
      2 | 0 851 0 0 | 851
      3 | 0 654 0 0 | 654
      4 | 0 995 0 0 | 995
      5 | 0 996 0 0 | 996
      6 | 0 939 0 0 | 939
      7 | 0 0 999 0 | 999
      8 | 0 0 871 0 | 871
      9 | 0 0 971 0 | 971
      10 | 0 0 1,191 0 | 1,191
      11 | 0 0 1,194 0 | 1,194
      12 | 0 0 1,125 0 | 1,125
      13 | 0 0 0 958 | 958
      14 | 0 0 0 1,000 | 1,000
      15 | 0 0 0 1,000 | 1,000
      16 | 0 0 0 651 | 651
      17 | 0 0 0 767 | 767
      18 | 0 0 0 721 | 721
      19 | 752 0 0 0 | 752
      20 | 686 0 0 0 | 686
      21 | 661 0 0 0 | 661
      22 | 710 0 0 0 | 710
      23 | 653 0 0 0 | 653
      24 | 599 0 0 0 | 599
      25 | 656 0 0 0 | 656
      26 | 349 0 0 0 | 349
      27 | 522 0 0 0 | 522
      28 | 436 0 0 0 | 436
      29 | 509 0 0 0 | 509
      30 | 384 0 0 0 | 384
      31 | 374 0 0 0 | 374
      32 | 421 0 0 0 | 421
      33 | 477 0 0 0 | 477
      34 | 163 0 0 0 | 163
      -----------+--------------------------------------------+----------
      Total | 8,352 5,177 6,351 5,097 | 24,977


      I have also tried to generate gvar the way suggested, but the model cannot be identified since I still have units always treated.

      What could be right way to construct the gvar given the structure of my data? Are there any stata packages suitable for DID continuous treatment, Csid cannot be used for continuous treatment?

      Thank you




      Comment

      Working...
      X