BookmarkSubscribeRSS Feed
sks521
Quartz | Level 8

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

3 REPLIES 3
Rick_SAS
SAS Super FREQ

1. Please post example data

2. Are you asking for syntax for PROC MIXED, or are you asking for syntax for PROC SGPLOT?

sks521
Quartz | Level 8

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

 

sks521
Quartz | Level 8

Hi Rick,

 

Would you mind looking at my example data set and post example syntax please?

 

Thanks

S

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 929 views
  • 0 likes
  • 2 in conversation