[R] Total least squares linear regression

Paul Hiemstra p.hiemstra at geo.uu.nl
Wed Feb 10 17:10:35 CET 2010


Hi,

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.

groet,
Paul

Gnewbee wrote:
> 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 
> far.
> 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
>
> Gnewbee
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-help mailing list