BookmarkSubscribeRSS Feed
jmg_va
Calcite | Level 5

Hi! 

Does anybody know how to calculate adjusted risk differences and 95% confidence intervals using PROC GENMOD, dist=binomial, link=log?

 

I am able to do this using link=identity instead of link=log (a la Spiegelman article); however, the actual risks produced using dist=binomial, link=log are quite different from the risks produced using dist=binomial and link=identity when doing adjusted analyses (risks identical for both methods in unadjusted analyses). I don't trust the link=identity risks as much as the link=log risks, and therefore also don't trust the associated adjusted risk differences/95% CIs from link=identity analyses. And those adjusted risk differences/95% CIs are what I'm ultimately needing. 

***Link=log;

title3 "Proc GENMOD: Poisson Model Robust Variance Estimator - Died in 4 Weeks=Infection Type + Age 5 level + Immunosuppressive";
title4 "Adjusted Risks, Relative Risks";
title5;
proc genmod data=nb;
class hypoxic_14day agenumeric (ref="45-<60") immunosuppressive (ref="FALSE") testres (ref="zCovid Only") PatientICN;
*effect agespl=spline(agenumeric/details naturalcubic basis=tpf(noint)knotmethod=percentiles(4));
model hypoxic_14day (event="1")=testres agenumeric immunosuppressive/ dist=poisson link=log;
repeated subject=patienticn /type=ind;
lsmeans testres/diff exp cl;
estimate "RR (Flu v Covid)" testres 1 0 0 -1;
estimate "RR (RSV v Covid)" testres 0 1 0 -1;
estimate "RR (Multiple Inf v Covid)" testres 0 0 1 -1;
format agenumeric age4cat_. testres ztestres_.;
where agenumeric ge 17;
run;

 

More trusted risks (red-circled):

jmg_va_1-1779230463691.png

 

****Link=identity;

title4 "Adjusted Risk Differences";
title5;
proc genmod data=nb;
class hypoxic_14day agenumeric (ref="45-<60") immunosuppressive (ref="FALSE") testres (ref="zCovid Only") PatientICN;
*effect agespl=spline(agenumeric/details naturalcubic basis=tpf(noint)knotmethod=percentiles(4));
model hypoxic_14day (event="1")=testres agenumeric immunosuppressive/ dist=poisson link=identity;
repeated subject=patienticn /type=ind;
lsmeans testres/diff cl;
format agenumeric age4cat_. testres ztestres_.;
where agenumeric ge 17;
run;

Less trusted risks (red-circled) and adjusted risk differences further below);

 

jmg_va_2-1779230638632.png

Thanks for any help you can give! I've been grappling with this issue for a while!

Janet

 

 

1 REPLY 1
StatDave
SAS Super FREQ

See this note which uses several ways using the NLMeans and Margins macro and even PROC NLMIXED. The NLMeans example uses PROC LOGISTIC, but the same can be done if you use GENMOD. With either one, you can start with a logistic model, which is appropriate for a binary response.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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
  • 1 reply
  • 78 views
  • 0 likes
  • 2 in conversation