Hmm, I'm not quite sure --- you seem to generally be on the right track. The below worked for me. If you're still having trouble, perhaps you could forward your code to me (either on list or privately)?
library(MplusAutomation)
# simulation stuff start
library(MASS)
set.seed(1234)
rmat.w <- matrix(.7, ncol = 3, nrow = 3)
diag(rmat.w) <- 1
rmat.b <- matrix(.4, ncol = 3, nrow = 3)
diag(rmat.b) <- 1
# 500 subjects
pop.b <- mvrnorm(n = 500, mu = c(0, 0, 0), Sigma = rmat.b)
# 20 observations each
pop.all <- do.call(rbind, lapply(1:nrow(pop.b), function(i) {
cbind(i, mvrnorm(n = 20, mu = c(0, 0, 0), Sigma = rmat.w) +
do.call(rbind, rep(list(pop.b[i, ]), 20)))
}))
colnames(pop.all) <- c("areas", "y1_a", "y2_a", "y3_a")
population <- as.data.frame(pop.all)
# simulation stuff end