Programming the statistical procedures from SAS

Getting standardized residuals with proc genmod

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Getting standardized residuals with proc genmod

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


Accepted Solutions
Solution
‎03-06-2017 02:14 PM
Occasional Contributor
Posts: 7

Re: Getting standardized residuals with proc genmod

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


All Replies
Grand Advisor
Posts: 16,865

Re: Getting standardized residuals with proc genmod

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;
Occasional Contributor
Posts: 7

Re: Getting standardized residuals with proc genmod

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 ;


Grand Advisor
Posts: 9,447

Re: Getting standardized residuals with proc genmod

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

Can you see the standardized residuals in the output ?

Occasional Contributor
Posts: 7

Re: Getting standardized residuals with proc genmod

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!

Grand Advisor
Posts: 9,447

Re: Getting standardized residuals with proc genmod

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

GEE take residuals as correlation.

Grand Advisor
Posts: 9,447

Re: Getting standardized residuals with proc genmod

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

Solution
‎03-06-2017 02:14 PM
Occasional Contributor
Posts: 7

Re: Getting standardized residuals with proc genmod

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 190 views
  • 3 likes
  • 3 in conversation