Hi Thomas,

I think the problem comes from your Y matrix, you should specify it
directly in your MCMCglmm command line.

Not an expert but you should also try the following alteration to your code:

mcmcmodel = MCMCglmm (cbind(resMasschange, log(cort),sqrt(fT3),
log(temperature)) ~  trait-1 + trait:treatment*trait:sex.1*trait:SexRatio.2
+ trait:chick.no.2 ,
random =  ~us(trait):Window, rcov=~us(trait):units,
family=rep("gaussian",4),nitt = 60000,
prior = priormulti, burnin = 10000, thin=25, verbose=FALSE, data = energy)

This tells R to regress each fixed effect on each of your Y variables. For
the random effects, you have different possibilities: if each nest has been
measured more than once, you can estimate between and within nest
correlations (what is shown in the code above). If you only have 1 measure
per nest, you may want to use a more simple random effect structure:
 random =  ~idh(trait):Window, rcov=~us(trait):units.

For more information, you can reread chapter 3 from the course note on
random effect (co)variance structure or look into the supplementary
materials of the following article:
Dingemanse, N.J. and Dochtermann, N.A.: Quantifying individual variation in
behaviour: mixed-effect modelling approaches. Journal of Animal Ecology 82,
39-54 (2013)

For alternatives to Bayesian approaches with multivariate MM, I only know
of ASReml, which you can install for free on windows OS. MCMCglmm has the
advantage of also handling non-gaussian data (poisson, binomial, etc). The
article above also provides ASReml code.

Hope this helps. Bon courage!

-- 
Raphaël Royauté
PhD candidate
Dept Natural Resource Sciences
McGill University, Macdonald campus
21,111 Lakeshore Road
Ste Anne de Bellevue, Québec
H9X3V9, CANADA
Arthropod Ecology Lab <http://insectecology.mcgill.ca/>


------------------------------
>
> Message: 6
> Date: Tue, 21 May 2013 10:08:01 +0200
> From: Thomas Merkling <thomas.merkling@univ-tlse3.fr>
> To: r-sig-mixed-models <r-sig-mixed-models@r-project.org>
> Subject: [R-sig-ME] multivariate MCMCglmm problem
> Message-ID: <519B2B61.2020300@univ-tlse3.fr>
> Content-Type: text/plain
>
> Hi all,
>
> I would like to know whether males are more energetically costly to rear
> than females and to do that we have measured different variables
> concerning energy expenditure and metabolic rates for each member of the
> pair. We also know the brood sex ratio and whether parents were
> experimentally fed or not.
>
> I already ran univariate linear mixed models for each response variables
> and now I would like to run a multivariate analysis. As both member of a
> pair have been measured, I need to take this into account with a Nest
> random effect.
> For what I have found, only MCMCglmm allows to do multivariate LMM. Am I
> right ?
>
> I tried but I got the following error message.
> Erreur dans `[<-.data.frame`(`*tmp*`, , response.names, value =
> c(2.22523339628781,  :
>    missing values are not allowed in subscripted assignments of data frames
>
> However, there are no missing values in the data frame, so I don't
> understand where the problem comes from.
> That's how my data look like. The whole dataset is 83 line long (so
> quite small ...).
>
>    Window treatment sex.1 brood mass.2 mass.3 PropDaysMale chick.no.2
> SexRatio.2 temperature      fT3       DEE cort masschange resMasschange
> 1    A12       fed     f     C  415.4  444.1    0.0000000 1
> 0.0000000        39.7 5.576074  886.1580 1.30       28.7 33.773270
> 2    A12       fed     m     C  434.7  440.6    0.0000000 1
> 0.0000000        42.7 5.886918 1029.3123 1.58        5.9 10.973270
> 3    A16       fed     m     E  422.2  416.9    0.3225806 3
> 0.3333333        40.5 7.467761  823.5975 4.23       -5.3 7.862324
> 4    A16       fed     f     E  373.8  350.2    0.3235294 3
> 0.3333333        40.8 2.304243  884.5377 3.02      -23.6 -10.437676
> 5    A19     unfed     m     C  433.6  426.8    0.0000000 1
> 0.0000000        40.9 7.204941  999.5745 5.73       -6.8 -1.561424
> 6    A19     unfed     f     C  353.0  372.2    0.0000000 1
> 0.0000000        40.7 3.155890  923.4605 1.38       19.2 24.438576
>
> Here is the code I used:
> Y = with(energy, cbind(resMasschange, log(cort),sqrt(fT3),
> log(temperature))) ## data are transformed to meet normality assumptions
>
> priormulti = list( R=list(V=diag(4), nu=0.1), G=list(G1=list(V=diag(4),
> nu=0.1)))
>
> mcmcmodel = MCMCglmm (Y ~  treatment*sex.1*SexRatio.2 + chick.no.2 ,
> random =  ~ Window, family=rep("gaussian",4),nitt = 60000,
> prior = priormulti, burnin = 10000, thin=25, verbose=FALSE, data = energy)
>
> When I run an univariate LMM with each response variable separately I
> don't get the error message and classical MANOVA works fine too.
>
> I would appreciate if you have any ideas of where the problem comes from
> or if you see any alternative to Bayesian statistics.
>
> Best,
> Thomas
>
> --
>
> Thomas Merkling, Doctorant (PhD Student)
> Website <https://sites.google.com/site/merklingthomas/>
> Page web française <http://www.edb.ups-tlse.fr/Merkling-Thomas.html>
>
> Laboratoire "Evolution et Diversité Biologique" -EDB
> UMR 5174 - bât 4R1 - bureau 33 RDC
>
> Université Paul Sabatier Toulouse 3
> 118, route de Narbonne
> 31062 TOULOUSE Cedex 09, FRANCE
>
> Tél: 33 5-61-55-67-56
> Fax: 33 5-61-55-73-27
>
>         [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> _______________________________________________
> R-sig-mixed-models mailing list
> R-sig-mixed-models@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
> End of R-sig-mixed-models Digest, Vol 77, Issue 23
> **************************************************

	[[alternative HTML version deleted]]

