Skip to content
Prev 268195 / 398502 Next

studentized and standarized residuals

Dear Jen,

Actually you can check out what R does by looking at the source.

# first type the name of the function
function (model, ...)
UseMethod("rstandard")
<environment: namespace:stats>

# ?methods will list you the corresponding functions
[1] rstandard.glm rstandard.lm

# choose rstandard.lm
function (model, infl = lm.influence(model, do.coef = FALSE),
    sd = sqrt(deviance(model)/df.residual(model)), ...)
{
    res <- infl$wt.res/(sd * sqrt(1 - infl$hat))
    res[is.infinite(res)] <- NaN
    res
}

# in case the function is not visible,
# you can use <package-name>:::<function-name> to display it
stats:::rstandard.lm


Best,
  Denes