BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sharcole
Fluorite | Level 6

I'm having trouble getting output of standardized pearson residuals and standardized deviance residuals in proc genmod. I was able to get non standardize residuals with this code:

output out = overall3 reschi=reschi p=predicted;

but get all missing values when using this code: output out = overallstd stdresdev=stdresdev p=predicted;

 

Thank you for any assistance

1 ACCEPTED SOLUTION

Accepted Solutions
sharcole
Fluorite | Level 6

Thank you all-

SAS technical support clarified: The standardized residuals cannot be computed for GEE models. They depend on the deviance or Hessian matrix which isn't involved in the GEE estimation method

View solution in original post

7 REPLIES 7
Reeza
Super User

Please post your full code and log. 

 

I don't have any issues in SAS 9.4M3. Note what SAS version you have, and what SAS/STAT version you have as well.

If the code below doesn't run successfully, include the log. 

 

data drug;
   input drug$ x r n @@;
   datalines;
A  .1   1  10   A  .23  2  12   A  .67  1   9
B  .2   3  13   B  .3   4  15   B  .45  5  16   B  .78  5  13
C  .04  0  10   C  .15  0  11   C  .56  1  12   C  .7   2  12
D  .34  5  10   D  .6   5   9   D  .7   8  10
E  .2  12  20   E  .34 15  20   E  .56 13  15   E  .8  17  20
;

proc genmod data=drug;
   class drug;
   model r/n = x drug / dist = bin
                        link = logit
                        lrci;
output out = overallstd stdresdev=stdresdev p=predicted;
run;
sharcole
Fluorite | Level 6
Thank you,

Your example works - I have 9.4 TS1M3



When I try with my own data, however, it is not working.



I note that your dependent variable is r/n . Would this have any implications?



The full code looks like this:



proc genmod data=stigma4 descending ;

class subid adependent (ref="0=No") time (ref="0")

marstat_bl (ref="1=Married/living with partner")

employ_bl (ref="1=Yes") educ9_bl (ref="0=No") msm2_bl (ref="2=N/A") suiclife_bl (ref="0=No")

moddep (ref="0=No") supportmedian (ref="1=Yes") drug_dependent (ref="0=No")/param=ref ;



model negimage_2 = adependent time marstat_bl employ_bl educ9_bl

msm2_bl suiclife_bl moddep supportmedian drug_dependent

mcs pcs hiv_yrs_bl ls_age_bl / dist=bin type3 link=logit lrci;



output out = overallstd stdresdev=stdresdev p=predicted;

repeated subject=subid/ type=ind corrw ;


Ksharp
Super User

I noticed you are using REPEAT statement, that mean you are fiting GEE.

Can you see the standardized residuals in the output ?

sharcole
Fluorite | Level 6

Hi - Yes, this is a GEE. 

 

I'm wondering if The standardized residuals cannot be computed mathmatically for GEE models?

 

I get all missing values in the output.

 

Thank  you!

Ksharp
Super User

If you can not see standardized residuals in RESULT printed by GEE, then you can not get it,

GEE take residuals as correlation.

Ksharp
Super User

Add option OBSTATS into MODEL statement and see if you can get Pearson residual, if you can obtain it then you can output it.

sharcole
Fluorite | Level 6

Thank you all-

SAS technical support clarified: The standardized residuals cannot be computed for GEE models. They depend on the deviance or Hessian matrix which isn't involved in the GEE estimation method

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
  • 7 replies
  • 5495 views
  • 3 likes
  • 3 in conversation