BookmarkSubscribeRSS Feed
mag_newbie
Calcite | Level 5

Hey all,

 

I'm pretty new in SAS (version 9.4) and trying to calculate diff-in-diff for cost data.

The question is, if there is a difference in health care expenditures between people participating in a stuctured health care programme (Prog=1) and those who do not participate (Prog=0). Data for both groups is availabe for 1 year before intervention (post=0) and 1 year after intervention (post=1).

 

 

proc genmod data= cost;
class prog post / ref= first;
model total_cost= prog post prog*post / dist=gamma link=log;
estimate "diff_in_diff" prog*post  1 -1 -1 1;
lsmeans prog*post  / e linik;
lsestimate prog*post "diff_in_diff" 1 -1 -1 1;
run; 

 

Using proc genmod for diff-in-diff estimation provides results on means and on the standard errors of the means for all combinations (prog0_post0; prog0_post1; prog1_post0; prog1_post1).

However, the interpretation of the difference contrast of means and estimates is challenging for me.

 

I have read that a transformation using %margins macro may be usefull. 

I have downloaded the macro, but I found only very little information and no examples for applying it on data with gamma distribution.

 

Can someone tell me if I am on the right track and how I should proceed?

Grateful for any advice

 

Maggie

2 REPLIES 2
StatDave
SAS Super FREQ

One issue is whether the before and after groups in each participation group are independent or if each subject is measured both before and after. If subjects are repeatedly measured, implying some correlation, then you might want to include the REPEATED statement to identify the groups of correlated observations (subjects).

 

For difference in difference analysis with non-normal responses, see this note. You can use any of the Margins, NLMeans, or NLEstimate macros to estimate the difference in difference of the means. You might find using the NLMeans macro to be easier. Note that the NLMeans and NLEstimate macro are already available in your SAS session in the current release of SAS, SAS 9.4 TS1M6.

mag_newbie
Calcite | Level 5

Thanks for your response. Subjects are measured both before and after. Using NLEstimate macro worked to estimate the difference in difference of the means.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 676 views
  • 0 likes
  • 2 in conversation