[R] lmer - error message
Ben Bolker
bbolker at gmail.com
Fri Feb 17 14:34:51 CET 2012
Sean Godwin <sean.godwin <at> gmail.com> writes:
>
> Hi all,
>
> I am fairly new to mixed effects models and lmer, so bear with me.
>
> Here is a subset of my data, which includes a binary variable (lake (TOM or
> JAN)), one other fixed factor (Age) and a random factor (Year).
> lake FishID Age Increment Year
> 1 TOM 1 1 0.304 2007
> 2 TOM 1 2 0.148 2008
> 3 TOM 1 3 0.119 2009
> 4 TOM 1 4 0.053 2010
> 5 JAN 2 1 0.352 2009
> 6 JAN 2 2 0.118 2010
>
> The model I'm trying to fit is:
> m1 <- lmer(Increment ~ 0 + Age + Age*lake + (1|Year) + (1|Year:Age) +
> (1|FishID),lakedata)
>
> The error message I get is: *"Error in mer_finalize(ans) : Downdated X'X is
> not positive definite, 27."*
> *
> *
> >From reading up on the subject, I think my problem is that I can't
> incorporate the 'lake' variable in a fixed-effect interaction because it is
> only has one binary observation. But I don't know what to do to be able to
> fit this model. Any help would be greatly appreciated!
> -Sean
In principle you should be able to fit this model, but the error message
is telling you that there are numeric problems -- it may just be that
your data are a little too sparse in some direction. A few suggestions:
* try centering Age, or re-introducing the intercept, to see if you
can get something to work.
* You _might_ try the development version of lme4 (lme4Eigen, on r-forge)
* plot your data to see if you see anything odd about the data
* perhaps try making Year a fixed effect -- 4 levels is fairly small
for a random effect
* Ask further questions on the r-sig-mixed-models mailing list.
Ben Bolker
More information about the R-help
mailing list