I want to compute a 90% confidence interval for a mean response at a specific x value, and a 90% prediction interval for the individual response at that same X value. The way I know how to do this in R is by using the predict() function, but this function create 95% intervals, and I want 90%. How do I do this?
1 Answer
For a linear regression model, in level = 0.95
just replace 0.95 by 0.90. Below I'm reporting the help of predict
in the case of an object of class lm
## S3 method for class 'lm'
predict(object, newdata, se.fit = FALSE, scale = NULL, df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95, type = c("response", "terms"),
terms = NULL, na.action = na.pass,
pred.var = res.var/weights, weights = 1, ...)
predict
? $\endgroup$