How to avoid large number of unused random variables in hierarchical regression with 3 levels

600 random variables flying around that serve absolutely no purpose at all

Could you elaborate on why this happens in your model?

Thanks, yes of course!

The hierarchy is Smoker > PatientID.

There are 3 Smoker types but each of the Smoker types has unequal numbers of Patients. There are ca. 100 Non-Smokers, 50 Ex-Smokers and 10 current smokers.

In the current implementation, the width of the plate needs to be the number of patients in the largest smoker type. And as a result, there are latent variables for 50 Ex-Smoker and 90 current smoker patients sampled that don’t exist at all.

Does that explanation make sense?

In the first post, the inner plate was 170 wide, which was even more wasteful than in the second post where the inner plate is now 100 wide, the width of the largest group.

For modeling, I would recommend reparameterizing your model (like this one).

Do you mean using non-centred parametrization? I don’t yet know how to do this, will try to figure out, but it’s not the core issue here in this thread, unless I misunderstood you.