Announcement

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

  • fixed effects diff in diff

    I have a data set with 15 years and treatment in happens in the 7th year. I want to estimate fixed effects diff in diff using time FE and setting the treatment year as a base category. However stata omits my first year from all outputs. how can I fix this

  • #2
    Hey Camair,

    please provide some example data (using dataex) and code such that one can understand your specific case more easily. For now you might try something like this:

    Code:
    reg outcome treatment i.group b7i.year
    Note, that in my case the coefficient of the treatment remains unchanged (relative to not using b7) but maybe I was getting wrong what you are planning to do.

    Best regards
    Sebastian

    Comment


    • #3
      Sebastian Schirner tian sc

      --------------------- copy starting from the next line -----------------------
      [CODE]
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float id double year float y
      1 2001 .53026426
      1 2002 .14078498
      1 2004 .13536379
      1 2005 .13294315
      1 2006 .11512028
      1 2007 .10154905
      1 2008 .9148936
      1 2009 .8766892
      1 2010 .8334749
      2 2001 .19096334
      2 2002 .14078498
      2 2003 .1590136
      2 2004 .13536379
      2 2005 .13294315
      2 2006 .11512028
      2 2008 .11404255
      2 2009 .0945946
      2 2010 .0917587
      3 2001 .4688832
      3 2002 .3882253
      3 2003 .4209184
      3 2004 .391709
      3 2005 .382107
      3 2006 .5979381
      3 2007 .5464716
      3 2008 .30723405
      3 2009 .2829392
      4 2001 .8081841
      4 2003 .707483
      4 2004 .6573604
      4 2005 .6354514
      4 2006 .5979381
      4 2007 .5464716
      4 2008 .5719149
      4 2009 .5194257
      4 2010 .5012744
      5 2001 .19096334
      5 2002 .14078498
      5 2003 .6811225
      5 2004 .6201354
      5 2005 .6086956
      5 2006 .11512028
      5 2007 .4182444
      5 2008 .4178724
      5 2009 1.6452703
      5 2010 1.5658454
      6 2001 .53026426
      6 2002 .4343004
      6 2003 .4455782
      6 2005 1.1112039
      6 2006 2.2388315
      6 2007 2.462995
      6 2008 1.1404256
      6 2010 .9770603
      7 2001 2.2208014
      7 2002 2.0571673
      7 2003 3.4846935
      7 2004 4.956007
      7 2005 6.632107
      7 2006 6.342783
      7 2007 7.550774
      7 2008 8.133616
      7 2009 9.209459
      7 2010 10.144435
      8 2001 .19096334
      8 2002 .6817406
      8 2003 .707483
      8 2004 .4010152
      8 2005 .3862876
      8 2006 .3539519
      8 2008 .6280851
      8 2010 1.7527614
      9 2001 1.3751065
      9 2002 1.243174
      9 2003 1.8818026
      9 2004 1.672589
      9 2006 1.4003435
      9 2007 2.506024
      9 2008 3.2068086
      9 2009 3.766892
      9 2010 3.6321156
      10 2001 .53026426
      10 2002 .6817406
      10 2003 1.5306122
      10 2004 2.77665
      10 2005 4.922241
      10 2006 4.7139173
      10 2007 4.6084337
      10 2008 4.6119146
      10 2009 4.536318
      10 2010 4.4936275
      11 2001 .53026426
      11 2002 .6817406
      11 2003 .707483
      11 2004 .6573604
      11 2005 1.0484949
      11 2006 .9338488
      11 2008 1.3634043
      11 2009 8.261825
      11 2010 4.7587085
      end

      Comment


      • #4
        Hey Camair,

        thanks for the data. Can you provide also the regression that you want to estimate? In traditional Diff-in-Diff you typically have a treatment and a control group (e.g. indicated by a 0/1 treatment variable). In your data you did not provide a treatment variable, does that mean that all units are treated after the 7th year?

        Best regards
        Sebastian

        Comment

        Working...
        X