I have found very limited information on how ggeffects handles offsets. I found this article describing different ways packages in R and Stata handle offsets. I implemented the example in the website and discovered that ggpredict is estimating the factor variables at the mean value of the offset, but I thought it would not based on it using predict() rather than emmeans(), which behave differently. Any idea how to get ggpredict to use the actual offset values rather than the mean of the offset? Or another way to calculate them with a glmmTMB object? The results are very, very different at the mean value than averaged over the actual offset values. I'm unable to implement the example given of estimating the marginal effects by hand due to random effects and several more continuous variables in addition to factor variables...
ggpredict(nb_glm_offset)
$age
# Predicted counts of claims
age | Predicted | 95% CI
----------------------------------
<25 | 27.44 | [22.97, 32.78]
25-29 | 24.17 | [20.88, 27.97]
30-35 | 21.30 | [18.51, 24.50]
>35 | 18.04 | [16.21, 20.07]
Adjusted for:
* ln_holders = 4.90
$ln_holders
# Predicted counts of claims
ln_holders | Predicted | 95% CI
-------------------------------------------
1 | 0.55 | [ 0.46, 0.66]
2 | 1.50 | [ 1.26, 1.80]
3 | 4.09 | [ 3.42, 4.88]
4 | 11.11 | [ 9.30, 13.27]
5 | 30.19 | [ 25.28, 36.07]
6 | 82.08 | [ 68.71, 98.05]
7 | 223.11 | [ 186.77, 266.52]
9 | 1648.59 | [1380.06, 1969.36]
Adjusted for:
* age = <25
attr(,"class")
[1] "ggalleffects" "list"
attr(,"model.name")
[1] "nb_glm_offset"