[R-sig-ME] GWS in MCMCglmm and INLA
Jarrod Hadfield
j.hadfield at ed.ac.uk
Sat Feb 11 16:15:37 CET 2012
Hi,
dados$Z<-Z
rr.mcmc.fit<-MCMCglmm(diametro~1,random=~idv(Z),data=dados,family="gaussian")
would be one way of dong it. Not very efficient for setting up the
model, but once MCMCing it should be OK.
Cheers,
Jarrod
Quoting Eder David Borges da Silva <eder at leg.ufpr.br> on Fri, 10 Feb
2012 16:51:49 -0200:
> 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
>
> _______________________________________________
> 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