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
- /
- How to output or calculate Studentized Residuals i...

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-03-2014 10:35 AM

I am struggling to output or calculate Studentized Residuals in Proc NLMIXED.

Your help would be appreciated,

Thank you,

Marcio

Accepted Solutions

Solution

07-03-2014
03:03 PM

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

07-03-2014 03:03 PM

Thank you Steve, I ended up get this working and here is how.

As always thanks for your input,

Marcio

predict L + U*(z1) out=ppp;

run;

data ppp; set ppp;

resid=y-pred;

resid_t=resid; run;

proc standard data=ppp std =1 out =pred_std;

var resid_t;

run;

title;

proc print data=ppp; run;

proc print data=pred_std;

run;

symbol1 value=dot color=blue i=none;

proc gplot data=pred_std;

plot resid_t*x resid_t*pred/vref=(0);

run;

All Replies

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

07-03-2014 01:10 PM

I don't know, and the person who I think does is seldom found around here anymore. However, take a look at Dale McLerran's post:

https://communities.sas.com/message/55521#55521

where he calculates individual deviances for a Poisson. I believe you could take the square root of the individual deviance and use it as a denominator in calculating the studentized residual. to me, the key statement is the PREDICT statement with the OUT= option.

Steve Denham

Solution

07-03-2014
03:03 PM

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

07-03-2014 03:03 PM

Thank you Steve, I ended up get this working and here is how.

As always thanks for your input,

Marcio

predict L + U*(z1) out=ppp;

run;

data ppp; set ppp;

resid=y-pred;

resid_t=resid; run;

proc standard data=ppp std =1 out =pred_std;

var resid_t;

run;

title;

proc print data=ppp; run;

proc print data=pred_std;

run;

symbol1 value=dot color=blue i=none;

proc gplot data=pred_std;

plot resid_t*x resid_t*pred/vref=(0);

run;

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

07-09-2014 10:40 AM

You should give yourself a "Correct answer". The use of STANDARD is something I overlook way too often.

Steve Denham

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

07-21-2014 09:48 AM

proc standard would not be giving you the standardized or studentized residual. You need to obtain the estimated standard error for EACH residual, which is not directly given by NLMIXED.The standard procedure is just scaling by the the variation in the raw residuals (not the same thing). I think getting standardized residuals from NLMIXED will require some coding (post-model-fitting) which would depend on the chosen conditional distribution. It would require the "hat" matrix.

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

07-21-2014 11:34 PM

lvm, thanks. This is what I have used.

data ppp; set ppp;

resid=y-pred;

resid_t=resid; run;

proc standard data=ppp std =1 out =pred_std;

var resid_t;

run;

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

07-22-2014 09:50 AM

proc standard will not give you a standardized or studentized residual. Each residual has a unique variance, var(r_i), and you cannot recover this from proc standard (even though I saw a website that says that you can).

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

07-22-2014 09:58 AM

I think I saw the same thing, hence my excitementat using PROC STANDARD. I think an IML solution may be the only way out now.

Steve Denham

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

10-22-2014 07:26 PM

Hi Steve, do you have any directions on how I could get that?

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

10-23-2014 07:02 AM

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

10-24-2014 04:53 PM

Hi Steve, thanks!!! I was not able to find nothing related to NLMIXED or 'studentized' in his blog, any idea what I should look at?

Thanks,

Marcio

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

10-27-2014 08:00 AM

It wouldn't be specific, but more as background on how to use IML to calculate what you need from the various matrixes, following 's note regarding the individual variances of the residual.

Now it seems to me that a residual is a sum of two non-independent random variables, and the estimate and the Y value are correlated, so the key is getting the covariance between the two to estimate the variance of the residual. Surely someplace on the web has a matrix representation. Then it is just a matter of of following the right examples in the documentation and Rick's blog.

Steve Denham