[R-sig-ME] MCMCglmm question
Jarrod Hadfield
j.hadfield at ed.ac.uk
Tue Jul 17 11:27:34 CEST 2012
Hi Jackson,
You can set up the appropriate constraint by fitting the model as an
animal model. For MZ twins you have to give them the same identifier
in the pedigree though. For example, if the data (my.data) are like
this:
animal individual twin family
A A DZ A
B B DZ A
C C MZ B
C D MZ B
D E DZ C
E F DZ C
and the parents unknown:
ped<-cbind(my.data$animal, paste("mum", my.data$family, sep="."),
paste("dad", my.data$family, sep="."))
ped<-ped[which(!duplicated(ped[,1])),]
ped<-insertPed(ped) # this parental records into the pedigree
(insertPed is in the package MasterBayes)
The analysis is then
Ainv<-inverseA(ped)$Ainv
m1<-MCMCglmm(y~1, random=animal+family, ginverse=list(animal=Ainv),
data=my.data)
where the animal variance is Va and the family variance is Vce.
If your data do have no structure (i.e just sets of outbred unrelated
twins) then the above is quite an inefficient set up. A better option
is to derive Ainv without the phantom parents:
n<-nlevels(my.data$animal)
nDZ<-sum(my.data$twin=="DZ") # makes sure DZ is level 1 and MZ is level 2
Ainv<-bandSparse(n, n, 0:1,diagonal=list(c(rep(4/3,nDZ), rep(1,
n-nDZ)), c(rep(c(-2/3,0), nDZ/2),rep(0, n-nDZ))), symmetric=TRUE)
rownames(Ainv)<-levels(my.data$animal)[order(my.data$twin[which(!duplicated(my.data$animal))])]
This should be quicker.
Cheers,
Jarrod
Quoting Jackson King <jackson.king722 at gmail.com> on Mon, 16 Jul 2012
17:54:31 -0500:
> Hello,
>
> I am trying to fit a simple ACE genetics model with twin data, but am
> having difficulties implementing it in MCMCglmm. The data consist of both
> MZ and DZ twin pairs. The MZ twin variance can be decomposed into ACE; the
> DZ variance can be partitioned into CE and twin/family specific variance
> and unique genetic variance. I am unable to retrieve these components after
> running a model where unit and twin level variance components are
> estimated. Any thoughts on how to do this? Do I fix the DZ genetic variance
> to be half of the MZ in the prior?
>
> Many thanks,
> Jackson
>
> [[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.
More information about the R-sig-mixed-models
mailing list