Offset log link notation in R lme4

Viewed 99

I want to include an offset in a generalized linear model with a Poisson error distribution. I’m working in R and the lme4 package. I know that I need to relate the offset using the log link function, but I’m confused by the syntax I’ve seen online. My understanding is that the log link exponentiates the predictor variables, and so my expectation was that I should exponentiate the offset, perhaps with offset(exp(variablename)). But I’ve seen here and here that the syntax is offset(log(variablename)). This post uses offset(-log(variablename)). What am I misunderstanding? The exp and log functions in R, how log link works, or how offsets work? All three?

I’m not sure if this question is best-suited to Stack Overflow or Cross Validated, so apologies if I’ve posted in the wrong space.

0 Answers
Related