BookmarkSubscribeRSS Feed
derbygun
Fluorite | Level 6

Hi All,

 

I am a bit confused about the variable to use with the repeated statement. My analysis has a binary outcome. Some of the variables included in the model were measured at the zip code level, meaning patients in the same zipcodes would have the same values for the variables I intend to include in the model. I am confused if the repeated statement should be zipcode or  person_id. 


proc genmod data=  y descending ;

class zipcode gender (ref="0") race (ref="0") cgd (ref="0") cbf (ref="0") cdd (ref="0") csd (ref="0") obesepat (ref="0") hpsa (ref="0") LT_100FPL_F4 (ref="0") LT_138FPL_F4 (ref="0")/ param=glm;

model  b = age gender race cgd cbf obesepat cdd csd bachdegree hpsa LT_100FPL_F4 LT_138FPL_F4 / dist=bin link=logit;

repeated subject=zipcode/ type=cs;

lsmeans gender race chf cvd obesepat cad ckd hpsa LT_100FPL_F4 LT_138FPL_F4/diff oddsratio cl;

run;

 

OR 

 

proc genmod data=  y descending ;

class person_id gender (ref="0") race (ref="0") cgd (ref="0") cbf (ref="0") cdd (ref="0") csd (ref="0") obesepat (ref="0") hpsa (ref="0") LT_100FPL_F4 (ref="0") LT_138FPL_F4 (ref="0")/ param=glm;

model  b = age gender race cgd cbf obesepat cdd csd bachdegree hpsa LT_100FPL_F4 LT_138FPL_F4 / dist=bin link=logit;

repeated subject= person_id/ type=cs;

lsmeans gender race chf cvd obesepat cad ckd hpsa LT_100FPL_F4 LT_138FPL_F4/diff oddsratio cl;

run;

 

Thank you all. 

 

 

2 REPLIES 2
StatDave
SAS Super FREQ

To answer this question, you only need to decide which observations are considered correlated together. If all observations within a subject are considered correlated and observations between subjects are considered independent, then specify the subject identifier in SUBJECT=. You don't need to consider the predictors to determine what to specify in SUBJECT=.

jozgot
SAS Employee

Hi @derbygun,

 

To elaborate on the point about correlation from @StatDave : do you have multiple (repeated) measurements on each person_id? If not, there's nothing correlated to model, so we'd omit person_id from the model.

 

Since observations within zip codes are presumably correlated, you could use model #1.

 

More details on Proc Genmod Repeated parameterization here. Reading this from your example, person_id would be equivalent to patient and zipcode would equate to physician.

 

I favor Proc GLIMMIX because it's intuitive to input natural hierarchies, for example: 

 random person_id / subject=zipcode residual ;

and it uses likelihood techniques which some practitioners hold to be preferable to moment specifications like those in Genmod.

 

Good luck!


SAS Agriculture Analytics
sas.com/agtech | #SASAgTech

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 1886 views
  • 0 likes
  • 3 in conversation