BookmarkSubscribeRSS Feed
rcwill7
Calcite | Level 5

Hello, I am trying to perform a Difference-in-Difference analysis using Proc Genmod. My goal is to get a DID estimate and 95%CI comparing the relative risk of outcome X from baseline (period = 0) to 0-3 months post (period = 1) of the exposed group to that same RR of the unexposed group. I would like the analysis to also output DID estimates (Exposed vs. Unexposed) for the RRs for 3-6, 6-9, and 9-12 months post (period = 2, 3, 4). An example of my data is below:

 

ID

exposed

period

outcomeX

1

0

0

0

1

0

2

1

2

1

1

0

3

0

2

0

3

0

3

0

3

0

4

0

4

1

2

1

 

My question is how do I best get Proc Genmod to output the DID estimate and 95%CI for RRexposed (exposed period0 vs exposed period1) Vs RRunexposed (unexposed period0 vs unexposed period1)? My current model below uses the SLICE statement to compare all levels of period for each exposure category, however I’m not sure if this gives me what I need since it outputs two tables, each with the exposed variable held constant (i.e., no comparison between exposure groups). Is there a way to get the DID estimate using ESTIMATE statements?

PROC GENMOD DATA = have;
CLASS ID exposed (ref=0) period (ref=0);
MODEL outcomeX (event='1') = period exposed period*exposed /dist=poisson link=log type3;
	REPEATED SUBJECT = ID / TYPE = cs;
	WEIGHT atewgt;
	SLICE period*exposed / sliceby=exposed diff exp cl adjust=bon;
RUN; 

 

1 REPLY 1

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 531 views
  • 0 likes
  • 2 in conversation