Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
Waterdesk
Calcite | Level 5

I would like to do a difference-in-differences analysis to compare units who received a treatment vs units who did not receive treatment. I found a good article that described how to do difference-in-differences in SAS; article can be found here

The problem I have is that each unit received treatment at different dates; therefore, I have a staggered treatment design. The article describes how to do difference-in-differences if all units receive treatment at the same time, but I can't find how to run such an analysis when the treatment is staggered. I want to point out that creating the model in SAS isn't much of an issue for me. What I need assistance in is how to incorporate some of the newer methods that are described in the following article: https://cran.r-project.org/web/packages/did/vignettes/did-basics.html

 

TLDR: Is there a guideline on how to run staggered DiD in SAS that uses the newer methods that were proposed by Callaway and Sant'Anna?

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Can't you just set the start date for each unit to zero, and then work with the number of elapsed days?

--
Paige Miller
Waterdesk
Calcite | Level 5
Yes, I can do that but I believe that the later treated units have a different treatment effect than the earlier treated units; there are heterogenous treatment effects.
SteveDenham
Jade | Level 19

Perhaps you could use the EFFECT statement to fit a spline to the start dates to deal with the suspected change in the treatment effect, and use @PaigeMiller 's suggestion of fitting elapsed days as the independent variable. You would probably need an interaction term. This would fit a response surface for your DiD data. Does that make any sense?

 

SteveDenham

PaigeMiller
Diamond | Level 26

@SteveDenham wrote:

Perhaps you could use the EFFECT statement to fit a spline to the start dates to deal with the suspected change in the treatment effect, and use @PaigeMiller 's suggestion of fitting elapsed days as the independent variable. You would probably need an interaction term. This would fit a response surface for your DiD data. Does that make any sense?

 

SteveDenham


@SteveDenham I was thinking a similar thing, somehow add the effect of the treatment by actual calendar date into the model somehow. But you beat me to it!

--
Paige Miller
StatDave
SAS Super FREQ

It doesn't really matter that the treatment isn't applied at the same time for each subject. The model just needs an indicator of pre- vs. post-treatment, whenever it actually occurs. See the repeated measures sections of this note

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1728 views
  • 1 like
  • 4 in conversation