0

How can I determine if a factor A is nested in B or B is nested in A in a repeated measures design? For example,

data <- data.frame(customer=rep(c("cus1","cus2","cus3","cus4","cus5","cus6"), each=3), brand=rep(c("A","B","C"),times=6), ratings=runif(18))

Brand is fixed and customer is the random effect. This is a crossed design I think because every customer rates the same brands. How would you determine which is the lower level, is it customer or brand?

In other words, should it be

Example 1    
       cus1     |     cus2
    A   B   C   |   A   B   C

or

Example 2
        A      |      B      |     C  
    cus1 cus2  |  cus1 cus2  | cus1 cus2
locus
  • 743
  • 4
  • 17
  • You say that it's a crossed design, and your data shows that too, since every customer rated every brand, so whence comes the confusion about a possible nested design? It is clearly a crossed design. – user2974951 Feb 19 '19 at 09:20
  • Thanks for the comment @user2974951. My confusion is to determine which is the lower level in a crossed design like the above? Is it `customer` (like `example 1`) or is it `brand` (like `example 2`)? For example in Robert's answer [here](https://stats.stackexchange.com/questions/228800/crossed-vs-nested-random-effects-how-do-they-differ-and-how-are-they-specified), there is an example of a crossed design where `class` is level 1 and `school` level 2 – locus Feb 19 '19 at 21:03
  • Talking about "lower" / "upper" levels is only relevant in a nested design, this does not matter in a crossed design, because there is no up or down. Read Robert's post again, the syntax he uses for a crossed design is `(1|school)+(1|class)`, as you can see these are not intertwined. – user2974951 Feb 20 '19 at 07:35

0 Answers0