Announcement

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

  • Calculating only year and months-fixed effects and excluding individual fixed effects

    Code:
    xi: xtivreg2 father_childcare         fage fage2 i.fmonth i.syear (fretired = fdisc60)                 if fage>=50 & fage<=70, fe partial(i.fmonth i.syear) cluster(fid)
    Hello! I am new to Stata. I am using fuzzy RD to investigate the effect of father's retirement on his time spent on childcare of his grandkids. I found this code for the second stage where fixed effects are used. I am not sure how to exclude individual fixed-effects and use only time-fixed effects.
    Thank you!

  • #2
    Install ivreghdfe from SSC and absorb only the time indicators.

    Code:
    ssc install ivreghdfe
    help ivreghdfe

    Comment


    • #3
      When I use i.year for I get the error: factor-variable operators not allowed. Why don't you got it?
      Code:
      xtset mun_code year
      
      xtivreg2 displacement i.year (concessions=gold_anomalies), fe cluster (department) first
      Thanks!
      Last edited by Paola Jaimes; 15 Jan 2021, 11:29.

      Comment


      • #4
        Paola:
        welcome to this forum.
        It may be that the community-contributed command (as you kindly requested to detail, as per FAQ) -xtivreg2-, does not support -fvvarlist- notation.
        Prefixing your code with -xi:- (like in #1) shouLd do the trick.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Another way is to manually create the dummies

          Code:
          tab year, gen(yr)

          Comment

          Working...
          X