What is the method for calculating stdres in {MASS}

The documentation for the MASS package does not detail the calculation method for the standardized residuals using stdres(). I want to be sure that it matches the method I intend to use:

residuals/(stdevres*sqrt(1-hat))


Does someone know if this is the calculation applied in this function?

• Hi Sue and welcome to the site. The formula is given in the book "Modern applied statistics with S" on page 151: $e_{i}'=e_{i}/s\sqrt{1-h_{ii}}$ which matches your formula. Alternatively, have a look at the source code of the function in the MASS package by typing: lmwork without parentheses in R after loading the MASS package. Jul 5, 2014 at 14:17
• @COOLSerdash - since you've answered the question, you may as well move it to an answer and get credit for it! Jul 5, 2014 at 15:56

Yes, according to Venables and Ripley, pages 151-152, stdres() returns $$e'_i=\frac{e_i}{s\sqrt{1-h_{ii}}}$$
However they recommend using studentized residuals (in particular for normal probability plots), which are computed by studres(). I've expounded here their difference.