[R-sig-ME] Negative response values when simulating glmer with log link
Fiona Scarff
||on@@@c@r||@4 @end|ng |rom gm@||@com
Tue Apr 29 08:50:16 CEST 2025
I have some data in which the response variable can only be a non-negative
number. I fitted a log normal glmm using the lme4 package, and simulated
from the model using simulate.merMod. A very small proportion of the
simulated values are slightly negative, and I would like to understand how
that is possible with a log link. I found a post in which Ben Bolker
observed that:
"Note that if you did simulate data with a log link and a Gaussian family,
you could still get negative values if the standard deviation were large
enough ..."
https://github.com/lme4/lme4/issues/530
I thought that the log link would force all the reponses to be
non-negative. It is not especially important in this particular case, but I
feel I have misunderstood something, either about the way that simulate()
works for mixed effects models, or perhaps something more fundamental about
how random effects work in a model with a non-identity link. Apologies
therefore if this question is misdirected and ought instead to go to
crossvalidated.
Many thanks for your help,
Fiona
*Dr Fiona Scarff*
*Harry Butler Institute*
*Murdoch University*
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list