Announcement

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

  • how to get the coefficient of post and treat when estimating a DID model with REGHDFE and absorb option that absorbs indivisual and time fixed effect

    Hi dear, my estimation model looks like following:

    Yijkt = β0 + β1 ∗ treat_j + β2 ∗ post_t + β3 ∗ treat_j ∗ post_t + β4X_it + ξ_i + δ_t + ψ_k + ϵ_ijkt
    where treat equals 1 if in the treatment group, post equals 1 if the year is equal to or greater than 2012 (policy takes effect in 2012), and X_it are city level time varying variables. ξ_i is the city fixed effect, δ_t is the time fixed effect, and ψ_k is the product fixed effect.
    The following is my regression command:
    reghdfe sales_spec i.treat_1##i.post lnp_adj lngdp lnage nicotine tar CO , absorb(i.code i.year i.product) vce(cl province)
    where code represents the city fixed effect, year represents the time fixed effect, and product represents the product fixed effect.the regression result looks like as following:
    Click image for larger version

Name:	Picture1.png
Views:	1
Size:	37.9 KB
ID:	1655241



    my confusion is how to get the coefficients of treat and post when using reghdfe as well as absorb these fixed effects. Theoretically, treat and post be absorded by fixed effect and thus cannot be estimated. Is there any empirical method to get the coefficients of the two variables?







    Last edited by Wei LIIU; 19 Mar 2022, 22:22.

  • #2
    No, there isn't. As you note, treat and post are colinear with the time and panel fixed effects, so their effects cannot be estimated.

    But you shouldn't care. In this DID model, their coefficients, were it possible to estimate them, would be meaningless anyway. They don't correspond to anything that matters. If, as in a non-fixed-effects model, you could get these coefficients, they would represent (treat) the difference between the two groups during the period before the intervention started, and (post) the post minus pre difference in outcome in the group that was untreated. Neither of these is of any importance. The model gives you the estimate of the causal effect of the treatment in the coefficient of the 1.treat#1.post interaction term. That is all you need.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      No, there isn't. As you note, treat and post are colinear with the time and panel fixed effects, so their effects cannot be estimated.

      But you shouldn't care. In this DID model, their coefficients, were it possible to estimate them, would be meaningless anyway. They don't correspond to anything that matters. If, as in a non-fixed-effects model, you could get these coefficients, they would represent (treat) the difference between the two groups during the period before the intervention started, and (post) the post minus pre difference in outcome in the group that was untreated. Neither of these is of any importance. The model gives you the estimate of the causal effect of the treatment in the coefficient of the 1.treat#1.post interaction term. That is all you need.
      Thanks for your detailed reply. When using a fixed effect model, there is no way to obtain a consistent estimator of treat and post. Because they are colinear with fixed effect, these time invariant and individual invariant variables are theoretically omitted. Is it possible for Matlab to obtain the time and individual invariant variables? I believe it is irrelevant what type of software is used, but theoretically, they cannot be estimated. How do you think of it?









      Comment


      • #4
        Wei:
        under the -fe- specification, the coefficients of time-invariant variables cannot be estimated due to demeaning. As the mean of a constant equals the constant itself, the results is zero after demeaning.
        The only way to estimate the coefficient of a time-invariant variable is via -re-, thanks to its quasi-demeaning approach.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Wei:
          under the -fe- specification, the coefficients of time-invariant variables cannot be estimated due to demeaning. As the mean of a constant equals the constant itself, the results is zero after demeaning.
          The only way to estimate the coefficient of a time-invariant variable is via -re-, thanks to its quasi-demeaning approach.
          Dear Carlo,

          Thank you for your suggestion. Do you mean that we can estimate the time invariant coefficient using the random effect mode? Yes, I see that the random effect model can estimate the time invariant variable. However, the random effect model's assumption that the time invariant variable is uncorrelated with the time varying variable is too strong and difficult to satisfy in my model setting.

          I'm assuming you believe the time invariant variable cannot be estimated using a fixed effect model, regardless of which software you use. Matlab, too, is unable to obtain the coefficients of the two variables.

          Best regards,
          Wei

          Comment


          • #6
            You don't want the coefficients you're asking for, even if it were mathematically possible to get them. You're interested in the interaction term. That here is the star of the show, since that's your treatment effect, the thing we're meant to care most about in quasi-experimental research.

            Comment


            • #7
              Wei:
              1) you're correct. The "ui uncorrelated with the vector of regressors" assumption is hardly satisfied under -re-. That said, you may want to take a look at the community-contributed module -mundlak-;
              2) as you are correct: this is exactly what I meant.
              Last edited by Carlo Lazzaro; 20 Mar 2022, 06:34.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Originally posted by Jared Greathouse View Post
                You don't want the coefficients you're asking for, even if it were mathematically possible to get them. You're interested in the interaction term. That here is the star of the show, since that's your treatment effect, the thing we're meant to care most about in quasi-experimental research.
                Yes, we didn't like the treatment and the post, but my boss asked me to get the coefficients for the two variables. As a result, I must. So you're saying there's no way to obtain the two coefficients? Using Matlab to solve the problem is also ineffective.

                Comment


                • #9
                  Originally posted by Carlo Lazzaro View Post
                  Wei:
                  1) you're correct. The "ui uncorrelated with the vector of regressors" assumption is hardly satisfied under -re-. That said, you may want to take a look at the community-contributed module -mundlak-;
                  2) as you are correct is surmising, this is exactly what I meant.
                  Dear Carlo,

                  Thank you for your advice. Yes, because I need the two coefficients, and I'll do what you suggested.

                  Best regrads,
                  Wei

                  Comment


                  • #10
                    Yeah your boss doesn't know what they're talking about. I suspect they've no experience in this field.

                    I say this, because the normal coefficients in interaction terms are typically meaningless. Interaction terms by definition give the effect of a variable conditional on the values of other variables. So, your boss is basically asking to see the effect of the treatment before the policy, and the time trend before the policy, even though these are useless and are necessarily collinear with one another

                    Comment


                    • #11
                      but my boss asked me to get the coefficients for the two variables. As a result, I must.
                      And what will you do if your boss asks you to arrange bus tickets to get him from Shanghai to Los Angeles? That would be just as reasonable a request. You can no more get those effects out of a fixed-effects estimator than you could travel by road from Shanghai to Los Angeles. There is no software anywhere that will do that.

                      If your boss insists on having them (though I can't imagine any good reason why he/she wants them) then you have to leave the realm of fixed-effects estimators. You can use random effects, though I gather from your dialog with Carlo Lazzaro above that you don't want to do that. There is also -xthybrid-, by Reinhard Schunck and Francisco Perales, available from SSC. This, as the name implies, is a hybrid of fixed and random effects estimation, and can also fit the correlated random effect (aka Mundlak) model. That's fine. But it isn't a fixed-effects model. Your boss can't have it both ways, no matter how badly he/she wants to.

                      Comment


                      • #12
                        Originally posted by Clyde Schechter View Post
                        And what will you do if your boss asks you to arrange bus tickets to get him from Shanghai to Los Angeles? That would be just as reasonable a request. You can no more get those effects out of a fixed-effects estimator than you could travel by road from Shanghai to Los Angeles. There is no software anywhere that will do that.

                        If your boss insists on having them (though I can't imagine any good reason why he/she wants them) then you have to leave the realm of fixed-effects estimators. You can use random effects, though I gather from your dialog with Carlo Lazzaro above that you don't want to do that. There is also -xthybrid-, by Reinhard Schunck and Francisco Perales, available from SSC. This, as the name implies, is a hybrid of fixed and random effects estimation, and can also fit the correlated random effect (aka Mundlak) model. That's fine. But it isn't a fixed-effects model. Your boss can't have it both ways, no matter how badly he/she wants to.
                        Hi dear,

                        Thank you for your response. Because my boss stated that the fixed effect would be estimated using the fixed effect model. Haha, I'm at a loss for words and actions.

                        Comment


                        • #13
                          Originally posted by Clyde Schechter View Post
                          And what will you do if your boss asks you to arrange bus tickets to get him from Shanghai to Los Angeles? That would be just as reasonable a request. You can no more get those effects out of a fixed-effects estimator than you could travel by road from Shanghai to Los Angeles. There is no software anywhere that will do that.

                          If your boss insists on having them (though I can't imagine any good reason why he/she wants them) then you have to leave the realm of fixed-effects estimators. You can use random effects, though I gather from your dialog with Carlo Lazzaro above that you don't want to do that. There is also -xthybrid-, by Reinhard Schunck and Francisco Perales, available from SSC. This, as the name implies, is a hybrid of fixed and random effects estimation, and can also fit the correlated random effect (aka Mundlak) model. That's fine. But it isn't a fixed-effects model. Your boss can't have it both ways, no matter how badly he/she wants to.
                          Hi dear,

                          When I use this command, reghdfe sales_spec did_1 treat_1 $X1list, absorb(i.code i.year i.product,savefe) vce(cl province)
                          why the fixed effect estimator cannot be saved? Is there any misunderstanding about this option?

                          Comment


                          • #14
                            Wei:
                            without any example/excerpt of your dataset is impoissible (for me, at least) to reply positively.
                            Kind regards,
                            Carlo
                            (StataNow 18.5)

                            Comment

                            Working...
                            X