[R-sig-ME] glmmADMB: Error in UseMethod("droplevels")

Ben Bolker bbolker at gmail.com
Thu Jan 12 17:42:59 CET 2012


Isa Blasco <isa.blasco.costa at ...> writes:

> 
> Hi,
> I am using glmmADMB to fit a negative binomial model to my data. My
> explanatory variable is an ordered factor with 10 levels and I also
> included a random factor (numeric) and Zero inflation.
> This is the code I used: m7 <- glmmadmb (abun~odist + (1|sl), data=apa,
> zeroInflation=TRUE, family="nbinom")
> 
> When I run it I got this error:
> Error in UseMethod("droplevels") :
>   no applicable method for 'droplevels' applied to an object of class
> "c('double', 'numeric')"
> 
> I do not know what the 'double' means but I checked the glmmADMB manual and
> they use the same kind of variables in their example. Any guess on what it
> is happening? How can I solve it?
> I hope somebody knows!

  It means that it doesn't make sense to use a numeric variable as
a grouping variable for a random factor (which is what you've done):
if sl is a discrete numeric code that identifies groups of observations,
then you should convert it to a factor.  If it's a continuous variable,
then you need to go back and read/think some more about the meanings
of random factors ...

  It also means that I made some changes to glmmADMB recently that
got in the way of an informative error message (you should have
received an error message that told you this).  I will try to 
catch that error in a more informative way.

  Ben Bolker




More information about the R-sig-mixed-models mailing list