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

Lorenzo Quaglietta giaguarenzo at yahoo.it
Sun Jan 22 00:37:49 CET 2012


Ben Bolker <bbolker at ...> writes:

> 
> Lorenzo Quaglietta <giaguarenzo at ...> writes:
> 
> > 
> > Ben Bolker <bbolker at ...> writes:
> > 
> > >   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.
> > > 
> > 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.
> 
>   Can you be clearer about what you mean by "my random terms are not 
> categorical nor fitted as factors"?  Grouping terms in glmmADMB
> *must* be defined as factors (i.e. you must convert ANIMALE, ID,
> Time to factors).
>    I could have made glmmADMB make this conversion internally,
> but I thought it was better to make this the user's responsibility,
> so that if someone were doing something strange (like trying to
> use a continuous variable as a grouping factor, on the right side
> of the bar in (1|g)) it would be more immediately obvious.
> 
>   In general, it would be very helpful if you can include the
> version of glmmADMB in any query, as the package is evolving very
> quickly.  If you install the latest version (0.7.2.5) you should
> still get an error, but the error will be (slightly) more
> informative -- it will tell you that all grouping variables
> must be factors.
> 
>   Ben Bolker

Thank you very much. I've defined the random terms as factors and that error 
did not appear anymore.
However, I've encountered another message of error, which I copy here below 
(there's a very long series of codes of which I've copied only the last part 
and below the error):

Newton raphson 1   f = 344.5193892398689 max g = 2.123148492572113e-07
Newton raphson 2   f = 344.5193892398687 max g = 4.356515148629114e-13
 inner maxg = 0.0007671776212085923  Inner second time = 
0.0007671776212085923  Inner f = 344.5055506201622
 f = 344.5055506201622 max g = 0.0007671776212085923
Newton raphson 1   f = 344.505550121035 max g = 9.045343487557034e-07
Newton raphson 2   f = 344.5055501210349 max g = 7.366329768387914e-12
Warning -- Hessian does not appear to be positive definite
Error in run_bin(platform, bin_loc, file_name, cmdoptions, run, rm_binary = !
use_tmp_dir,  : 
  object "sys.result" not found
then: Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c "C:/Programmi/R/R-
2.14.1/library/glmmADMB/bin/windows32/glmmadmb.exe" -maxfn 500 -maxph 4 -
noinit -shess' had status 1 
2: In shell(cmd, invisible = TRUE) :
  '"C:/Programmi/R/R-2.14.1/library/glmmADMB/bin/windows32/glmmadmb.exe" -
maxfn 500 -maxph 4 -noinit -shess' execution failed with error code 1

I ignore what all this may means, so any help would be great.

glmmADMB version is 0.7.2.

Thanks in advance, best,

Lorenzo




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