I am currently analyzing the impact of an intervention on medication numbers using difference-in-difference analysis, but I have encountered several problems. Following the SAS support instructions, I conducted the difference-in-difference analysis. However, I noticed a discrepancy between my results and SAS's example 61830. In the example, the value of 'Mean Estimate' in 'Contrast Estimate Results' is identical to the 'Estimate' in 'Least Squares Means Estimate'. However, in my case, these values were different. I suspect this could be due to my use of the negative binomial distribution with a log link, resulting in exponential values. Consequently, I am unsure whether to rely on the 'Mean Estimate' in 'Contrast Estimate Results' or the 'Estimate' in 'Least Squares Means Estimate', and how to interpret this results. Thank you very much. Here is my result: Contrast Estimate Results Label Mean Estimate Mean Confidence Limits L'Beta Estimate Standard Error Pr > ChiSq diff in diff 1.51 1.49-1.52 0.41 0.0051 <.0001 time*intervention Least Squares Means time intervention Estimate SE z value Pr > |z| 1 1 0.77 0.00434 178.19 <.0001 1 0 0.03 0.00508 6.5 <.0001 0 1 0.72 0.00408 177.71 <.0001 0 0 0.40 0.00426 93.11 <.0001 Least Squares Means Estimate Effect Label Estimate SE Z value Pr > |z| time*intervention diff in diff 0.41 0.00509 81.01 <.0001 SAS code: proc genmod data = ALL_DID;
class _MatchID intervention time /ref = first;
model drug_use = time intervention time*intervention/dist = negbin link=log;
repeated subject =_MatchID/type = exch;
estimate "diff in diff" time*intervention 1 -1 -1 1;
lsmeans time*intervention;
lsmestimate time*intervention "diff in diff" 1 -1 -1 1;
run;
... View more