Announcement

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

  • Municipality Fixed Effects in CSDID

    Dear Statalist,

    I have a question about the result with the command csdid (I use csdid2 instead).
    I am trying to estimate the effect of the onset of the program that is providing vouchers in school on the individual's enrollment.
    The dataset is cross-sectional and I am using the year when the individuals turn 6 years old as a time variation, and then the treatment variable is whether the program is adopted or not in their community (1 school in 1 community). So, I use the first year that program was introduced in each community.

    Code:
    csdid2 yrs  female, time(schyear) gvar(firstprogramyr) cluster(communitycode) method(dripw)
    estat simple
    I got the result as follows
    Code:
                            
        Coefficient    Std. err.    z    P>z    [95% conf.    interval]
                            
    SimpleATT    -.8979326    .2318987    -3.87    0.000    -1.352446    -.4434195

    Then, I got feedback from my supervisor that I need to control for municipality-year fixed effects additionally. So I try the the following code adding the interaction term of year when individuals' age = 6 and dummies municipality code (I understand this is to control for linear trends, is it right?)

    Code:
    csdid2 yrs   i.schyear#i.municipalitycode , time(schyear) gvar(firstprogramyr) cluster(communitycode) method(dripw)
    estat
    Then, the result is exactly the same.
    Do you have any idea what makes them have the same results?

    Interestingly, the two way fixed effects results are different with and without municipality code.
    where postf_0 is post treatment dummies taking 1 if schyear > firstprogramyr
    Code:
       reghdfe yrs female i.postf_0 , cluster(communitycode) a(communitycode schyear)
       reghdfe yrs female i.postf_0 , cluster(communitycode) a(communitycode schyear i.schyear#i.municipalitycode)

    Can you provide any hint on what I am missing here?
    Last edited by Shisho Jakas; 02 May 2023, 06:07.

  • #2
    That wouldn't work.
    If you try to control for a variable that defines treatment (in this case municipality will define treatment here), that variable will be dropped internally.
    SOmething you can do, and that I have seen working well is to demean your variable based on the "fixed" effects before running csdid2
    specifically something like
    areg yrs , abs(municipality)
    predict residuals, res
    then use residuals as your dep variable

    Also, with CSDID all controls are implicitly interacted with time, so you do not need to do that.
    HTH

    Comment


    • #3
      I did the following using #2 (applied to my data), to compare whether this method is equivalent to i.schyear#i.municipalitycode fixed effects:

      HTML Code:
      areg yrs , abs(i.schyear#i.municipalitycode)
      predict yrsresid, resid        
      eststo m1: reghdfe yrs         female i.postf_0 , cluster(communitycode) a(communitycode schyear) resid
      eststo m2: reghdfe yrsresid female i.postf_0 , cluster(communitycode) a(communitycode schyear i.schyear#i.municipalitycode) resid
      esttab m1 m2
      However, I get different estimates. If this is the correct way to demean in csdid, should it not produce the same estimates in these two lines?

      Comment


      • #4
        It is not THE way, but A way.
        Basically demeaning imposes a specific kind of restrictions on the model.
        It allows you to control for other factors, keep the impact of those factors fixed, then include female and i.posf_0 (in you case). It will give you the best result, but something that is sufficiently close in most cases.
        Again, i suggest that only in cases when people want to include additional fixed effects, even tho that may not be recommended .
        F

        Comment

        Working...
        X