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):

...... 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 :

Code:

```
Call :
rg<-glm(Rgeneralists~Habitats/Transects+Years,data=abvalb,family=poisson(link="log"))
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
```

So, i tried COMPoisson but standard glm function do not recognize this family.

I used fitme function from spaMM package.

Code:

```
> (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 -------------
logLik
p(h) (Likelihood): -309.1393
```

Do someone already used COMPoisson ?

Thanks a lot !