[R] error message for function: lmer (from lme4 package)

David Winsemius dwinsemius at comcast.net
Wed Nov 15 00:54:07 CET 2017


> On Nov 14, 2017, at 12:49 PM, Fix Ace <acefix at rocketmail.com> wrote:
> 
> Hi, David,
> 
> Thank you very much for getting back to me! Sorry about the messy code example. I am re-posting here (including the error message):
> 
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))
> > example.3
>     levels replicate conditions
> 1  43.1111         0         11
> 2  42.0942         1         11
> 3  57.8131         2         11
> 4  57.1726         3         11
> 5  77.8678         4         11
> 6  44.7578         5         11
> 7  69.5078         0         12
> 8  52.0581         1         12
> 9  40.0602         2         12
> 10 45.5487         3         12
> 11 43.6201         4         12
> 12 60.4939         5         12
> 13 64.1932         0         13
> 14 53.4055         1         13
> 15 59.6701         2         13
> 16 52.6922         3         13
> 17 53.8712         4         13
> 18 60.2770         5         13
> > m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)
> Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable

The error message seems fairly clear. The formula you have provided is asking for estimation of too many parameters. I think you probably want:

m.example.3=lmer(levels~conditions+(1|replicate),data=example.3)

... although your description of the hypothesis under test is ... non-existent.

-- 
David.
> > 
> 
> Please let me know if it is readable this time. 
> 
> Again, many thanks for your time and please help me fix the issue.
> 
> Kind regards,
> 
> Ace
> 
> 
> On Tuesday, November 14, 2017 12:19 PM, David Winsemius <dwinsemius at comcast.net> wrote:
> 
> 
> 
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help <r-help at r-project.org> wrote:
> > 
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am trying to fit my data for a linear mixed model using the lmer function from lme4 package to find the random effects of the replicates;
> 
> Better venue for this question might be SIG-mixed-models. See the link avaialble at the bottom of every posting from rhelp:
> 
> https://stat.ethz.ch/mailman/listinfo/r-help:
> 
> 
> 
> 
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))> example.3    levels replicate conditions1  43.1111        0         112  42.0942        1        113  57.8131        2        114  57.1726        3        115  77.8678        4        116  44.7578        5        117  69.5078        0        128  52.0581        1        129  40.0602        2        1210 45.5487        3        1211 43.6201        4        1212 60.4939        5        1213 64.1932        0        1314 53.4055        1        1315 59.6701        2        1316 52.6922        3        1317 53.8712        4        1318 60.2770        5        13> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error: number of observations (=18) <= number of random effects (=18) for term (conditions | replicate); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable> 
> > Could anyone help me figure out how to fix the issue? 
> > Thank you very much for any inputs!
> > Ace
> 
> > 
> >     [[alternative HTML version deleted]]
> 
> Complete mess. If you haven't yet been advised to posting in plain text, then this should be your wakeup call. If you have, then why are you ignoring sensible advice?
> 
> 
> > 
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
> David Winsemius
> Alameda, CA, USA
> 
> 'Any technology distinguishable from magic is insufficiently advanced.'  -Gehm's Corollary to Clarke's Third Law
> 
> 
> 
> 
> 
> 
> 

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law



More information about the R-help mailing list