Skip to content
Prev 7764 / 20628 Next

modelling proportions, with aggregated data, and the new/old lme4

Joerg,

What is the point in the Poisson model in that way (assuming
log(total) as offset)? This would be a binomial model; if you observe
N events from a Poisson distribution of which X are successes (or
marked in some way) with probability p, then X will be binomial(p, N).

Best regards,
Fredrik Nilsson

PS. Here's a practical "proof", the real is sketched below.
invlogit<-function(x) exp(x)/(1+exp(x))
n<-10
nn<-ceiling(exp(rnorm(n)+3))
pp<-seq(0.25,.75,length=n)
ca<-rbinom(rep(1,n),nn,prob=pp)
co<-nn-ca
fa<-gl(n,1)

#binomial model
test.glm<-glm(cbind(ca,co)~fa-1, family=binomial)
#conditional poisson
ptest.glm<-glm(ca~fa-1+offset(log(nn)), family=poisson)
summary(ptest.glm)
exp(coef(ptest.glm))
invlogit(coef(test.glm))

all.equal(exp(coef(ptest.glm)), invlogit(coef(test.glm)))

# proof.
X~Poisson(a) and  Y~Poisson(b), X & Y independent -> X+Y~Poisson(a+b)
(e.g. by generating functions).

Prob(X=x| X+Y=n) = Prob(X=x, Y=n-x)/Prob(X+Y=n) =
Prob(X=x)*Prob(Y=n-x)/Prob(X+Y=n) = a^x/x! exp(a) b^(n-x)/(n-x)!
exp(b) /((a+b)^n/n! exp(a+b)) =
n!/x!/(n-x)! (a/(a+b))^x (b/(a+b))^(n-x) = n!/x!/(n-x)! (a/(a+b))^x
(1-a/(a+b))^(n-x) , i.e. binomial(x,n,p) with p=a/(a+b).


2012/3/19 Ben Bolker <bbolker at gmail.com>: