Skip to content
Prev 315235 / 398503 Next

One sided confidence limits for the regression line

On 01/14/2013 05:19 PM, li li wrote:
Essentially just multiply the "lack of confidence" by 2.

E.g. for 95% one-sided confidence use 90% two-sided confidence
limits (and choose the limit that you're interested in).

E.g.:

set.seed(42)
x    <- seq(0,10,length=101)
y    <- 1.5 + 2.5*x + rnorm(101,0,5)
fit   <- lm(y ~ x)
pfit <- predict(fit,interval="confidence",level=0.90)
plot(x,y)
lines(x,pfit[,"fit"])
lines(x,pfit[,"upr"],col="red")

You are then, for any given x value, 95% confident that the true mean of 
"Y" lies *below* the
corresponding y-value on red curve that was plotted.

     cheers,

         Rolf Turner