BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
johnrizk
Calcite | Level 5

Hi everyone,

I am currently running county-level data (3130 counties) to study the association between prescription rates (continuous, independent variable) and a county being labeled as "high-risk" (dependent variable, can be 1=high-risk or 0=non-high-risk).

The prescription rates  are at the county level, and so is the outcome variable "high-risk". While I'm not looking at state-level data, it's important to bear in mind that counties are clustered within states, so we need to account for clustering of counties within states. 

Based on this idea, should the "repeated" statement be for the county or the state? I am sharing 2 SAS codes below and would appreciate advise on what be more appropriate. Thank you so much!

 

proc genmod data=dataset descending;
CLASS State  /param=ref;
model highrisk= Opioid_Rx_Rate  /dist=binomial link=logit;
repeated subject = State/type=exch;
estimate 'Opioid_Rx_Rate' Opioid_Rx_Rate 1 / exp;
run;
quit;
 
OR
 
proc genmod data=dataset descending;
CLASS County /param=ref;
model highrisk= Opioid_Rx_Rate  /dist=binomial link=logit;
repeated subject = County /type=exch;
estimate 'Opioid_Rx_Rate' Opioid_Rx_Rate 1 / exp;
run;
quit;
 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

The purpose of the SUBJECT= option in the REPEATED statement of PROC GENMOD is simply to distinguish those observations that are correlated from those that aren't. That is, it defines the clusters of correlated observations. Observations with the same value of the SUBJECT= effect belong to the same cluster and are assumed to be correlated. So, if you feel that there is correlation among all of the observations in the same state, then you should specify SUBJECT=STATE.

View solution in original post

1 REPLY 1
StatDave
SAS Super FREQ

The purpose of the SUBJECT= option in the REPEATED statement of PROC GENMOD is simply to distinguish those observations that are correlated from those that aren't. That is, it defines the clusters of correlated observations. Observations with the same value of the SUBJECT= effect belong to the same cluster and are assumed to be correlated. So, if you feel that there is correlation among all of the observations in the same state, then you should specify SUBJECT=STATE.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 343 views
  • 1 like
  • 2 in conversation