I am trying to create a simulation for a power analysis with a mixed effect model.

Each participant will be tested on four different variables. The data for these variables should be related, i.e. if they do well in A, they will probably do well in B, C and D and the same if they do badly.

How can I generate random effects in the simulation - subject-level variance in the randomly-generated scores?

  • $\begingroup$ one way to do this is to create a "melted" (long-format) version of the data, then simulate with a correlated random effect. Start here: rpubs.com/bbolker/3336 - but unfortunately specifying the correlations is a bit harder for a 4-variable response. $\endgroup$ – Ben Bolker Jul 8 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.