Multiple-membership models with lme4
Dear Sijia, The error message seems clear to me. The number of random effect levels must be less than the number of observations. Otherwise the can't distinct between the random effect and the residual. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkelinx at inbo.be Havenlaan 88 bus 73, 1000 Brussel www.inbo.be /////////////////////////////////////////////////////////////////////////////////////////// To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey /////////////////////////////////////////////////////////////////////////////////////////// <https://www.inbo.be> Op ma 18 mei 2020 om 07:32 schreef Sijia Huang <huangsjcc at gmail.com>:
Hi everyone, I am working on estimating multiple membership models with lme4, following the instructions posted here https://bbolker.github.io/mixedmodels-misc/notes/multimember.html Below is my code, in which J2 is the number of clusters (in my case, the clusters are clique-2s, and J2=1345) and N is the number of participants (N=968). These participants belong to 0 to 11 of the clique-2s. I got the below error. Could anyone help? Thanks!
fake2 <- rep(1:J2, length.out=N) lmod <- lFormula(formula=y~1+(1|fake2), data=data)
Error: number of levels of each grouping factor must be < number of
observations
Best,
Sijia
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models