Skip to content
Prev 13955 / 20628 Next

Interaction variance from mcmcglmm

Thanks Paul,

I have tried with the suggested expanded model, using simulated data where
I have added Y-source * Background interactions. See below. Is it correct
then to say that the variance estimate of "BG:Y.Source" is variance in
lifespan explained by the interaction between the genetic background
(autosomes and X source) and the source of the Y? Then the phenotypic
variance would be the sum of all components (2.910), and the interaction
BG*Y.Source would explain 100*(0.902/2.910) = 30.98% of the variance in
lifespan?
BG      Y.Source    Y.Source:Y   BG:Y.Source BG:Y.Source:Y
   Vial         units
 1.0029972054  0.4037536287  0.0008707007  0.9017016510  0.0002926541
 0.0013600115  0.5993455117


I also have a follow up on the nesting, I may need some explanation of the
syntax in the model you proposed (what are : and / doing?), but I read that
as having Y nested within Y.Source, which is then nested within the
background (BG). I understand that Y should be nested within Y.Source
(because each Y tested can only be from one source population), however,
given that all Y chromosomes are tested in all backgrounds (autosome and X
source), wouldn't it be inappropriate to nest within BG? i.e. Y's A1-A34
are all tested in CN, DH, and ZW, Y's B1-B34 are also all tested in CN, DH,
and ZW...

Thanks,
Rob

Here's the script I used:

############
prior3 = list(G = list( G1 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000),
G2 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000),
G3 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000),
G4 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000),
G5 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000),
G6 = list(V = 1, nu=1, alpha.mu=0, alpha.V=1000)),
R  = list(V = 1, nu=0.002))

# Y source * BG variance
dummy$Age2 = ifelse(dummy$Y.Source=="A"&dummy$BG=="CN", dummy$Age+15,
dummy$Age)
dummy$Age2 = ifelse(dummy$Y.Source=="B"&dummy$BG=="CN", abs(dummy$Age-15),
dummy$Age2)
dummy$Age2 = ifelse(dummy$Y.Source=="C"&dummy$BG=="DH", dummy$Age+15,
dummy$Age2)
dummy$Age2 = ifelse(dummy$Y.Source=="C"&dummy$BG=="ZW", abs(dummy$Age-15),
dummy$Age2)
dummy$Age2 = ifelse(dummy$Y.Source=="A"&dummy$BG=="DH", abs(dummy$Age-15),
dummy$Age2)
dummy$Age2 = ifelse(dummy$Y.Source=="B"&dummy$BG=="ZW", dummy$Age+15,
dummy$Age2)

boxplot(dummy$Age2 ~ dummy$Y.Source*dummy$BG)
dummy$Score2 = (dummy$Age2 - mean(dummy$Age2)) / sd(dummy$Age2)

# Chain
NestChain_Mod2 = MCMCglmm(Score2 ~1 + Block,
random = ~BG + Y.Source + Y.Source:Y + BG:Y.Source + BG:Y.Source:Y + Vial,
rcov = ~units,
nitt = 5000,
thin = 5,
burnin = 1000,
prior = prior3,
family = "gaussian",
start = list(QUASI = FALSE),
data = dummy)
file = paste(filepath, "NestChain_mod2.rda", sep = "")
save(NestChain_Mod2, file = file)

NestChain_mod2 = load(paste(filepath, "NestChain_mod2.rda", sep= ""))

# Variance components
colMeans(NestChain_Mod2$VCV)

colMeans(NestChain_Mod2$VCV)[1]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[2]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[3]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[4]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[5]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[6]/sum(colMeans(NestChain_Mod2$VCV))*100
colMeans(NestChain_Mod2$VCV)[7]/sum(colMeans(NestChain_Mod2$VCV))*100


---------------------------




---
Robert Griffin
PhD
griffinevo.wordpress.com
On Tue, Nov 3, 2015 at 6:29 PM, paul debes <paul.debes at utu.fi> wrote: