I'd like to find the sum of the residuals from the orthogonal regression line.
It seems that the sum of the residual squares of linear regression is found in deviance(lm(d[,1]~d[,2]), but how should I find it in the case of orthogonal regression?
The orthogonal regression line was found as follows:
r<-prcomp (~d[,1]+d[,2])
slip<-r$rotation[2,1]/r$rotation[1,1]
intercept<-r$center[2]-slope*r$center[1]
install.packages('deming')
library (deming)
fit<-deming(d[,1] to d[,2])
fit$residuals
© 2024 OneMinuteCode. All rights reserved.