<br><br><div class="gmail_quote">On Jan 14, 2008 10:07 AM, Jonathan Berant &lt;<a href="mailto:yonatansito@gmail.com">yonatansito@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><br><br><br><br><br><br>Dear list,<br><br>I am trying to fit a model using lmer()<br>I have the 2 usual random factors:<br>1. subjects<br>2. items<br>However the items are divided into 3 groups and so I actually have -
<br>15 items randomly sampled from group 1<br>15 items randomly sampled from group 2<br>15 items randomly sampled from group 3.<br><br>So the items are nested in a fixed factor called &#39;cond&#39; (with 3 ordered levels).
<br>I am not sure what is the syntax for fitting such a model<br><br>the dependent variable is &#39;expScore&#39; and the predictors are &#39;sex&#39;<br>(between subject factor with 2 levels), &#39;relig&#39; (between subject
<br>factor with 2 levels) and &#39;cond&#39; (within subject factor with 3 levels<br>&nbsp;within which the items are nested)<br><br>I tried doing:<br>lmerA = lmer(expScore~(relig+sex+cond)^2+(1|subjId) + (1|itemId),<br>data=religData)
<br><br>however when I run: ranef(lmerA)<br><br>I see that lmer doesn&#39;t deal with that since there are only 15 numbers<br>for the item random effect when in fact there are 45 items.<br><br>So how do I specify that items is a random factor nested in a fixed factor?
<br>Thanks!</blockquote><div><br>why don&#39;t you recode your item effect as <br><br>religData$realItemId &lt;- as.factor(paste(as.character(religData$item), as.character(religData$cond)))<br><br>and then run <br><br>lmerA = lmer(expScore~(relig+sex+cond) ^2+(1|subjId) + (1|realItemId) data=religData)
<br><br>not assuming any nesting? That should work, right?<br><br>Florian<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br><br><br>_______________________________________________<br>R-lang mailing list<br><a href="mailto:R-lang@ling.ucsd.edu">R-lang@ling.ucsd.edu</a><br><a href="http://pidgin.ucsd.edu/mailman/listinfo/r-lang" target="_blank">
http://pidgin.ucsd.edu/mailman/listinfo/r-lang</a><br></blockquote></div><br>