Skip to content

Simulating data with nested random effects

1 message · Wijeratne, Peter

#
Hi again,


For those who are interested, I figured this out - it's because there is no interaction between time and treatment in my simulated data, so the number of sites only affects the variance of the intercept, and not the treatment variance. Adding interaction random effects for 'time:treatment:site' and 'time:treatment:site:subject' when simulating data, and fitting with y ~ time + time:treatment + (1 + time | site/subject), produces the desired result.


Best,

Pete