[R] Intercept of confidence interval with a constant

From: Larry Howe <linux_at_comjet.com>
Date: Sat 03 Jun 2006 - 00:52:43 EST


Hello,

Is there a way for R to determine the point where a confidence interval equals a specified value? For example:

x = seq(1:5)
y = c(5, 5, 4, 4, 3)
lm = lm(y ~ x)
p = predict.lm(lm, interval="confidence") matplot(p, type="b")

abline(h = 3)

I want to answer the question: "What is the value of x when the y-value of the lower confidence interval is equal to 3.0"? Visually, it is the place on the example where the abline intersects the lower confidence interval, or about 4.2. Can R calculate this number for me?

I know that predict.lm will calculate a y-value from an x-value, but what I want is the opposite. I know the y-value, and I want to calculate the x-value.

Larry Howe



R-help@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 Received on Sat Jun 03 01:22:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 03 Jun 2006 - 04:10:30 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.