Hi,

You need the coda package. Once the package is loaded you can run summary
over the list of chains as you normally would do it. Here some functions
which might help you to get similar results as with the normal summary
command (equivalent to what Sven was suggesting):

x <- mcmc_list
y <- summary(x)

for the effective sample size: effectiveSize(x)[1:fe] #fe is the number of
fixed effects

for the credible interval: HPDinterval(mcmc(x))

- for the "p"-values of the fixed effects:

p <- 2 * pmax(0.5/dim(mcmc(as.matrix(x)))[1],
 pmin(colSums(mcmc(as.matrix(x))[,1:fe, drop = FALSE] >
0)/dim(mcmc(as.matrix(x)))[1],
 1 - colSums(mcmc(as.matrix(x))[, 1:fe, drop = FALSE]
>0)/dim(mcmc(as.matrix(x)))[1]))

Combining everything gives you something similar to the standard output of
summary()

st <- data.frame(cbind(y$statistics[1:fe,],HPDinterval(mcmc(x)),p))
colnames(st) <- c("post. Mean","SD","Naive SE","Time series SE","l.
95%CL","u. 95%CL","pMCMC")

the significance levels:

sumcmc(st)

sumcmc <- function(d){x <- d
x[8] <- ""
x[x[7]<0.001,8] <- "***"
x[x[7]>0.001 & x[7]<0.01,8] <- "**"
x[x[7]>0.01 & x[7]<0.05,8] <- "*"
x[x[7]>0.05 & x[7]<0.1,8] <- "."
names(x)[NCOL(x)] <- ""
x
}

I normally use all that to get a table in latex:

print(xtable(sumcmc(st),caption="Estimation - Fixed effects [Signif.
codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
]",digits=3,align="lrrrrrrrr",type="latex"),file="/PATH/tablename.tex",
size="tiny\\",include.rownames=TRUE)


Hope that helps!







2013/6/24 Frazer Sinclair <frazer_sinclair@yahoo.co.uk>

> Hi all
> In an attempt to save time by using a computing cluster, I have been left
> with a series of MCMCglmm models that are stored as elements in a list.
>
>
> e.g.
> require(MCMCglmm)
> Ndata <- data.frame(y = rnorm(5, mean = 0, sd = sqrt(1)))
> m1 <- MCMCglmm(y ~ 1, data = Ndata,verbose = FALSE)
> m2<- MCMCglmm(y ~ 1, data = Ndata,verbose = FALSE)
> m3<- MCMCglmm(y ~ 1, data = Ndata,verbose = FALSE)
> r<-list(c(m1,m2,m3))
>
> Does anyone know if/how I can return these elements to a format where I
> can use functions such as summary(m1)?
> Thanks
> Frazer Sinclair
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Andreas Karpf
Université Panthéon-Sorbonne | Paris School of Economics
Maison des Sciences Économiques
106 - 112 boulevard de L'Hôpital | 75647 Paris cedex 13 | France
phone: +33 699317912 | mail:
andreas.karpf@univ-paris1.fr<andreas.karpf@malix.univ-paris.fr>

-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.


	[[alternative HTML version deleted]]

