BookmarkSubscribeRSS Feed
nataliavanessa0
Calcite | Level 5

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;

2 REPLIES 2
anguye11
Calcite | Level 5

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

StatDave
SAS Super FREQ

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 576 views
  • 1 like
  • 3 in conversation