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

Hi.

I have about 60,000 records for children in 12 states.  Some children have multiple records.  Some of just one record.

I have a binary dependent variable.  I am trying to estimate a model that takes into account the fact that the records for the same child are correlated and that children are nested within states.  I know how to estimate models with GEE to deal with the correlation but am not sure how to deal with the nesting.  The data look like this.

 

StateChildXY
1111
1101
1211
1210
1200
1200
2301
2301
2311
2300
2301
2410
2401
2410
3510
3600
3700
3701
3711
3710
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
You could combine these two variable into ONE variable(SubjectId). and feed it into PROC GEE.

SubjectID=catx('|',State,Child);

And an alternative way is : (Check GEE's doc example)
proc gee data=Resp descend;
class ID Treatment Center Sex Baseline;
model Outcome=Treatment Center Sex Age Baseline /
dist=bin link=logit;
repeated subject=ID(Center) / corr=exch corrw;
run;

change "subject=ID(Center)" into
"subject=Child(State)"

View solution in original post

3 REPLIES 3
Ksharp
Super User
You could combine these two variable into ONE variable(SubjectId). and feed it into PROC GEE.

SubjectID=catx('|',State,Child);

And an alternative way is : (Check GEE's doc example)
proc gee data=Resp descend;
class ID Treatment Center Sex Baseline;
model Outcome=Treatment Center Sex Age Baseline /
dist=bin link=logit;
repeated subject=ID(Center) / corr=exch corrw;
run;

change "subject=ID(Center)" into
"subject=Child(State)"
adworsky
Calcite | Level 5
Thank you.
StatDave
SAS Super FREQ

First, PROC GEE is a newer procedure specifically for fitting the GEE model and is the recommended procedure when fitting that model. Then see this note on specifying the TYPE= correlation structure. As mentioned there, the GEE method is robust to misspecifying the correlation structure, so if you believe that all measurements within STATE are correlated (in varying degrees), you could simply specify SUBJECT=STATE and TYPE=EXCH. That said, the Alternating Logistic Regressions (ALR) method available in PROC GEE (and GENMOD), in which you model the log odds ratio among pairs of measurements, allows nested structures. Using the ALR example in the GENMOD documentation, the following adds a subcluster variable to each cluster with each cluster of size 4 now containing 2 subclusters of size 2. The ALR model allows for two log odds ratios to be estimated - one for within the subclusters and one for between the subclusters.

data resp; set resp;
  if visit in (1,2) then subclusID=1; else subclusID=2;
  run;
proc gee data=resp;
   class id treatment(ref="P") center(ref="1") sex(ref="M")
      baseline(ref="0") subclusID;
   model outcome(event='1')=treatment center sex age baseline / dist=bin;
   repeated  subject=id(center) / logor=nest1 subcluster=subclusID;
   run;

Another alternative approach might be to fit a GEE-like marginal model using PROC GLIMMIX using an appropriate structure.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 3 replies
  • 823 views
  • 4 likes
  • 3 in conversation