COMPoisson family for underdispersed count data


New Member

I am trying to test whether the species richness of butterflies in a natural reserve differs betweeen habitats and years separately (not enough statistical replicates to make intercation). The monitoring of butterflies started in 2002. There is 3 different habitats : xerophytic and mesophytic calcareous grasslands and edge. My data looks like that (I take the example of generalists species):
1564134504251.png ...... unitl 2018

Normally i should use GLMM with Transects as random factor (paired data). Because of the poor transect number per habitats I can't. So my model is the following :

Call :

Deviance Residuals:
     Min        1Q    Median        3Q       Max 
-1.44563  -0.33385   0.01237   0.36883   1.18072 
    Null deviance: 108.922  on 169  degrees of freedom
Residual deviance:  45.301  on 144  degrees of freedom
AIC: 773.95

Number of Fisher Scoring iterations: 4
I observe underdispersion. I make the ratio between the Residual devience and degrees of freedom to check it : 45.301/144 = 0,31

So, i tried COMPoisson but standard glm function do not recognize this family.
I used fitme function from spaMM package.
> (a=fitme(Rgeneralists~Habitats/Transects+Years,data=abvalb,family=COMPoisson()))
formula: RL1 ~ Habitats/Transects + Years
Estimation of fixed effects by ML.
Estimation of COMP_nu by 'outer' ML, maximizing p_v.
Family: COMPoisson(nu=3.979) ( link = loglambda )
 ------------- Likelihood values  -------------
p(h)   (Likelihood): -309.1393
I also tried glm.cmp function but i really don't understand what are the type of argument that should be used.

Do someone already used COMPoisson ?

Thanks a lot !