[ADMB Users] glmmadmb in R

Ben Bolker bbolker at gmail.com
Thu Nov 10 13:37:13 PST 2011


On 11-11-10 04:01 PM, Christopher Smith wrote:
> Hello,
> 
> I am fairly new to R but am attempting to use GLMMs with neg. bin.
> distribution to analyze count data. (I have successful done this using
> glmer() and glm.nb() ). I am having trouble getting the function
> glmmabmb() to work, even for the example provided at:
> http://admb-project.org/examples/r-stuff/glmmadmb
> 
> I am getting the error,
> 
>> fit =
> glmmadmb(y~Base*trt+Age+Visit,random=~Visit,group="subject",data=epil2,family="nbinom")
> 
> Error in glmmadmb(y ~ Base * trt + Age + Visit, random = ~Visit, group =
> "subject",  :
>   unused argument(s) (group = "subject")
> 
> 
> And/or
> 
>> fit =
> glmmadmb(y~Base*trt+Age+Visit,random=~Visit,data=epil2,family="nbinom")
> Error in `colnames<-`(`*tmp*`, value = character(0)) :
>   attempt to set colnames on object with less than two dimensions
> 
> The second error is the same error I get when trying to use the function
> with my data.
> 
> E.g.,
> 
>> glmmadmb(ANAM~tmin+CWD,family="nbinom",random=~Day)
> Error in `colnames<-`(`*tmp*`, value = character(0)) :
>   attempt to set colnames on object with less than two dimensions
> 
> 
> I am on a Mac (OS X 10.5.8) running R (2.12- 32bit). Any advice?
>

  You need random=~1|Visit (or ~1|Day in your other example).  If I get
to it I will try to write code to detect this particular error and give
a more informative warning.

  the examples are out of date -- sorry, we will update.  If you are
using a recent (0.6.x) version of glmmADMB, then vignette("glmmADMB")
should get you better examples.

  Ben Bolker



More information about the Users mailing list