[R] Please help a struggling student with data set-up for lmer crossed random effects

Ista Zahn istazahn at gmail.com
Wed Oct 17 22:47:08 CEST 2012


Hi,

On Wed, Oct 17, 2012 at 3:25 PM, Ralitt <Ralitt at gmail.com> wrote:
> Hi all,
> I am just starting my first models in R and am having trouble with some of
> the basics.
>
> The main things at the moment are about setting up my data correctly.  I
> have a repeated measures design-all participants complete 4 experimental
> conditions. I want to fit a linear mixed effects model with crossed random
> effects for subject and item. I have 4 conditions, 6 items per condition.
> Because each condition uses different items, there are 24 total items. Each
> group of 6 items only occurs in 1 condition, and it occurs in the same
> condition for all participants. I am interested in including item as a
> random effect in my model. My question is about labelling the items
> correctly-should I label them 1-24, or 1-6 for each condition? I'm afraid if
> I label 1-6 for each condition it will think item 1 was the same item and
> was repeated in each of the four conditions. But if I label it 1-24 it will
> look as though 18 of the items are missing in each condition as 6 can only
> occur in any one condition.

Well, if I understand correctly that actually is the case (that 18
items are "missing" in each condition")

So, should I have my data like this:
> subject item            condition
> 1               1               1
> 1               2               1
> 1               3               1
> 1               4               1
> 1               5               1
> 1               6               1
> 1               1               2
> 1               2               2
> 1               3               2
> 1               4               2
> 1               5               2
> 1               6               2
> 1               1               3
> 1               2               3
> 1               3               3
> 1               4               3
> 1               5               3
> 1               6               3
> 1               1               4
> 1               2               4
> 1               3               4
> 1               4               4
> 1               5               4
> 1               6               4
>
> or like this:
>
> subject item            condition
> 1               1               1
> 1               2               1
> 1               3               1
> 1               4               1
> 1               5               1
> 1               6               1
> 1               7               2
> 1               8               2
> 1               9               2
> 1               10              2
> 1               11              2
> 1               12              2
> 1               13              3
> 1               14              3
> 1               15              3
> 1               16              3
> 1               17              3
> 1               18              3
> 1               19              4
> 1               20              4
> 1               21              4
> 1               22              4
> 1               23              4
> 1               24              4

The second way.

Best,
Ista
> Sorry for the basic question, but I can't seem to figure this out!
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Please-help-a-struggling-student-with-data-set-up-for-lmer-crossed-random-effects-tp4646501.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list