BookmarkSubscribeRSS Feed
Molina
Calcite | Level 5

Hi,
I am trying to figure out how to conduct a difference in difference analysis with a proc Genmod.
My outcome is a continuous variable (Y), and I would like to know if being a case (Yes/no) influences this outcome.

I have repeteated measures ( time = 0 to 12), and several not time-dependent variables (Adj_var).

 

My  code :

 

PROC GENMOD DATA=GEE_PREPARATION2;
CLASS id time(ref="0") Adj_var (ref="0") case(ref="0") / param=ref;
MODEL Y= case time Adj_var  case*time;
REPEATED SUBJECT=id / TYPE=UN CORRW; RUN;

 

And... I don't understand my results at all. For time*Case (1 1) it gives me a coefficient "22.8271". I thought it was the result of my Diff in Diff because it's the same results when I calculate it by hand DiD=[(Y11 - Y10)-(Y01-Y00)].  But he didn't take into account my adjustment variables (Adj_var).

 

If I try with this code :

PROC GENMOD DATA=GEE_PREPARATION2; 
CLASS id time(ref="0") case(ref="0") / param=ref;
MODEL ville= case time case*time; REPEATED SUBJECT=id / TYPE=UN CORRW; RUN;

I have the same results.

I must have missed something, but I don't see what...

 

2 REPLIES 2
StatDave
SAS Super FREQ

Well, that seems consistent with this note. Parameter estimates for CASE and TIME should be adjusted for the effects of the other variables. So, their estimates should change with vs. without those additional variables unless, of course, they are all uncorrelated. 

Molina
Calcite | Level 5

Thank you StatDave_sas, 

I'm totally agree with you, if I adjust with VAR_ADJ, the parameter estimates for CASE and TIME are changed. What I find curious is that my interaction parameter TIME*CASE does not change with or without VAR_ADJ. 

The purpose of my model is precisely to adjust the difference in difference estimate (TIME*CASE). That's why I'm so embarrassed with this result. 😄

 

 

 

 

 

 

 

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