I´m comparing the incidence in four different regions in order to see whether they are equal or not. First I fit a poisson model, but I´m uncertain as to how I can test the variance=mean assumption when I use an offset. Hence, I wanted to fit a negative binomial function and compare the two with a likelihood-ratio test. However, the glm.bn
function from MASS
throws an error. Any ideas what is wrong?
library(MASS)
b <- data.frame(
s=c(1800,539,490,301),
pop=c(2900000,1327000,880000,268000),
reg=c("A","B","C","D")
)
glm.nb(s~reg+offset(log(pop)),data=b)
results in
Error in while ((it <- it + 1) < limit && abs(del) > eps) { :
missing value where TRUE/FALSE needed