There are a couple of examples on the help page for the function "simfun"
in the TeachingDemos package that simulate data for a multilevel example.
 Scroll down to the section that starts "# simulate a nested mixed effects
model".  You can use the ideas in the example even if you don't use the
simfun function.



On Fri, Jul 5, 2013 at 10:03 AM, Stuart Luppescu <slu@ccsr.uchicago.edu>wrote:

> Hello, I'm trying to simulate a multilevel dataset representing teachers
> within schools. To generate the data I'm using parameters from actual
> data. I have the means, variances and covariances of teachers on two
> variables; and the means, variances and covariances of the school-level
> means for those two variables. I can generate the teacher-level data,
> and the school-level data using rmvnorm() with no problem, but what I
> can't figure out is how to generate teacher-level data conditional on
> the school-level generated data.
>
> Can anyone give me a clue?
>
> TIA.
> --
> Stuart Luppescu <slu@ccsr.uchicago.edu>
> University of Chicago
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Gregory (Greg) L. Snow Ph.D.
538280@gmail.com

	[[alternative HTML version deleted]]

