1

I am fitting a model by lm(), predict data wich gives me also confidence intervals (lwr, upr), and plot a scatterplot with regression line with confidence intervals. Yes, it works nicely.

My only question - I could not find it in the documentation or elsewhere specifically for this function - is: are these calculated confidence intervals (presumably) 95% (or 90%?) confidence intervals, or can one change that?

df    <- data.frame(x = x, y = y)
fit   <- lm(y ~ x, data = df))
new.x <- seq(min(df$x), max(df$x), length.out=100)
pred  <- predict(fit, newdata = data.frame(x=new.x), 
                 interval = 'confidence')
Martin
  • 594
  • 5
  • 16

0 Answers0