Re: [R] ls.diag and lsfit very basic question

2011-01-23 Thread P Ehlers
MM wrote: Hello, Is the "std.dev" component of ls.diag( lsfit(x,y) ) the sample standard deviation of the residuals of the fit? I have ls.diag(lsfit(xx,yy))$std.dev different from sd(lsfit(xx,yy)$residuals) where xx and yy are vectors of 5 elements. Compare ls.diag(lsfit(xx,yy))$std

Re: [R] ls.diag and lsfit very basic question

2011-01-22 Thread Joshua Wiley
Hi, Yes, that is basically the idea. It is defined as: stddev <- (colSums(as.matrix(resids^2))/(n - p))^0.5 Where n is the number of rows in the residual matrix and p is the rank of the QR decomposition. I believe the reason they are slightly different is that the mean of the residuals is not

[R] ls.diag and lsfit very basic question

2011-01-22 Thread MM
Hello, Is the "std.dev" component of ls.diag( lsfit(x,y) ) the sample standard deviation of the residuals of the fit? I have ls.diag(lsfit(xx,yy))$std.dev different from sd(lsfit(xx,yy)$residuals) where xx and yy are vectors of 5 elements. Regards, _