title: To specify Family id as random effect in GLMM or lme
body: <p>I am trying to fit generalized linear mixed model in R. I have big pedigree and genotype data. I tried this:</p>
  
  <pre><code>m1 &lt;- lmer(Final_sx~(1 | ID)+cohort2+cohort3+cohort4+sex,
             data=solar_new_phen,family=poisson)
  </code></pre>
  
  <p>And it gave me message:</p>
  
  <blockquote>
    <p>Number of levels of a grouping factor for the random effects is
    <em>equal</em> to n, the number of observations</p>
  </blockquote>
  
  <p>I have seen in most of tutorials people are using ID as clustering variable. In kinship package as well in lmekin function it is like this:</p>
  
  <pre><code>rand.eff=formula(paste("~1|",sub.ID))
  fit &lt;- try(lmekin(fixed=fix.eff,data=x,random = rand.eff,varlist=list(kmat)))
  </code></pre>
  
  <p>Should I be using individual id or family id as random effect? I am confused. I have pedigrees and I think I should be using Family ID as clustering variable. It would be great if someone can guide me with little explanation about random effects.</p>