Skip to content
Prev 11551 / 20628 Next

glmmADMB (mixed binomal random effects)

On 14-02-28 05:19 PM, Julian Chen wrote:
[cc'ing to r-sig-mixed-models]

  make sure that your grouping variable (Year) is a factor.

  Year is coded as numeric.  Your choices:

1. convert to a factor on the fly:
    Counts ~ Test1 + Test2 + (1|factor(Year)
2. convert to a factor in the data frame:
   dat <- transform(dat,Year=factor(Year))
3. make a new factor variable in the data frame:
   dat <- transform(dat,fYear=factor(Year))
   Counts ~ Test1 + Test2 + (1|fYear)

#1 is quickest but might be slightly less robust sometimes
#2 is robust but you might want to keep Year as numeric for other purposes
#3 keeps year as numeric and adds an additional factor version of the
variable