-1

Possible Duplicate:
How to calculate Total least squares in R? (Orthogonal regression)

I have to implement Total Least Squares model in R instead of lm() (linear regression)

Who don't understand what I mean, this link maybe be useful: http://en.wikipedia.org/wiki/Total_least_squares

Is there a R function for this kind of regression model?

Community
  • 1
  • 1
Bleak
  • 159
  • 1
  • 2
  • 6
  • 2
    It would be more useful if you could link earlier questions: http://stackoverflow.com/questions/6872928/how-to-calculate-total-least-squares-in-r-orthogonal-regression , http://stats.stackexchange.com/questions/13152/how-princomp-works . I think it would be more useful to edit and clarify your previous questions rather than asking new ones: are you the same person as Dail??? – Ben Bolker Jul 31 '11 at 17:14
  • 1
    PS -- I have voted to close this question and merge it with the earlier question (it would also be useful to grab some of the answers from the StackExchange/Crossvalidated question ...) – Ben Bolker Jul 31 '11 at 17:20

1 Answers1

2

Not sure there's a package but there's some code available here:

http://r.789695.n4.nabble.com/Total-least-squares-linear-regression-td1475960.html

You could also likely do a fairly inefficient search by using one of R's various and powerful optimization packages. Since from this article http://arxiv.org/PS_cache/math/pdf/9805/9805076v1.pdf it appears that the centroid always runs through the best fit line, you'd just be searching to find the angle that minimizes the sum of the squared Euclidian distances. Shouldn't be too hard, but that just gets you the fit not any diagnostics on the fit.

Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
  • Deming is not TLS. As wikipedia says "It is a generalization of Deming regression...", so I don't think there are the same things – Bleak Jul 31 '11 at 13:53
  • Is it possible there is no R function to do it automatically? – Bleak Jul 31 '11 at 13:58
  • Don't you mean, "Deming is TLS but TLS is not Deming?" :-) It would be odd if there's no package (since R really seems to have everything under the sun, statistically-speaking), but you should be able to fit the optimization problem Wikipedia gives you, no? – Ari B. Friedman Jul 31 '11 at 14:04
  • TLS is a "generalization" of Deming regression....is what I see – Bleak Jul 31 '11 at 14:06
  • 2
    Deming regression is the name given to TLS in the special case of two covariates. You have demonstrated little evidence that you have the first clue about the TLS method yet have the audacity to tell others they are wrong. – Gavin Simpson Jul 31 '11 at 20:58
  • 2
    @GavinSimpson Not exactly. *Orthogonal* regression is the special case of TLS with two covariates. But Deming regression is more generale than orthogonal regression: orthogonal regression is the special case of Deming regression when we assume equal variances; Deming regression, more generally, allows an arbitrary ratio of the variances. – Stéphane Laurent Aug 29 '17 at 09:16