Marta Lomas
2013-Aug-09 10:58 UTC
[R] errors with hurdle negative binomial mixed effect models
Hello! I am new in the mailing list for R help and I hope to be able to formulate a good question easy to understand. After trying to do many different things to solve an error I do not find the solution. I am modeling my data set with hurdle negative binomial mixed effects, to find the correlation of some bird counts with environmental (categorical and continuous) variables. When I run different models I have always an error. For instance: -For the truncated modeling of the non-zero counts:> HURgvgsw <- glmmadmb(count~ GVG*sward + (1|week), data=subset(SW_GVG,count>0), + family= "truncnbinom")Error en glmmadmb(count ~ GVG * sward + (1 | week), data = subset(SW_GVG, : rank of X = 6 < ncol(X) = 10 -Or the binomial part where the zeros are modeled with the non-zeros:> HURgvgsw <- glmmadmb(count~ sward*GVG + (1|week) + (1|cluster), data=SW_GVG, family= "binomial")Error en glmmadmb(count ~ sward * GVG + (1 | week) + (1 | cluster), data = SW_GVG, : rank of X = 13 < ncol(X) = 15 Would you have the solution to this? When I run the model with many variables I also have that error. So what I have been done so far is to split the model in to two differentiated by smaller set of variables as follows so I do not get that error. I do not think this is the solution though:> hnb6 <- glmmadmb(count~ Year * (dist + sward + inject + fresh + veg) + (1|week), data=subset(newdata_,count>0), family= "truncnbinom")Error en glmmadmb(count ~ Year * (dist + sward + inject + fresh + veg) + : rank of X = 22 < ncol(X) = 24 However this model works (taking off one variable):> hnb6 <- glmmadmb(count~ Year * (dist + sward + inject + veg) + (1|week), data=subset(newdata_,count>0),+ family= "truncnbinom") The same with no variable interactions (controling for week, nested in Year):> hnb6 <- glmmadmb(count~ dist + sward + inject + fresh + veg + (1|Year/week), data=subset(newdata_,count>0),+ family= "truncnbinom") Error en glmmadmb(count ~ dist + sward + inject + fresh + veg + (1 | Year/week), : rank of X = 11 < ncol(X) = 12 When I do the binomial part of the model above, I get another error very frequent as well:> hnb6 <- glmmadmb(count~ dist + sward + inject + fresh + veg + (1|Year) + (1|week), data=newdata_,+ family= "binomial") Parameters were estimated, but not standard errors were not: the most likely problem is that the curvature at MLE was zero or negative Error en glmmadmb(count ~ dist + sward + inject + fresh + veg + (1 | Year) + : The function maximizer failed (couldn't find STD file) Troubleshooting steps include (1) run with 'save.dir' set and inspect output files; (2) change run parameters: see '?admbControl' Además: Mensajes de aviso perdidos comando ejecutado 'C:\Windows\system32\cmd.exe /c "C:/Users/Marta/Documents/R/win-library/2.15/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess' tiene estatus 1 I hope it is easy to understand and you could help me with it. Thanks a lot!! [[alternative HTML version deleted]]
Ben Bolker
2013-Aug-09 17:07 UTC
[R] errors with hurdle negative binomial mixed effect models
Marta Lomas <lomasvega <at> hotmail.com> writes:> > Hello!> I am new in the mailing list for R help and I hope to be able to > formulate a good question easy to understand.We hope so too :-) [snip] I will take a first crack at this here, but follow-ups should probably be redirected to the r-sig-mixed-models at r-project.org mailing list, which is more appropriate for questions dealing with (G)LMMs.> I am modeling my data set with hurdle negative binomial mixed > effects, to find the correlation of some bird counts with > environmental (categorical and continuous) variables.> When I run different models I have always an error. For instance: > > -For the truncated modeling of the non-zero counts: > > > HURgvgsw <- glmmadmb(count~ GVG*sward + (1|week), > data=subset(SW_GVG,count>0), + family> "truncnbinom") > > Error en glmmadmb(count ~ GVG * sward + (1 | week), data = subset(SW_GVG, : > rank of X = 6 < ncol(X) = 10 > > -Or the binomial part where the zeros are modeled with the non-zeros: > > > HURgvgsw <- glmmadmb(count~ sward*GVG + (1|week) + (1|cluster), > data=SW_GVG, family= "binomial") > > Error en glmmadmb(count ~ sward * GVG + (1 | week) + > (1 | cluster), data = SW_GVG, : > rank of X = 13 < ncol(X) = 15 > > Would you have the solution to this?This error message is telling you that some of your fixed-effect variables (which are, internally, combined into the fixed-effect design matrix X) are perfectly multicollinear. This is most likely happening because sward and GVG are categorical variables (or at least are being treated as categorical variables) and some combinations are missing from the data set (for future reference: the output of summary(SW_GVG) is useful for diagnosis). For more information, search http://glmm.wikidot.com/faq for the word 'rank' Good luck Ben Bolker