Announcement

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

  • #16
    Originally posted by George Ford View Post
    reghdfe is straight up DID.

    The first two regressions are simply separating it out by country to tell you how they changed. The DID estimator can be computed, but hypothesis testing is straightforward with the reghdfe model.

    the second set of regressions is similar but includes an industry fixed effect.

    try this.

    Code:
    preserve
    collapse (mean) sdq_score , by(industry post treated)
    * you'll have 60 observations in each period.
    reg sdq_score c.treated#c.post post treated
    restore
    or

    Code:
    preserve
    collapse (mean) sdq_score [aw=companysize], by(industry post treated)
    reg sdq_score c.treated#c.post post treated
    restore
    The latter weights the sdq_score by company size when computing the mean.
    Hi George, here is an update, hopefully you could help me fix it. I did not use your approach because I do not find the postestimator to extract graphs afterwards. Instead I used the DID Panel Data from menu.

    Code:
    gen id = _n
    order id
    reshape long x , i(id) j(year)
    xtset id
    encode country, generate (country_n)
    encode companyname, generate (company_n)
    egen panel_id = group (year company_n)
    xtset panel_id
    g lcompanysize = ln(companysize
    g post = year>=2017
    g treated = country == "treatedcountry"
     g posttreated = post * treated
    It seems all fine until here, then when I try to use DID Panel-Data Fe

    Code:
    xtdidregress (esgscore) (post), group(treated) time(year)
    this is the error I get: invalid group specification
    None of the groups defined by treated is a control.


    Thank you!

    Comment


    • #17
      I need to have a similar graph to this one:
      Click image for larger version

Name:	didgraph.png
Views:	1
Size:	67.2 KB
ID:	1720527


      Last edited by sladmin; 29 Sep 2023, 05:26. Reason: anonymize original poster

      Comment


      • #18
        ssc install lgraph

        lgraph esgscore year, by(treated)
        Last edited by George Ford; 14 Jul 2023, 14:00.

        Comment


        • #19
          I am getting a linear upward trend for the untreated post-treatment. Wondering, if that is realistic or anything wrong with the calculation..?

          Comment


          • #20
            //
            Last edited by sladmin; 29 Sep 2023, 05:26. Reason: anonymize original poster

            Comment

            Working...
            X