turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Getting standardized residuals with proc genmod

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-02-2017 04:46 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

03-06-2017 02:14 PM

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

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sharcole

03-02-2017 04:59 PM

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;
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

03-02-2017 05:18 PM

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 ;

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 ;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sharcole

03-02-2017 10:15 PM

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

Can you see the standardized residuals in the output ?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

03-03-2017 10:26 AM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sharcole

03-03-2017 09:47 PM

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

GEE take residuals as correlation.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sharcole

03-04-2017 08:39 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

03-06-2017 02:14 PM

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