On Jan 14, 2008 10:07 AM, Jonathan Berant <[EMAIL PROTECTED]> wrote: > > > > > > > > > Dear list, > > I am trying to fit a model using lmer() > I have the 2 usual random factors: > 1. subjects > 2. items > However the items are divided into 3 groups and so I actually have - > 15 items randomly sampled from group 1 > 15 items randomly sampled from group 2 > 15 items randomly sampled from group 3. > > So the items are nested in a fixed factor called 'cond' (with 3 ordered > levels). > I am not sure what is the syntax for fitting such a model > > the dependent variable is 'expScore' and the predictors are 'sex' > (between subject factor with 2 levels), 'relig' (between subject > factor with 2 levels) and 'cond' (within subject factor with 3 levels > within which the items are nested) > > I tried doing: > lmerA = lmer(expScore~(relig+sex+cond)^2+(1|subjId) + (1|itemId), > data=religData) > > however when I run: ranef(lmerA) > > I see that lmer doesn't deal with that since there are only 15 numbers > for the item random effect when in fact there are 45 items. > > So how do I specify that items is a random factor nested in a fixed > factor? > Thanks!
why don't you recode your item effect as religData$realItemId <- as.factor(paste(as.character(religData$item), as.character(religData$cond))) and then run lmerA = lmer(expScore~(relig+sex+cond) ^2+(1|subjId) + (1|realItemId) data=religData) not assuming any nesting? That should work, right? Florian > > > > _______________________________________________ > R-lang mailing list > [email protected] > http://pidgin.ucsd.edu/mailman/listinfo/r-lang >
_______________________________________________ R-lang mailing list [email protected] http://pidgin.ucsd.edu/mailman/listinfo/r-lang
