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

Lorenzo Quaglietta giaguarenzo at yahoo.it
Tue Jan 17 00:46:59 CET 2012


Ben Bolker <bbolker at ...> writes:

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

Hi,

I'm having  a similar problem.

My model formula is:

glmmADMB1 <- glmmadmb(Fix ~ log_BIO_F * log_BIO_P + log_drs + fperp + log_pr +
log_la + (1 | ANIMALE) + (1 | ID) + (1 | Time), data=otters, zeroInflation=TRUE,
family="poisson").

and I got the following error message:

"Error in UseMethod("droplevels") : 
  no applicable method for 'droplevels' applied to an object of class
"c('integer', 'numeric')".

My random terms are not categorical nor fitted as factors. Covariates are
continous (the log_ ones) and a factor (fperp). Any clue about what can be the
problem would be very appreciated.

Many thanks in advance, best regards,

Lorenzo Quaglietta




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