Skip to content
Prev 5894 / 20628 Next

p values with lmer (mcmcpvalue error)

On 11-04-16 09:29 AM, Douglas Bates wrote:
I haven't looked carefully, but does this work better for you?

mcmcpvalue <- function(samp,type="fixef")
{
  s <- t(slot(samp,type))
  std <- backsolve(chol(var(s)),
                   cbind(0, t(s)) - colMeans(s),
                   transpose = TRUE)
  sqdist <- colSums(std * std)
  sum(sqdist[-1] > sqdist[1])/nrow(s)
}

mcmcpvalue(markov1)

  I can imagine that the structure of "merMCMC" objects (i.e. the
results of mcmcsamp()) has changed since the mcmcpvalue() function was
written.

  To sort this kind of problem out for yourself, use str(markov1) to see
what is contained in the object.