[R] Total least squares linear regression
p.hiemstra at geo.uu.nl
Wed Feb 10 17:10:35 CET 2010
The wikipedia shows the matrix algebra that calculates Total regression,
you could put this into R code to solve your problem. Also take a look
at the pcrcomp or svd function for singular value decmoposition
implementation. This would probably not be generic, but that is not a
problem for you.
> Dear all,
> After a thorough research, I still find myself unable to find a
> function that does linear regression of 2 vectors of data using the
> "total least squares", also called "orthogonal regression" (see :
> http://en.wikipedia.org/wiki/Total_least_squares) instead of the
> "ordinary least squares" method. Indeed, the "lm" function has a
> "method" argument but the manual says that there is only one option so
> However, since the samples I am studying have the type of relationship
> that requires orthogonal regression, I am bound to use it.
> The only thing I've found so far is the "tlsce" function in the "BCE"
> package (see : http://cran.r-project.org/web/packages/BCE/index.html)
> but I'm not sure it's of general use or designed for the particular
> application of taxonomy, since its arguments are supposed to be matrices.
> If any of you knew a function that does this or had a personnal script
> to do this kind of regression, I'd be very grateful.
> Thanks a lot in advance
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
P.O. Box 80.115
3508 TC Utrecht
Phone: +3130 274 3113 Mon-Tue
Phone: +3130 253 5773 Wed-Fri
More information about the R-help