Skip to content
Prev 12578 / 20628 Next

MCMCglmm prior distributions

Dear Jarrod Hadfield,

Here I have attached a small code with the simulation code. I want to
estimate the effect of 'b' here. As you suggested I treated fixed effect as
random and gave own variance. But I am not sure this is the right way.

Could you please check whether the implementation is right?

regards,
Boby

mark=100; line=150

x=round(matrix(runif(mark*line),nrow=mark))
b=rep(0,mark)
b[8]=3; b[80]=5;b[90]=5;

noise=rnorm(line,0,sqrt(1))



Line=1:line

y = b%*%x + noise

Z=t(x)

library(MCMCglmm)

data=data.frame(Phe=t(y),animal=Line)

data$animal=as.factor(data$animal)


prior2.2 <- list(G = list(G1 = list(V = 1, n = 0.002)), R = list(V = 1, n =
0.002))

mod_mcmc=MCMCglmm(Phe~1,random=~idv(Z),pr=T,data=data,nitt=50000,thin=500,burnin=10000,prior=prior2.2)

val=colMeans (mod_mcmc$Sol)




On Thu, Oct 16, 2014 at 5:51 PM, Jarrod Hadfield <j.hadfield at ed.ac.uk>
wrote: