Announcement

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

  • Margins (not estimable) after DID

    Hello.

    I'm using Stata 16 on a Mac.

    I'm estimating the following model using an unbalanced panel:

    HTML Code:
    xtreg DV i.treated_n##i.post CV, fe vce(cluster gvkey)
    which results in the main effect of treated_n being omitted. I would expect this since I'm using FEs.

    Next, I use

    HTML Code:
    margins, dydx(treated_n) at(post = (0,1))
    which results in the following error:

    HTML Code:
    Average marginal effects                        Number of obs     =        463
    Model VCE    : Robust
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : 1.treated_n
    
    1._at        : post            =           0
    
    2._at        : post            =           1
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    0.treated_n  |  (base outcome)
    -------------+----------------------------------------------------------------
    1.treated_n  |
             _at |
              1  |          .  (not estimable)
              2  |          .  (not estimable)
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    From what I have read, using an unbalanced panel should not be a problem for my DID specification. However, some units are only in the dataset during post=0. Can this impact the ability of margins to be estimated?

    Thank you for your input.
    Attached Files

  • #2
    I likely can help here, but I must see an example dataset using dataset. If I were you, I'd drop the unbalanced units. Also, why bother using margins in this instance? DD already gives you the causal effect (or it tries to!).

    Comment


    • #3
      Annette: I don't understand why you want to use margins. First of all, you cannot estimate an effect when post = 0 because there are no treated units. For the average treatment on the treated when post = 1, that's just the coefficient on the interaction term. This is the treatment effect that is the focus in the DiD literature.

      If you want the average treatment effect (averaged across all units) when post = 1 you need to be careful. I've been working on this problem and can show you how to do it. But it's unusual to report that.

      Comment


      • #4
        Thank you for your replies. I appreciate your time!

        I want to use margins since I'm actually interested in estimating

        HTML Code:
          xtreg DV i.treated_n##i.post##c.X CV, fe vce(cluster gvkey)
        and would like to look at the treatment effect across different values of X.

        I think the inclusion of fixed effects causes multicollinearity in the sense that the treatment effect and fixed effects cannot be separately identified. Thus, margins throws the error. With panel data, where certain units are treated and others not, in seems impossible to use fixed effects for the multicollinearity issue I mentioned. Is this correct and FE in this case redundant?
        Last edited by Annette Popp; 19 Jan 2022, 12:59.

        Comment

        Working...
        X