0
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ Could you show an example of a model (lm, glm, etc) you want to use in predict? $\endgroup$
    – utobi
    Oct 18, 2022 at 18:04

1 Answer 1

2
$\begingroup$

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, ...)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.