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

Hello Community,

 

I am trying to calculate model fit for the two Proc GEE models below. I know I can calculate using QIC number and find for the lower number. 

ods output GEEFitCriteria=fitcrit;
proc gee data=data;
	class subjectID var1 var2;
	model isBlockAcuteGap(event="1")= var1 var2/ dist=bin link=logit type3  ;
	repeated subject=subjectID ;
run;

ods output GEEFitCriteria=fitcrit2;
proc gee data=data;
	class subjectID var1 var2 var3;
	model isBlockAcuteGap(event="1")= var1 var2 var3 / dist=bin link=logit type3 wald;
	repeated subject=subjectID ;
run;

Is there a way to statistically look for the difference between these two models instead of just looking at the lower Qic number? 


I don't know how to find a loglikelihood ratio for the model above. 

 

Thanks

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

/*
You could compare two model's RUC statistic to see
if they are different statistically.
But you could run into over-fit problem if you have many X variables.
*/
data data;
 set sashelp.heart;
 if not missing(Smoking_Status);
run;
proc gee data=data;
 class Smoking_Status;
 model Status(event="Dead")= weight height/ dist=bin link=logit type3  ;
 repeated subject=Smoking_Status ;
 output out=want1(keep=status p1) predicted=p1;
run;
proc gee data=data;
 class Smoking_Status;
 model Status(event="Dead")= weight height Diastolic Systolic MRW/  dist=bin link=logit type3 wald;
 repeated subject=Smoking_Status ;
 output out=want2(keep=status p2) predicted=p2;
run;


data want;
 merge want1 want2;
run;
proc logistic data=want ;
model Status(event="Dead")=p1 p2/nofit;
roc 'p1' pred=p1;
roc 'p2' pred=p2;
roccontrast reference('p2') / estimate e;
run;

Ksharp_0-1677498345805.png

 

View solution in original post

5 REPLIES 5
StatDave
SAS Super FREQ

Goodness of fit is always a matter of how you want to define it. See the "Assessing fit in Generalized Estimating Equations (GEE) models" section of this note which mentions an R-square measure, the QIC measure, and observation- and cluster-level ways of assessing fit. Additionally, in your case, the two models differ only by the addition of one predictor. So, the question might amount to whether that added predictor is important. In that case, the significance of that predictor is a comparison of fit.

 

Regarding the likelihood ratio test - this is not possible since the GEE method is not likelihood-based.

 

As a separate note, you should never include variables in the CLASS statement that aren't also used in the MODEL, REPEATED, or other statements involved in fitting the model. Doing so can cause observations to be omitted that don't have to be.

twix17
Obsidian | Level 7

Thanks for your response. I have updated the sas code. Thanks

Ksharp
Super User

/*
You could compare two model's RUC statistic to see
if they are different statistically.
But you could run into over-fit problem if you have many X variables.
*/
data data;
 set sashelp.heart;
 if not missing(Smoking_Status);
run;
proc gee data=data;
 class Smoking_Status;
 model Status(event="Dead")= weight height/ dist=bin link=logit type3  ;
 repeated subject=Smoking_Status ;
 output out=want1(keep=status p1) predicted=p1;
run;
proc gee data=data;
 class Smoking_Status;
 model Status(event="Dead")= weight height Diastolic Systolic MRW/  dist=bin link=logit type3 wald;
 repeated subject=Smoking_Status ;
 output out=want2(keep=status p2) predicted=p2;
run;


data want;
 merge want1 want2;
run;
proc logistic data=want ;
model Status(event="Dead")=p1 p2/nofit;
roc 'p1' pred=p1;
roc 'p2' pred=p2;
roccontrast reference('p2') / estimate e;
run;

Ksharp_0-1677498345805.png

 

twix17
Obsidian | Level 7
Thanks @Ksharp

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
  • 5 replies
  • 1029 views
  • 1 like
  • 3 in conversation