I performed an experiment where I raised different families coming from two different source populations, where each family was split up into a different treatments. After the experiment I measured several traits on each individual. Now I would like to have an overall and hence multivariate statistic that tests for an effect of either treatment or source as well as their interaction but correcting for family effects.

So, basically I would like to perform a MANOVA with a random effect, which would translate to something like this:


However, the standard R MANOVA function does not support random effects and I was unable to find another function that would do the trick. So I would like to ask if anyone has a suggestion that may help.


  • $\begingroup$ I think you want either the lme4 or the nlme package $\endgroup$ – Peter Flom Mar 17 '13 at 11:42
  • $\begingroup$ I use both packages to analyze especially univariate contrasts. How would you implement then a multivariate scenario? $\endgroup$ – KL_STKBK Mar 18 '13 at 16:34
  • $\begingroup$ I am not expert in either of these... Others here may know. $\endgroup$ – Peter Flom Mar 18 '13 at 17:28
  • $\begingroup$ check rpubs.com/bbolker/3336 $\endgroup$ – Ben Bolker Oct 18 '14 at 22:27

Chapter 16 of Snijders and Bosker 2012 solve the problem by creating a dummy variable to represent the different response variables ($Y$), stacking the data (see quote below), and adding an additional level to your model to represent different response variables within subject.

They include example R code at this site: http://www.stats.ox.ac.uk/~snijders/ch16.r

And the chapter can be previewed on Google here: http://books.google.com/books?id=N1BQvcomDdQC&lpg=PP1&pg=PA282#v=onepage&q&f=false

I tested this approach using univariate data and got nearly identical results as a traditional manova.

From page 284 of Snijders and Bosker 2012: "To represent the multivariate data in the multilevel approach, three nesting levels are used. The first level is that of the dependent variables indexed by $h = 1,\ldots,m$, the second level is that of the individuals $i = 1,\ldots,n_j$, and the third level is that of the groups, $j = 1,\ldots,N$. So each measurement of a dependent variable on some individual is represented by a separate line in the data matrix, containing the values $i$, $j$, $j$, $Y_{hij}$, $x_{1ij}$, and those of the other explanatory variables. The multivariate model is formulated as hierarchical linear model using the same trick as in Section 15.1.3. Dummy variables $d_1,\ldots,d_m$ are used to indicate the dependent variables, just as in formula (14.2). Dummy variable $d_h$ is $1$ or $0$, depending on whether the data line refers to dependent variable $Y_j$ or to one of the other dependent variables."

| cite | improve this answer | |
  • $\begingroup$ (+1) Welcome to Cross Validated & thank you for your answer! Note you don't need to provide any valediction or signature at the end of your post, as an icon & a link to your user page are appended automatically. Any extra information you want to provide about yourself can be added to the "about me" section of your user page. Note also you can use LaTeX markup for mathematical expressions. $\endgroup$ – Scortchi - Reinstate Monica Apr 14 '15 at 16:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.