Replies: 2 comments 1 reply
-
I agree, the way how prediction intervals are calculated in insight seems to be more appropriate. It also is very close to what you get via data("Salamanders", package = "glmmTMB")
m <- glm(count ~ mined, family = poisson(link = "log"), data = Salamanders)
ggeffects::ggpredict(m, terms = c("mined"), type = "simulate")
#> # Predicted counts of count
#>
#> mined | Predicted | 95% CI
#> ------------------------------
#> yes | 0.30 | 0.00, 1.97
#> no | 2.27 | 0.00, 5.69 Created on 2024-02-13 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks, should be fixed in #442 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm quite new and would like to apologise if this is not the correct place to post my question.
I'm currently trying to compute model prediction and associated prediction intervals. My model is a Poisson regression. I currently use 2 methods to derive the prediction intervals: insight::get_predicted and ggeffects::ggpredict. The two methods lead to quite different PI. Moreover the PI obtained when using ggpredict are extremely large (in some cases the upper limit > the maximum observed value). How is that possible? I'm missing something?
I get the same issue when using a very simple model (see code below). I would greatly appreciate some help.
Many thanks in advance,
Marie
A basic example
data("Salamanders")
m <- glm( count ~ mined , family = poisson(link = "log"), data = Salamanders)
d <- data_grid(m, terms = c("mined"))
Using insight::get_predicted
cbind(d,insight::get_predicted(mm, d, ci = 0.95,predict = "prediction") )
mined Predicted CI_low CI_high
1 yes 0.2954545 2.220446e-16 2
2 no 2.2648810 2.220446e-16 6
Using ggpredict
ggpredict(m, terms = c("mined"), interval = "prediction" )
mined | Predicted | 95% CI
yes | 0.30 | [0.01, 6.41]
no | 2.26 | [0.11, 48.83]
Beta Was this translation helpful? Give feedback.
All reactions