stdresiduals | R Documentation |
Calculates standardized residuals and leverage values.
stdresiduals(x, residuals=NULL, sigma=x$sigma, weights=NULL,
leveragelimit = NULL)
x |
a fitted model object |
residuals |
unstandardized residuals. If missing, they are
obtained from |
sigma |
error standard deviation or other scale |
weights |
weights |
leveragelimit |
scalar a little smaller than 1: limit on leverage values to avoid unduely large or infinite standardized residuals |
The difference to stdres()
from package MASS
is that stdresiduals
also applies to multivariate regression
and can be used with regression model fits not inheriting from lm
.
The function uses the qr
decomposition of object
.
If necessary, it generates it.
vector or matrix of standardized residuals,
with attributes
attr(.,"stdresratio")
:
ratio of standardized / unstandardized residuals,
attr(.,"leverage")
: leverage (hat) values,
attr(.,"weighted")
: weights used in the standardization,
attr(.,"stddev")
: error standard deviation or scale parameter.
Werner A. Stahel, ETH Zurich
stdres; hat; hatvalues; influence
data(d.blast)
r.blast <-
lm(log10(tremor)~location+log10(distance)+log10(charge), data=d.blast)
t.stdr <- stdresiduals(r.blast)
showd(t.stdr)
showd(attr(t.stdr, "leverage"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.