Re: [R] Coda not providing summary on mcmc object

From: Ben Bolker <>
Date: Tue, 01 Jul 2008 00:14:27 +0000 (UTC)

smith_cc <smith_cc <at>> writes:

> The object is a mcmc sample from lmer. I am using R v2.7.1. Please let me
> know what additional information I can provide, hopefully I am just making a
> simple mistake. Thanks in advance!
> > data(ratdrink, package = 'faraway')
> > <- lmer(wt ~ weeks*treat + (1 | subject), data = ratdrink)
> > <- mcmcsamp(, 10000)
> > library(coda)
> Loading required package: lattice
> > summary(
> Length Class Mode
> 1 merMCMC S4
> > HPDinterval(
> Error in UseMethod("HPDinterval") :
> no applicable method for "HPDinterval"

   I don't think it should necessarily have been obvious, but help("merMCMC-class") suggests that lme4 contains its own methods for doing HPDinterval calcs. Furthermore, loading coda after lme4 gives the following warning

        The following object(s) are masked from package:lme4 :


If you really want HPDintervals from coda, it looks like you can do


or if you want to use lme4's HPDinterval while coda is loaded, do


  (I don't quite know why lme4 is including its own calculations rather than just allowing conversion to coda objects -- maybe they don't want the dependency)

  If you have further questions it might make sense to send them to r-sig-mixed ...

  Ben Bolker mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 Jul 2008 - 00:20:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Jul 2008 - 00:31:42 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive