How to formulate the offset of a GLM I am trying to build a generalized linear model in R for some count data. Basically I have counted the number of animals per unit after having them presented with a treatment (for all units there was a 6 week exposure). That is, depending on treatment there could be more, fewer or the same number of animals after the treatment. Because the units had varying numbers of animals to begin with I could either use a proportion, or the actual counts after the treatment with the initial number of animals as an offset. I heard the last option is favorable. 
I have seen that for a Poisson model one adds the offset like this: offset(log(initial_no)). However I lean toward using a negative binomial model. Would one then set the link function of that in front of the offset? I have also seen offset(1|initial_no). When is this term used?
 A: I don't know where you heard that a Poisson or negative binomial with an offset is preferable to a binomial model for a number of individuals surviving out of an initial number; I would normally prefer a binomial as it is closer to the actual stochastic process we think is going on. Note that the binomial model would be a binomial GLM,
$$
n_{\textrm{surv}} \sim \textrm{Binomial}(p,N)
$$
— different from computing the proportion n/N and using a linear model (or something like that).
However, given that (the edited version of) the question allows for there to be more individuals at the end than at the beginning of the period, the binomial models (and variants such as quasi- or betabinomial) won't work, as they don't allow for an increase in numbers.
In a typical case (not yours) where individuals can only be lost and not gained, the Poisson or negative binomial models will only give sensible answers if the proportion surviving (or the proportion dying, if you quantify mortality rather than survival) is much smaller than 1. In general the variation in the number surviving becomes small as the survival probability approaches 1; the binomial model capture this phenomenon naturally, the Poisson / NB models don't.  (The variance becomes small in both models as the probability approaches 0.)
If you do want to use an offset-count model instead, the method for incorporating the offset doesn't differ between Poisson and NB models, both of which almost always use a log link.  That is, the model would be written as:
$$
\begin{split}
n_{\textrm{surv}} & \sim \textrm{Poisson}(\mu) \quad \textrm{or} \quad
\sim \textrm{NegBinom}(\mu,k) \\
\mu & = \exp(\beta + \log(N)) = N \exp(\beta)
\end{split}
$$
the second line could also be written as $\log(\mu) = \beta + \log(N)$ (which looks like the regression formula containing an offset) or $\mu/N = \exp(\beta)$, which shows that you're modeling $\beta$ as the log-proportion of survival. In the case where the numbers can increase, $\beta$ would be positive and would represent the log of the expected proportional increase in numbers.
If you happened to decide on an identity link instead (which I wouldn't usually recommend, as it's easy in that case for the optimization process to try negative values for the Poisson/NB mean, which might break the computation), then you'd use an offset of $N$ (not $\log(N)$) so that $\mu = \beta + N$, so $\beta$ represents the additive change in numbers. While sometimes computationally difficult, this does make conceptual sense ...
One possible advantage of the NB model would be that it accounts for overdispersion (e.g., among-individual variation in survival probability), which the binomial or Poisson models don't.  You could handle that in the binomial world by switching to a beta-binomial or to a quasi-binomial model ...
If you were using R, assuming your variables are n (surviving number), N (initial number), ttt (a factor/categorical variable specifying treatment group), you would use


*

*glm(n/N~ttt, family=binomial, weights=N) or

*glm(n/N~ttt, family=quasibinomial, weights=N) or

*glm(n~ttt+offset(log(N)), family=poisson) or

*MASS::glm.nb(n~ttt+offset(log(N)))
I've never seen a model with offset(1|initial_no) in it; what software was using this ... ?
