Hi folks,
I wanna do a difference-in differences analysis using proc mixed. The outcome I am regressing on is number of health visits per participant pre-intervention vs. post-intervention between two groups. I have three time points; pre-intervention (12 months), intervention (6 months) and post-intervention (12 months) and I wanna plot average visits per participant (as each participants can have multiple visits in a month) in each month for both intervention and control group.
Does anyone has an example syntax please?
Thanks
S
1. Please post example data
2. Are you asking for syntax for PROC MIXED, or are you asking for syntax for PROC SGPLOT?
Hi,
Here is example data:
ID Age Sex Practice Status VisitDate
1 73 M SMP Intervention 2016-04-14
1 73 M SMP Intervention 2017-02-19
1 73 M SMP Intervention 2017-04-16
1 73 M SMP Intervention 2016-07-18
2 79 F BMP Eligible 2016-03-11
2 79 F BMP Eligible 2016-08-14
2 79 F BMP Eligible 2018-04-16
2 79 F BMP Eligible 2017-09-21
2 79 F BMP Eligible 2017-03-20
2 79 F BMP Eligible 2018-05-12
Just to let you know that there are other variables like ethnicity etc. which I have not mentioned here.
So I am trying to do a difference in differences to assess change in the number of health visits between the two groups after intervention (intervention was implemented from September 2017 to February 2018). I though I will create dummy variables to create 4 three months intervals for pre-intervention, one for intervention and 4 3 months intervals for post-intervention period and plot the average number of visits per patient per time-period.
I wasn't sure how to create the plot with counterfactual (usual difference in differences plot). If there is any commant to use in proc mixed, I am happy to use it. Otherwise any suggestion will be much appreciated.
Thanks
S
Hi Rick,
Would you mind looking at my example data set and post example syntax please?
Thanks
S
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.