Announcement

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

  • Homoskedasticity testing for synthetic difference in differences with vce(placebo)

    Dear community,

    I am currently performing some estimates with the Synthetic difference-in-differences estimator (sdid command). As the number of treated units is small, the best option suggested by the authors (Arkhangelsky et al., 2021; Clarke et al., 2023) is conducting the estimation using vce(placebo). This option requires homoskedasticity across units but, to the best of my knowledge, there are no post-estimation commands (after the implementation of sdid) to test it. At the moment, I am currently thinking of testing homoskedasticity in parallel, using the following:

    xtset id time
    xtreg outcome treatment, fe
    xttest3

    The problematic point here is that homoskedasticity is required across units but not across time. I am afraid that with the procedure above I am testing homoskedasticity also across time. Is there anyone that would suggest another way of proceeding or would validate my procedure? Do you think that a simple -reg outcome treatment i.id- would do the job?

    Thanks

  • #2
    I would also be interested in learning the answer to this question.

    Comment


    • #3
      Federico:
      a visual inspection of the residual distribution may be an approach.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        I think part of the issue here is that the synthetic difference-in-differences procedure doesn't generate residuals for all units. I believe it only generates them for the treated unit. Maybe the solution here is to run placebo iterations treating a different unit each time, storing the residuals for each run, and then plotting them?

        Comment


        • #5
          Maybe another option would be to run a standard difference-in-differences and then test for heteroskedasticity within each time period in the dataset?

          I am thinking of something along these lines:

          Code:
          * Specify URL from which dataset will be obtained
          webuse set www.damianclarke.net/stata/
          
          * Set up storage matrix for results
          matrix results = J(31, 2, .)
          
          * Test for heteroskedasticity across units within each year of data
          local row_counter = 0
          forvalues year = 1970/2000 {
          
              * Update row counter
              local row_counter = `row_counter' + 1
              
              * Load data
              webuse prop99_example.dta, clear
              
              * Encode state
              encode state, gen(state_code)
          
              * Run DiD analysis
              reg packs i.state_code i.year treated
          
              * Collect residuals
              predict resid, residuals
          
              * Test homoskedasticity across units for each year
              keep if year == `year'
              hettest
              
              * Save results
              matrix results[`row_counter', 1] = `year'
              matrix results[`row_counter', 2] = r(p)
          
          }
          
          * View matrix results as .dta
          mat2txt, mat(results) saving("results.txt") replace
          insheet using "results.txt", clear
          keep c*
          rename c1 year
          rename c2 hettest_p
          However, I'm not sure if you would then need to not reject the null of homoskedasticity in every year of the data in order to provide evidence in favour of the "no heteroskedasticity across units" assumption.
          Last edited by Noah Spencer; 20 Jul 2023, 11:42.

          Comment

          Working...
          X