Hi everyone:
I have a dataset with hierarchically clustered data: repeated measures per patient within repeated hospitals. I am trying to adjust for both levels in my model, plus I would like to estimate Relative Risks instead of odds ratios .I used the following genmode code, would the repeated statement adjust for clustering in the hospital and subject?
proc genmod data= data;
class hospital gender(ref="2") outcome(ref="1") ID;
model outcome= gender /dist=binomial link=log;
repeated subject=hospital(ID);
run;
Thanks
quit;
Try -
proc genmod data= data;
class hospital gender(ref="2") outcome(ref="1") ID;
model outcome= gender /dist=binomial link=log;
repeated subject=hospital / logor=nest1 subcluster=ID;
estimate 'M v F' gender 1 -1 / exp; /*if male=0 and female=1 in your data*/
run;
The repeated statement above fits an Alternative Logistic Regression model.
The exp option in the estimate statement will transform the beta estimate to a RR
The REPEATED statement in PROC GENMOD fits the GEE model. It is not a hierarchical model - which can be fit using the RANDOM statement in PROC GLIMMIX. The GEE method is robust to misspecifying the correlation structure, so the results can still be valid in your situation. The unstructured correlation matrix (TYPE=UN) can accommodate any correlations among the repeated measures since it imposes no structure on them, but it can cause fitting problems because it requires estimating all of the correlations. Similarly, using the log link with the binomial distribution can cause fitting problems since it doesn't ensure that predicted values are valid (in the 0 to 1 range) for the binomial distribution. So, you could follow the method at the beginning of this note, but use either PROC GENMOD (with REPEATED) or PROC GLIMMIX (with RANDOM) instead of PROC LOGISTIC to fit the usual logit-linked binomial model (logistic model), and then follow with the NLMeans macro to estimate the relative risk. The log-linked binomial model is covered later in the note and discusses the fitting problems that I mention above.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.