[R-sig-ME] genetic effects and multiple membership in MCMCglmm

Alexandre Martin alexandre.m.martin at gmail.com
Wed May 13 15:51:18 CEST 2015


Dear Jarrod and esteemed mixed-modelers,

First, thank you again for your help on a previous post.
I am returning on the work on indirect genetic effects I had to set aside
last month and I am trying Jarrod's solution using the function "mm".
I am unfortunately unable to run a model that links mate_1, mate_2, ...,
mate_n to the A inverse. 

I used this dummy (and maybe too simple) data set to test the model:
ped=data.frame(animal=letters[1:11] ,dam= c(NA, NA, NA, gl(2,4,labels =
c("a","c"))), sire=c(NA,NA,NA,rep("b",8)))
dat= data.frame(animal=letters[4:11], pen=c(1,1,2,2,2,1,1,2), Y=rnorm(n =
8,mean = 5,sd =
0.4),m1=c("e","d","g","f","f","d","d","f"),m2=c("i","i","h","h","g","e","e
","g"),m3=c("j","j","k","k","k","j","i","h")), 
where "m" stands for "mate". I have verified that each column had the same
factor levels (following Jarrod's suggestion : factor(mate_1,
levels=all.ids))

Using this dummy dataset in this basic model, mtest <- MCMCglmm(Y~1,
random=~animal+mm(m1+m2+m3),pedigree=ped, data=dat, pr=T),
mm(m1+m2+m3):animal (and other crazy possibilities) led to this error :
"interactions not permitted in str and mm structures". 

Do anyone know how to link the different mates to the Ainverse in order to
obtain blups of m1, m2, ..., m_n.

I would be very grateful for any hint and instruction. 
Many thanks again for your help.

Alexandre

-----Message d'origine-----
De : Jarrod Hadfield [mailto:j.hadfield at ed.ac.uk] Envoyé : 3 avril 2015
03:51 À : Jarrod Hadfield Cc : Alexandre Martin;
'r-sig-mixed-models at r-project.org'
Objet : Re: [R-sig-ME] design matrices in MCMCglmm

Hi,

Sorry it should have been just:

random=~mm(mate_1+mate_2+...mate_n)

and it is the mate_1, mate_2, ... mate_n that need to be linked to the A
inverse.

Cheers,

Jarrod

Quoting Jarrod Hadfield <j.hadfield at ed.ac.uk> on Fri, 03 Apr 2015
08:16:02 +0100:

> Hi,
>
> Have columns mate_1, mate_2 ... mate_n where n is group size. In each 
> column have the identity of each cage mate (order does not matter).
> Make sure each column has the same factor levels even if they don't 
> appear. For example,
>
> factor(mate_1, levels=all.ids)
>
> where all.ids are all possible cage mates. Then fit:
>
> random=~mm(mate_1+mate_2+...mate_n):animal
>
> where animal is linked to the pedigree through the ginverse argument.
>
> Cheers,
>
> Jarrod
>
>
>
> Quoting Alexandre Martin <alexandre.m.martin at gmail.com> on Tue, 31 Mar
> 2015 10:07:34 -0400:
>
>> Hi Jarrod,
>>
>> Thank you for your help.
>> My question is now extended to the subject of associative indirect 
>> genetic effects.
>>
>> For example in this data set :
>> id    cage
>> a    1
>> b    2
>> c    1
>> d    1
>> e    2
>> f    2
>> g    2
>>
>> cage is a grouping variable describing the composition of cages.
>> For instance, individuals a,c,d live in cage 1.
>>
>> Design matrix Z_cage typically produced by MCMCglmm should be:
>>     c1   c2
>> a    1    0
>> b    0    1
>> c    1    0
>> d    1    0
>> e    0    1
>> f    0    1
>> g    0    1
>> where phenotype of individuals {a, b, ..., g} are linked to cages 1 
>> and
2.
>>
>> Design matrix Z_mates, however, linking the phenotype of individual i 
>> to its cage' mates is:
>>     a    b    c    d    e    f    g
>> a    0    0    1    1    0    0    0
>> b    0    0    0    0    1    1    1
>> c    1    0    0    1    0    0    0
>> d    1    0    1    0    0    0    0
>> e    0    1    0    0    0    1    1
>> f    0    1    0    0    1    0    1
>> g    0    1    0    0    1    1    0
>>
>> It is Z_cage that is given by default, whereas it is matrix Z_mates 
>> that should be used to predict associative effects.
>>
>> Is it possible to force MCMCglmm to work with Z_mates instead of
Z_cage?
>>
>> Thanks again!
>>
>> Alexandre
>>
>> Le 2015-03-28 04:01, Jarrod Hadfield a écrit :
>>> Hi Alexandre,
>>>
>>> The design matrices should be identical for both effects (z_{ij}=1 
>>> if the jth individual is the mother of individual i). The difference 
>>> is in the correlation structure of the random effects. For 
>>> environmental maternal effects they are assumed iid (i.e. an 
>>> identity matrix) but for the maternal genetic effects they are 
>>> assumed to be proportional to the A matrix. inverseA will return the 
>>> inverse of A if you pass it the pedigree. It is this inverse that is
required for forming the MME.
>>>
>>> Cheers,
>>>
>>> Jarrod
>>>
>>>
>>>
>>>
>>>
>>>
>>> Quoting Alexandre Martin <alexandre.m.martin at gmail.com> on Fri, 27 
>>> Mar
>>> 2015 16:39:40 -0400:
>>>
>>>> Dear all,
>>>>
>>>> I am working on estimating maternal effects (genetic and
>>>> environmental) with MCMCglmm that is new for me.
>>>>
>>>> I am trying to apply to MCMCglmm what is shown in online Muir's 
>>>> course notes made for SAS. Leanning on Henderson?s Mixed Model 
>>>> Equation, these notes explain how to solve MME to predict random
effects ?by hand?.
>>>>
>>>> Here is my concern:
>>>>
>>>> I do not know how to extract the design matrices for a MCMCglmm 
>>>> model, e.g. the relatedness matrix or the one for maternal genetic 
>>>> effects. I want that to understand how the design matrices are 
>>>> constructed by comparing them to what they are supposed to look 
>>>> like.  For instance, the design matrix for maternal genetic effects 
>>>> should relate offspring to all the individuals that are in the 
>>>> pedigree, whereas the design matrix for maternal environmental 
>>>> effects should just relate offspring to their mothers. Does such a 
>>>> difference exist when MCMCglmm constructs its design matrices? If 
>>>> not, how to include such different matrices in models?
>>>>
>>>>
>>>> Any help will be greatly appreciated. Thank you!
>>>>
>>>>
>>>> Alexandre
>>>>
>>>>   [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> R-sig-mixed-models at r-project.org mailing list 
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>
>>>
>>>
>>
>>
>
>
> --
> The University of Edinburgh is a charitable body, registered in 
> Scotland, with registration number SC005336.
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>



--
The University of Edinburgh is a charitable body, registered in Scotland,
with registration number SC005336.



More information about the R-sig-mixed-models mailing list