[R-sig-ME] empty cell

Ben Bolker bolker at zoology.ufl.edu
Fri Aug 29 21:51:02 CEST 2008

Maria Eva Gongora wrote:
> I am using mixed effect models (library lmer) to evaluate factors that 

influence the catch rate of hake (set by set) in a fishery. I have some

empty cells when I include some of the interactions between the fixed

factors (e.g. year:area) and interactions between fixed and random effects

(e.g. year:vessel, where vessel is a random effect) . While empty cell were

not the problem when all factors were treated as fixed using lm or glm,

the estimation failed when I used lme4 and treated some of the factors
(the vessel id) as random.
> María Eva Góngora
> ______________________________________________

  I suspect that the problem is the empty fixed interactions,
rather than the empty random effects levels (interactions
between fixed and random effects are random by definition).

  When the fixed effects are this badly unbalanced,
lm and glm just go ahead and spit out NA for the
unestimable parameters, whereas lme4 is a little more

r = runif(200)
d2 = cbind(expand.grid(year=factor(1:2),site=factor(1:2),
## unbalance the data
d2 = subset(d2,!(site==2 & year==2))

lmer(val~site*year+(1|fac3),data=d2)  ## fails
lmer(val~site+year+(1|fac3),data=d2)  ## remove interaction -- succeeds
lmer(val~site+(year|fac3),data=d2)  ## treating year as random works too

  That said, it would be good to provide more detail as Doug Bates
suggests -- sometimes we're not very good at guessing what you mean ...

  good luck
   Ben Bolker

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