I get an error term when introducing a second level random slope in a three-level model (individuals in region-survey waves in regions - a repeated cross-sectional survey):
"
compositional2 <- mix(Y ~ X + wave + X_region_wave_average + X_region_average + (1 + X |region_wave) + (1 |region), data = x.demeaned, weights = c("w_method_A","w_higher_level","w_higher_level"))
Error in [<-(*tmp*, row_index, col_index, value = v_lev[vi]) :
subscript out of bounds
"
However, when I add the random slope to a higher level, it works fine:
So, I suppose the problem should not be in my variables. Btw, the w_higher_level = rep(1, nrow(x.demeaned)) to account for certain sampling of region-waves and regions.
I get an error term when introducing a second level random slope in a three-level model (individuals in region-survey waves in regions - a repeated cross-sectional survey):
"
However, when I add the random slope to a higher level, it works fine:
"
So, I suppose the problem should not be in my variables. Btw, the w_higher_level = rep(1, nrow(x.demeaned)) to account for certain sampling of region-waves and regions.