BookmarkSubscribeRSS Feed
mag_newbie
Calcite | Level 5

Hello everybody,

I did a differnce-in-difference anlysis for in health care expenditures using proc genmod and %NLEstimate. People participating in a stuctured health care programme (Prog=1) were compared to those who do not participate (Prog=0). With data for both groups availabe for 1 year before intervention (post=0) and 1 year after intervention (post=1). The same subjects are measured before and after. The code I used works for the primary outcome "total cost". But now I need to analyse subcategories of costs, additinally (for hospitalisation, drugs,...) and some of these subcategories are zero-inflated.

 

Is there any option how I can make a DiD anaysis using zero-inflated data?

 

Any help would be greatly appreciated.

 

Maggie

 

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;
store out= gammod;
run; 

data difdif;
input k1-k4;
set=1;
datalines; 
1 -1 -1 1;

%NLEstimate (instore= gammod,
label= Diff in Diff
f=(exp(b_p1+b_p2+b_p4+b_p6) - exp(b_p1-b_p4)) - 
(exp(b_p1+b_p2) - exp(b_p1)), 
title= DiD Totel cost)

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 525 views
  • 0 likes
  • 1 in conversation