[R] Using known errors and error bars
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sun May 9 17:52:19 CEST 2004
What do you actually know?
You don't have `known errors', as if you did you could correct the values.
I doubt if you actually have a known range, more likely a standard error
or a confidence interval. (If you think you do have a known range, how do
you know?)
And if A is not known exactly, linear regression is not fully appropriate.
If you know standard errors, then you need a homoscedastic
errors-in-variables formulation. One early account is
Ripley, B. D. and Thompson, M.(1987) Regression techniques for the
detection of analytical bias. Analyst 112, 177-183.
and its Fortran program is still available, and although I have never
coded it in R, I believe others have.
On Sun, 9 May 2004, Sebastian Schubert wrote:
> I'm now to R and hope (actually, I'm quite sure) you can help me. I made
> an experiment and measured two values. As I know the errors of these
> values I want to use them with the linear regression,
> eg
> Value A
> 1.1+-0.02
> 1.9+-0.05
> 3.05+-0.03
> 4.0+-0.01
> 5.1+-0.06
>
> Value B
> 4.2+-0.14
> 5.3+-0.05
> 6.8+-0.11
> 7.9+-0.01
> 8.5+-0.02
>
> lm(B~A) does the linear regression but how can I use the fact that 1.1 is
> between 1.12 and 1.08?
> How can I put error bars for A and B in the plot (like Excel is capable
> of)?
Many ways, for example using arrows() or plotCI in package gregmisc.
> I hope I made myself understandable,
> thanks
> Sebastian
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list