# studentized residuals in nonlinear regression

I am using the nls function in R to perform a nonlinear regression and need to calculate the studentized residuals. Is this something I need to manually do? It seems like I need to manually do a QR decomposition and calculate the hat matrix to do this. I don't have a problem doing this but I wanted to ask if anyone knew an easier way to do this.

• Internally or externally studentized? – Glen_b Aug 31 '14 at 3:03
• This is a homework related question and it's not specified but I would assume internally. – statsnewb Aug 31 '14 at 3:05
• the package nlreg (for heteroskedastic nonlinear regression) has a function (nlreg.diag) that can return a variety of such things including studentized residuals; I don't know much about it but it might be able to do ordinary nonlinear regression for you. – Glen_b Aug 31 '14 at 3:12