[R] error message for function: lmer (from lme4 package)
Fix Ace
acefix at rocketmail.com
Tue Nov 14 14:13:19 CET 2017
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; 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]]
More information about the R-help
mailing list