Announcement

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

  • How to discern the coefficients and their p-values of covariates using sdid

    Hello everyone who is interested in sdid (synthesis control DID), my name is Meng, and I am working on my sdid models while having some troubles when adding on covariates: how I can find out the coefficients and p-value for my covariates that I added on one by one? It looks like all the models give similar results in terms of ATTs and overall p-values...please find the attached screen captures (sorry this is my first post and I am still learning how to put code and data here..)
    (Maybe Prof. Daniel would help to answer? Daniel PV) Thank you so much in advance!!!

    Meng
    Click image for larger version

Name:	results 2.jpg
Views:	1
Size:	107.5 KB
ID:	1718122


    Click image for larger version

Name:	resutls1.jpg
Views:	1
Size:	73.0 KB
ID:	1718123



  • #2
    To get the coefficient of covariates you can access a scalar
    Code:
    e(beta)
    after run sdid. In your case, you can replicate this coefficient and standard error by running a preregression https://github.com/skranz/xsynthdid/...covariates.pdf. You must create an indicator for all control units (W = 0) and estimate
    Code:
    reghdfe Y covariates if W==0, abs(state time) cluster(state)
    . For future versions we will automatically add these estimators, thanks for commenting.

    Comment


    • #3
      Hi Daniel PV,
      Thank you so much for replying my questions! Appreciate so much! Here are my findings based on your advices:

      I first used `matrix list e(beta)` to obtain the coefficients for all covariates (please see below);
      Click image for larger version

Name:	yes!.jpg
Views:	1
Size:	16.0 KB
ID:	1718314

      Then, for the p-values of them, I created an indicator "W = 0" for those units/observations which NEVER been treated (I think this is what you meant), and run the "reghdfe" regression to replicate, unfortunately, I got errors of "insufficient observations"...while I next replaced with "treated = 0" (instead of W=0) to run the "reghdfe" command again, I could get something (please see below) but none of them is same as my sdid regression coefficient, which in fact did not replicate. May you please advice what I should do with "insufficient observations"? Thanks a lot!!

      Meng

      Click image for larger version

Name:	Yes!!!.jpg
Views:	1
Size:	174.9 KB
ID:	1718315

      Comment


      • #4
        you need to run the regression only on the control units (untreated in the whole period). Maybe if you generate the
        Code:
        egen W = mean(hsr_dummy), by(id)
        and then condition if W==0. Let me know if it works.

        Comment


        • #5
          Daniel PV Hi Daniel, thank you so much for your reply!
          Yes, your code works very well! And now I can obtain the coefficients and p-values of the covariates via "reghdfe" regression exactly the same as what I received from the "sdid" regression using "e(beta)" command.
          May I follow up with two more questions?
          (1) what are the exact functions of covariates in a sdid model (how we interpret them in the report)? Since I realize that the p-value of each covariate is not significant at all, while the p-value of ATT is significant.
          (2) given that the ATT coefficients and p-values merely vary as I add on one more covariate into the "sdid" model every time, how to identify which "sdid" regression fits better?

          Thank you!
          Best,
          Meng





          Comment

          Working...
          X