title: Recurring error using lmer() function for a linear mixed-effects model
body: <p>I attempted to construct a linear mixed effects model using <code>lmer</code> function from <code>lme4</code> package and I ran into a recurring error.  The model uses two fixed effects: </p>
  
  <ul>
  <li><code>DBS_Electrode</code> (factor w/3 levels) and </li>
  <li><code>PostOp_ICA</code> (continuous variable).  </li>
  </ul>
  
  <p>I use <code>(1 | Subject)</code> as a random effect term in which <code>Subject</code> is a factor of 38 levels (38 total subjects). Below is the line of code I attempted to run:</p>
  
  <pre><code>LMM.DBS &lt;- lmer(Distal_Lead_Migration ~ DBS_Electrode + PostOp_ICA + (1 | Subject), data = DBS)
  </code></pre>
  
  <p>I recieved the following error:</p>
  
  <blockquote>
    <p>Number of levels of each grouping factor must be &lt; number of observations.</p>
  </blockquote>
  
  <p>I would appreciate any help, I have tried to navigate this issue myself and have been unsuccessful.</p>