Interpretation of colon : and slash / for group level effects

I’m having trouble understanding what kind of data and analyses the colon : and slash / operators would be used for. They’re briefly discussed in the multilevel modeling vignette/PDF:

Multiple grouping factors each with multiple group-level effects are possible. Usually, group contains only a single variable name pointing to a factor, but users may also use g1:g2 or g1/g2 if both g1 and g2 are suitable grouping factors. The : operator creates a new grouping factor that consists of the combined levels of g1 and g2. The / operator indicates nested grouping structures and expands one grouping factor into two or more when using multiple / within one term. For instance, if the user were to write (1 | g1/g2), brms will expand this to (1 | g1) + (1 | g1:g2).

What’s an example of data & an analysis goal where we would want to use (1 | g1:g2) instead of (1 | g1 + g2)?

What about when we would want to use (1 | g1/g2) instead of (1 | g1:g2) or just (1 | g1 + g2)?

If you make your levels of g2 unique across the levels of g1 (e.g., only one student with index 1 across all classes), anyway, there is no reason to use : or /.

Hi Paul,

So if I had classes where students had labels like

class1: student1, student2

class2: student1, student2

Then I could use g1:g2 to group the 4 students together, giving them each a unique label. That makes sense.

That helps me understand g1/g2 also now. If g1 is the group of classes, then using (1 | g1/g2) models variation among classes as well as among the 4 students.

If our data had come to us (or we put it into the form) with each student given a unique ID number, say like

response    studentID    class
68          1234         1
72          5678         1
89          2468         2
51          1357         2

Then (1 | g1/g2) in the earlier labeling scheme would be equivalent to (1 | g1 + g2) now.

Cheers

Correct.