[R] confidence interval or error of x intercept of a linear regression
Kevin J Emerson
kemerson at uoregon.edu
Tue Mar 24 04:31:32 CET 2009
Hello all,
This is something that I am sure has a really suave solution in R, but I can't quite figure out the best (or even a basic) way to do it.
I have a simple linear regression that is fit with lm for which I would like to estimate the x intercept with some measure of error around it (confidence interval). In biology, there is the concept of a developmental zero - a temperature under which development will not happen. This is often estimated by extrapolation of a curve of developmental rate as a function of temperature. This developmental zero is generally reported without error. I intend to change this! There has to be some way to assign error to this term, I just have yet to figure it out.
Now, it is simple enough to calculate the x-intercept itself ( - intercept / slope ), but it is a whole separate process to generate the confidence interval of it. I can't figure out how to propagate the error of the slope and intercept into the ratio of the two. The option option I have tried to figure out is to use the predict function to look for where the confidence intervals cross the axis but this hasn't been too fruitful either.
I would greatly appreciate any insight you may be able to share.
Cheers,
Kevin
Here is a small representative sample of some of my data where Dev.Rate ~ Temperature.
t <-
structure(list(Temperature = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 10.5,
10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5, 10.5,
10.5, 10.5, 10.5, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 14, 14, 14, 14, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18,
18, 18, 18, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 22, 22), Dev.Rate = c(0.007518797, 0.007518797, 0.007518797,
0.007194245, 0.007194245, 0.007194245, 0.007194245, 0.007194245,
0.007194245, 0.006896552, 0.006896552, 0.012820513, 0.012820513,
0.012195122, 0.012195122, 0.012195122, 0.012195122, 0.011363636,
0.011363636, 0.011363636, 0.011363636, 0.011363636, 0.011363636,
0.011363636, 0.010869565, 0.00952381, 0.00952381, 0.015151515,
0.015151515, 0.022727273, 0.022727273, 0.022727273, 0.022727273,
0.022727273, 0.022727273, 0.022727273, 0.022727273, 0.022727273,
0.022727273, 0.022727273, 0.022727273, 0.020833333, 0.020833333,
0.020833333, 0.034482759, 0.029411765, 0.029411765, 0.029411765,
0.029411765, 0.029411765, 0.029411765, 0.029411765, 0.029411765,
0.029411765, 0.029411765, 0.029411765, 0.029411765, 0.029411765,
0.029411765, 0.029411765, 0.027027027, 0.025, 0.038461538, 0.03030303,
0.03030303, 0.03030303, 0.052631579, 0.052631579, 0.045454545,
0.045454545, 0.045454545, 0.045454545, 0.045454545, 0.045454545,
0.045454545, 0.045454545, 0.045454545, 0.038461538, 0.038461538,
0.038461538, 0.038461538, 0.038461538, 0.038461538, 0.038461538,
0.038461538, 0.047619048, 0.047619048, 0.047619048, 0.047619048,
0.047619048, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625,
0.0625, 0.0625, 0.0625, 0.0625, 0.052631579, 0.052631579, 0.052631579,
0.052631579, 0.052631579, 0.076923077, 0.071428571)), .Names = c("Temperature",
"Dev.Rate"), class = "data.frame", row.names = c(NA, 107L))
--
==========
==========
Kevin J Emerson
Bradshaw-Holzapfel Lab
Center for Ecology and Evolutionary Biology
1210 University of Oregon
Eugene, Oregon 97403
kemerson at uoregon.edu
More information about the R-help
mailing list