Multiple membership multilevel model - clarification questions

I am setting up a simulation study for a multiple membership multilevel model with a binary outcome. I am getting quite different results (parameter estimates, credible intervals, and most notably ESS) when I compare it to another program I previously used. I would MUCH rather use brms, and therefore I have a few questions in relation to this:

Firstly, I was hoping I might double check I am specifying my model correctly with brms to make sure it’s not a stupid error on my part.

My model:

fit_mm3 <- brm(Y|trials(1) ~ 1 + lev_1 + tot_lev_2 +
                (1 | mm(school1, school2, school3, school4, school5)),
              data = d,
              family = binomial()
)

What I think I am specifying with the above is fixed effects (not allowing slopes to vary) for a unit-level predictor (lev_1) and a cluster-level predictor (tot_lev_2), using school1-5 as the grouping variable. tot_lev_2 is a weighted average across group memberships (e.g. 0.5*(school1 lev_2) + 0.5*(school1 lev_2)).
Weights are equal, therefore I am not separately specifying weights.

I’m also not certain what mmc would specify - from what I gather, it might be random effects? I looked in the documentation, but am still confused. I would appreciate any further guidance.

As one last question: from my literature review, it does not seem that the ICC is something that is specified in this type of model (as compared to a more ‘standard’ MLM), given the complexity of calculating it. Would that be correct thinking?

I will freely admit that simulating this level of complexity is new to me, as is a Bayesian approach. I would greatly appreciate any and all guidance and resources that you feel led to provide.

1 Like

Some things to consider:

  1. Your 5-slot system. Is your dummy coding of multi-membership what brms expects?
s1 s2 s3 s4 s5
 1  2  3  4  5 # five different schools for this subject
 2  2  4  4  4 # two for this
 5  5  1  3  3 # three

this hopefully also explains why, if your dummy coding is right, you would need weights: for example, for the second subject you would need something like c(.5/2,.5/2,.5/3,.5/3,.5/3) for equal participation in the two schools.

  1. Your tot_lev_2 should be a weighted average based on the above scheme. Therefore mmc(lev2_s1, lev2_s2, lev2_s3, lev2_s4, lev2_s5) should have the slot specific value of that predictor.

full disclosure: I have not used mmc() and before I read your post I had found the example in ?mmc() inscrutable.

@amynang could you explain a bit why you did c(.5/2,.5/2,.5/3,.5/3,.5/3)? I have been using equal weights, so for the second subject in your example, I would have 0.2 + 0.2 for school 2 and 0.2*3 for school 4 - representing a greater influence of school 4 than school 2. I had not considered your weighting system.

Does that mean you want a greater weight for school 4 or you’re saying you’d get one with my approach?

round(c(.5/2,.5/2,.5/3,.5/3,.5/3),2)
[1] 0.25 0.25 0.17 0.17 0.17

The weights for school 2 sum to .5 and so do the weights for school 4.

I think what is confusing here is the combination of odd number of slots for even membership, or vise versa. Odd-odd or even-even is straightforward:

for [1,1,2,2], c(1,1,1,1) gives you equal weights , c(1,1,2,2) gives school 2 twice the influence. same for [1,2,3], c(1,1,2) gives the third school twice the influence of the other two. But for [1,1,2], I think you need to split the weight for school one to respect the dummy coding: c(.5,.5,1) for equal weights or c(.5,.5,2) for school 2 having twice the influence of 1.

EDIT: I am wrong!
Have a look at this

EDIT: Saw your edit! Checking that out now, keeping this up to avoid a dirty-delete.

Let me see if I can explain better. Using your example:

I am using equal weights. So, if I added weight columns, they’d look like so:

s1 s2 s3 s4 s5  w1  w2  w3  w4  w5
 1  2  3  4  5 0.2 0.2 0.2 0.2 0.2
 2  2  4  4  4 0.2 0.2 0.2 0.2 0.2
 5  5  1  3  3 0.2 0.2 0.2 0.2 0.2

I have the five groups, because that is the max possible encounters (as in subject 1). But, for subject 2, where they have 2 encounters with school 2 and 3 encounters with school 4, I don’t know why I would want them each weighted as 0.5. I am thinking I want school 2 weighted 0.4 and school 4 weighted 0.6, to sum to 1.

If I am wrong in this line of thought, I would love to learn more about the thought process behind weighting each one in such a way that school 2 sums to 0.5 and school 4 sums to 0.5.

Your linked post helped a lot, thank you! I will need to play with having zeros vs. repeated encounters and the corresponding weights to see how that affects things.