2

Has anyone used a Wald Test to check for parallel trends as a pre-testing stage for a Difference-in-Difference? Had been advised that it is a good way to do so, but not sure of the best way to undertake.

I have a dataset consiting of 13 pre-policy observations for both a subject and control - coded '1' for treatment and '0' for control. Does anyone have any code/has anyone undertaken such in R.

I want to test the significance of the sampole*time interaction using a Wald test.

Thanks

j.rahilly
  • 33
  • 5

1 Answers1

2

The package did will report a Wald test in the output summary as the package authors describe here: https://bcallaway11.github.io/did/articles/did-basics.html#an-example-with-real-data.

It is the "P-value for pre-test of parallel trends assumption" reported at the bottom of summary.

# Example data
data(mpdta)

out1 <- att_gt(yname="lemp",
               tname="year",
               idname="countyreal",
               gname="first.treat",
               xformla=NULL,
               data=mpdta)
summary(out1)
#> 
#> Call:
#> att_gt(yname = "lemp", tname = "year", idname = "countyreal", 
#>     gname = "first.treat", xformla = NULL, data = mpdta)
#> 
#> Reference: Callaway, Brantly and Pedro H.C. Sant'Anna.  "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015> 
#> 
#> Group-Time Average Treatment Effects:
#>  Group Time ATT(g,t) Std. Error [95% Simult.  Conf. Band]  
#>   2004 2004  -0.0105     0.0235       -0.0752      0.0542  
#>   2004 2005  -0.0704     0.0307       -0.1549      0.0140  
#>   2004 2006  -0.1373     0.0365       -0.2379     -0.0367 *
#>   2004 2007  -0.1008     0.0383       -0.2062      0.0046  
#>   2006 2004   0.0065     0.0236       -0.0585      0.0715  
#>   2006 2005  -0.0028     0.0195       -0.0564      0.0509  
#>   2006 2006  -0.0046     0.0185       -0.0556      0.0464  
#>   2006 2007  -0.0412     0.0202       -0.0969      0.0145  
#>   2007 2004   0.0305     0.0155       -0.0122      0.0733  
#>   2007 2005  -0.0027     0.0158       -0.0462      0.0408  
#>   2007 2006  -0.0311     0.0176       -0.0794      0.0173  
#>   2007 2007  -0.0261     0.0167       -0.0720      0.0199  
#> ---
#> Signif. codes: `*' confidence band does not cover 0
#> 
#> P-value for pre-test of parallel trends assumption:  0.16812
#> Control Group:  Never Treated,  Anticipation Periods:  0
#> Estimation Method:  Doubly Robust

samalevy
  • 81
  • 8
  • Thanks for the link. TBH - I'm still struggling with what to inut into the above. I currently have the following columns (time, outcome, intervention [0 for pre 1 for post], treat [0 for control and 1 for treated], elapsed (0 for pre, 1 to 22 for post)). I've tried various combinations, but am not sure I really understand what my id.name and g.name would be/what each of those are doing in the above... – j.rahilly Mar 29 '23 at 14:54