Announcement

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

  • two-way interaction vs subsample test

    Hello!

    I have a two-way interaction model with firm and year fixed effects, where i.treat_post is treat*post, because this model use two-way fixed effects, the individual terms of treat and post are not shown.
    Code:
    xtreg y i.treat_post employee ROA marketcap TobinsQ FCF i.year ,fe vce(cluster firm)
    I have two other models which further divide the two-way interaction model into high and low subsamples based on whether the sample has above or below median value of R&D expense, using the high_rd dummy to indicate. The two models are as follows
    Code:
    xtreg y i.treat_post employee ROA marketcap TobinsQ FCF i.year if high_rd==1 ,fe vce(cluster firm)
    
    xtreg y i.treat_post employee ROA marketcap TobinsQ FCF i.year if high_rd==0 ,fe vce(cluster firm)
    I understand that for the two-way interaction model, all the control variables only estimate a single coefficient, such as ROA is the average effect of ROA for the high and low subsample; whereas for the two subsample tests, the coefficient for ROA in the high subsample is different from that of in the low subsample.

    I wonder is there a way to make the coefficients of the control variables the same across models? I think maybe a full interaction model for the two-way interaction can probably do, I have searched but there's not much information available. I wonder how can this be achieved?

    Thanks!

  • #2
    reghdfe (from SSC) allows for interactions in the absorbed variables,
    Code:
    sysuse auto, clear
    
    xtreg price weight length if foreign==1, fe i(rep78)
    
    xtreg price weight length if foreign==0, fe i(rep78)
    
    reghdfe price (c.weight c.length)#foreign, absorb(rep78#foreign)

    Comment


    • #3
      Hi Øyvind,

      Thanks a lot for your help!

      I tried to apply your example code in my context, I have two fixed effects to absorb, firm and year, and the standard error is clustered at firm level
      Code:
      reghdfe y (i.treat_post c.employee c.ROA c.marketcap c.TobinsQ c.FCF)#high_rd ,absorb(firm#year#high_rd) vce(cluster firm)
      And there is an error message
      Code:
      error: remaining argument: #high_rd
      r(198);
      I wonder where I have done wrong? I'm not sure if I can write the absorb part this way.
      Last edited by Alice Yang; 21 Apr 2022, 05:19.

      Comment


      • #4
        Code:
        reghdfe y (i.treat_post c.employee c.ROA c.marketcap c.TobinsQ c.FCF i.year)#high_rd, absorb(firm#high_rd) vce(cluster firm)

        Comment


        • #5
          Thanks! It works this time.

          Comment

          Working...
          X