title: How to fit two random effects separately in lme?
body: <p>I'm doing Linear mixed-effects model fit by REML in nlme package. And these are codes that work for me:</p>
  
  <pre><code># Linear mixed-effects model fit by REML (intercept and not slope)
  x &lt;- lme (DV ~ IV1 + IV2 + IV1*IV2, data=a.frame, random=~1|speaker)
  summary(x)
  
  # Linear mixed-effects model fit by REML (slope and no intercept)
  x1 &lt;- lme (DV ~ IV1 + IV2 + IV1*IV2, data=a.frame, random=~IV3-1|speaker)
  summary(x1)
  
  # Linear mixed-effects model fit by REML (slope and intercept)
  x2 &lt;- lme (DV ~ IV1 + IV2 + IV1*IV2, data=a.frame, random=~IV3|speaker)
  summary(x2)
  
  #nested random effect
  x5 &lt;- lme (DV ~ IV1 + IV2 + IV1*IV2, data=a.frame, random=~1|speaker/item)
  summary(x5)
  </code></pre>
  
  <p>What I really would like to do is having a model with both speaker and item as random effects separately. I had tried to use this formula:</p>
  
  <pre><code>x4 &lt;- lme (DV ~ IV1 + IV2 + IV1*IV2, data=a.frame, random=~1|speaker + 1|item)
  </code></pre>
  
  <p>However, this formula gives me the following warning message:</p>
  
  <pre><code>Warning message:
  In Ops.factor(speaker, 1) : + not meaningful for factors
  </code></pre>
  
  <p>Do you have any idea what this means? And how can I fit both speaker and item as random effects separately?</p>