Note that the value of 'E' is not part of the fitted.values (its a part of the
likelihood...), but you can move 'E' into the linear predictor using argument
offset = log(expected_hosp)
instead of
E = expected_hosp
or add offset(log(expected_hosp)) to the formula
> y=10
> r=inla(y~1,data=data.frame(y), family="poisson")
> r$summary.fitted.values$mean
[1] 9.999991924
> r=inla(y~1,E=10, data=data.frame(y), family="poisson")
> r$summary.fitted.values$mean
[1] 0.9999991925
> r=inla(y~1,offset=log(10), data=data.frame(y), family="poisson")
> r$summary.fitted.values$mean
[1] 9.99998304
> r=inla(y~1 + offset(log(10)), data=data.frame(y), family="poisson")
> r$summary.fitted.values$mean
[1] 9.99998304
On Wed, 2025-08-13 at 11:48 -0700, GLORIA NKEM IBEH wrote:
> Thank you Johnson, Daniel P for your insight however, I tried it yet it did
> not work.
>
> On Wednesday, August 13, 2025 at 6:04:40 PM UTC+1 Johnson, Daniel P wrote:
> >
> >
> > control.compute = list(config = TRUE)
> >
> >
> >
> >
> > Daniel P. Johnson, Ph.D.
> > Associate Professor
> > Indiana University at Indianapolis
> > Department of Geography
> >
> >
dpjo...@iu.edu
> >
> >
317-278-5536
> >
> >
> >
> >
> >
Håvard Rue
he...@r-inla.org