[Q] Comparing Variance of Random Slopes Across Categorical Fixed Effect

When fitting a random slopes and intercepts model, what is an effective way to test whether the variance of the slopes is different at different levels of the fixed effect?

For example, image a dataset with a continuous response variable ‘y’, a three-level fixed effect variable ‘x’ and a single random effect ‘subject’. How would you test whether the subject’s x coefficients had higher variance at different ‘x’ levels? Some sort of bootstrapping procedure?

A follow up question: Imagine a scenario where the subject level slopes are segregated into two or more clusters at one level of the fixed effect. What would be the best way to model this?

See this picture of for one such scenario