I´m trying to find a glmm
, which is convergent with an interaction between my categorical and nummeric variable. My experiment consists of different plot types (A, B, C & D), which were mapped in the years 0, 1, 2 & 3.
Now I want to know how different the number of species were between the respective plot types and the years. Therefore I wanted to create a glmm with the function glmmTMB
. Unfortunately, my ideal model with the precipitation and the temperature (of the year when the plot was mapped) as additional correlated fixed effects didn't work. As random effect I used the different sites of the plots.
I already tried different families, different combinations of random effects with different hierarchies and adding other fixed effects like the crop on the site, the adjacent habitat and more. In addition I tried to use glmer
and lmer
instead, but none of my models had a convergent solution without an error meassage with the interaction of my variables.
I also tried to include the year in the plot type variable (A_0, A_1, A_2, A_3, B_0,... ). With this my model worked and I also got the significances I needed. Is this possible to do or does this generate wrong significances or correlations?
My ideal model, which is not convergent so far, is:
glmmTMB(Number_of_species ~ Year_of_Implementation * Plot_type + Precipitation * Temperature + (1|site), family = binom1, data= example)
This gives me the error message:
50 warnings or more (21: In f(par, order = order, ...): value out of range in 'lgamma') I also got often the error: Warning messages: 1: In nlminb(start = par, objective = fn, gradient = gr, control = control$optCtrl) : NA/NaN function evaluation 2: In nlminb(start = par, objective = fn, gradient = gr, control = control$optCtrl) : NA/NaN function evaluation 3: In fitTMB(TMBStruc) : Model convergence problem; non-positive-definite Hessian matrix. See vignette('troubleshooting')
My aim is to get significances for a plot showing the development for each plot type in each year.