[R-sig-ME] GWS in MCMCglmm and INLA
Eder David Borges da Silva
eder at leg.ufpr.br
Fri Feb 10 19:51:49 CET 2012
Dear R user,
Just to better understand the GWS (genomic Wide Select), I would like
to adjust the model by making the inference in different ways, I could
adjust using the INLA, MCMC would like to use, especially with the
function MCMCglmm, but I could not understand if this is possible, so
I want your help.
The code is:
### Seleção Genomica Ampla - Genomic Wide Select
#browseURL('http://www.infoteca.cnptia.embrapa.br/bitstream/doc/883425/1/Doc210.pdf')
#pg 54
###-----------------------------------------------------###
rm(list=ls())
require(INLA)
require(MCMCglmm)
###-----------------------------------------------------###
dados <- data.frame(ind=c(1:5),
diametro=c(9.87,14.48,8.91,14.64,9.55),
M1=c(2,1,0,1,1),
M2=c(0,1,2,0,0),
M3=c(0,0,0,1,0),
M4=c(0,0,0,0,1),
M5=c(2,1,0,1,1),
M6=c(0,1,0,0,1),
M7=c(0,0,2,0,0))
dados
###-----------------------------------------------------###
### Create Z matrix
Z <- as.matrix(dados[,3:ncol(dados)])
### change effects de 0 1 2 para -1 0 1
Z <- apply(Z,2,function(x) ifelse(x==1,-1, ifelse(x!=0,1,0)))
Z
###-----------------------------------------------------###
### fit in INLA
rr.inla.fit = inla(diametro ~ 1 +
f(ind,model="z",Z=Z),data=dados,family="gaussian")
summary(rr.inla.fit)
rr.inla.fit$summary.random
###-----------------------------------------------------###
### fit MCMCglmm
rr.mcmc.fit = MCMCglmm(diametro ~ 1, random = Z,data=dados,family="gaussian")
summary(rr.mcmc.fit)
random = ????
Thanks
Éder David Borges da Silva
More information about the R-sig-mixed-models
mailing list