Statistical Procedures

Programming the statistical procedures from SAS
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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