Skip to main content
1 of 2
Ben Bolker
  • 47.3k
  • 3
  • 130
  • 182

Yes, that should work fine provided you have enough participants.

You could convince yourself (without math) by simulating some data from such an experimental design and showing that you can recover the correct effects (you do need to know a bit about how these models are parameterized). In particular, if you're using R and have loaded the lme4 package, you can use

simulate( ~ f1 + f2 + f3 + f4 + f5 + (f1 + f2 + f3 + f4 + f5 | subject),
          newdata = dd,   ## experimental design
          newparams = list(beta = <vector of 1 + 5*2 = 11 parameters>,
                           theta = <vector of 11*12/2 = 66 parameters>,
                           sigma = <residual SD value>),
          family = gaussian)

As written this will generate a list with a single element which is a vector of responses.

  • what's written above is the maximal model (ignoring the possibility of interactions among the factors), which will almost certainly not work unless you have a huge number of subjects [in order to parameterize the 11x11 random effects covariance matrix]. You will probably need to boil it down; you could make the covariance matrix diagonal (using afex::mixed or using glmmTMB with diag() or something) or reduced-rank (using glmmTMB with rr())
Ben Bolker
  • 47.3k
  • 3
  • 130
  • 182