Skip to main content
added 986 characters in body
Source Link
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())
  • it's quite common for people to use an intercept-only random effect (i.e. (1|subject), which would mean [if you were using sum-to-zero contrasts] that you would only allow the mean response to vary among individuals, not their responses to different factor levels. Technically, this model is incomplete if each subject experiences multiple levels of the different factors; in some cases this can lead to statistical problems (Schielzeth and Forstmeier 2009), but at the same time it's rarely practical to estimate all of the variation among subjects when there are many effects varying (as in this example), unless you're somehow regularizing the problem (e.g. with a factor-analytic/reduced-rank model or with informative priors in a Bayesian setting).

Schielzeth, Holger, and Wolfgang Forstmeier. “Conclusions beyond Support: Overconfident Estimates in Mixed Models.” Behavioral Ecology 20, no. 2 (March 1, 2009): 416–20. https://doi.org/10.1093/beheco/arn145.

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())

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())
  • it's quite common for people to use an intercept-only random effect (i.e. (1|subject), which would mean [if you were using sum-to-zero contrasts] that you would only allow the mean response to vary among individuals, not their responses to different factor levels. Technically, this model is incomplete if each subject experiences multiple levels of the different factors; in some cases this can lead to statistical problems (Schielzeth and Forstmeier 2009), but at the same time it's rarely practical to estimate all of the variation among subjects when there are many effects varying (as in this example), unless you're somehow regularizing the problem (e.g. with a factor-analytic/reduced-rank model or with informative priors in a Bayesian setting).

Schielzeth, Holger, and Wolfgang Forstmeier. “Conclusions beyond Support: Overconfident Estimates in Mixed Models.” Behavioral Ecology 20, no. 2 (March 1, 2009): 416–20. https://doi.org/10.1093/beheco/arn145.

Source Link
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())