Pan, Chongle
2005-Jan-20 20:46 UTC
[R] Straight-line fitting with errors in both coordinates
Hi All, I want to fit a straight line into a group of two-dimensional data points with errors in both x and y coordinates. I found there is an algorithm provided in "NUMERICAL RECIPES IN C" http://www.library.cornell.edu/nr/bookcpdf/c15-3.pdf I'm wondering if there is a similar function for this implemented in R. And how can I change the objective function, from example, from sum of squared error to sum of absolute error? Regards, Chongle
davidr@rhotrading.com
2005-Jan-21 14:42 UTC
[R] Straight-line fitting with errors in both coordinates
You want to look in the archives or elsewhere online for "errors in variables" or "total least squares". There are many resources. Note that the method in NR assumes both variables have equal-sized observational errors. If that is not the case for your data, then the method is inappropriate. HTH, David Reiner -----Original Message----- From: Pan, Chongle [mailto:cpan at utk.edu] Sent: Thursday, January 20, 2005 2:47 PM To: r-help at stat.math.ethz.ch Subject: [R] Straight-line fitting with errors in both coordinates Hi All, I want to fit a straight line into a group of two-dimensional data points with errors in both x and y coordinates. I found there is an algorithm provided in "NUMERICAL RECIPES IN C" http://www.library.cornell.edu/nr/bookcpdf/c15-3.pdf I'm wondering if there is a similar function for this implemented in R. And how can I change the objective function, from example, from sum of squared error to sum of absolute error? Regards, Chongle ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html