I didn't find a function to calculate the orthogonal regression (TLS - Total Least Squares).
Is there a package with this kind of function?
Update: I mean calculate the distance of each point symmetrically and not asymmetrically as lm()
does.
OLS fits the equation y=βx by minimizing squared distances between observed values y and predicted values ˆy. TLS fits the same equation by minimizing squared distances between (x,y) points and their projection on the line. In this simplest case TLS line is simply the first principal component of the 2D data.
The crucial difference between the OLS and TLS methods is that the former minimizes the error only for the vertical variable whereas the latter minimizes the errors in both the horizontal and vertical directions (Markovsky and Van Huffel 2007).
Orthogonal Distance Regresson (ODR) is the name given to the com- putational problem associated with finding the mciximum likelihood esti- mators of parameters in measurement error models in the case of normally. distributed errors.
You might want to consider the Deming()
function in package MethComp [function info]. The package also contains a detailed derivation of the theory behind Deming regression.
The following search of the R Archives also provide plenty of options:
Your multiple questions on CrossValidated, here and R-Help imply that you need to do a bit more work to describe exactly what you want to do, as the terms "Total least squares" and "orthogonal regression" carry some degree of ambiguity about the actual technique wanted.
Two answers:
gx.rma
in the rgr
package appears to do this.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With