Hi out there,

imagine you have a dataset (x,y) with errors f,
so that each y_i is y_i +- f_i. This is the normal case for almost all
measurements, since one quantity y can only be measured with a certain
accuracy f.

x<-c(1,2,3)
y<-c(1.1,0.8,1.3)
f<-c(0.2,0.2,0.2)
plot(x,y) #whereas every y has the uncertainty of f

If I now perform a nls-fit (and force the data through (0,0) to have
only one fitting parameter)

n<-nls(y~a*x,start=list(a=1))
summary(n)

I end up with an estimate of "a" of 1.4 +- 0.06 as standard error of the fit.
In this case the error gives only the accuracy of the fit itself, but
does not include the measurement errors in y: f (e.g. error bars).
How is it possible to take them into account as well? I know that there is the chi-squared test, where the goodness of the fit is calculated, but this does not include the errors itself.
There should be an easy solution, since this is a common problem in
science, but I haven't found a solution for R yet.

Any suggestions or solutions?
Thanks in advance!

-- Markus

______________________________________________
R-help@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.

Reply via email to