
Last chance! 50% off unlimited learning
Sale ends in
mcmcsamp(object, n, verbose, ...)
lmer-class{lmer}
object.TRUE
verbose output is printed.
Defaults to FALSE
.lmer-class{lmer}
objects takes the optional argument
saveb
which, if TRUE
"mcmc"
suitable for use with the
functions in the "coda" package.require("lattice", quietly = TRUE, character = TRUE)
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
samp1 <- mcmcsamp(fm1, n = 1000)
frm <-
data.frame(vals = c(samp1), iter = rep(1:nrow(samp1), ncol(samp1)),
par = factor(rep(1:ncol(samp1), each = nrow(samp1)),labels = colnames(samp1)))
densityplot(~ vals | par, frm, plot = FALSE,
scales = list(relation = 'free', x = list(axs='i')))
xyplot(vals ~ iter | par, frm, layout = c(1, ncol(samp1)),
scales = list(x = list(axs = "i"), y = list(relation = "free")),
main = "Trace plot", xlab = "Iteration number", ylab = "",
type = "l")
qqmath(~ vals | par, frm, type = 'l',
scales = list(y = list(relation = 'free')))
if (require("coda", quietly = TRUE, character = TRUE)) {
print(summary(samp1))
print(autocorr.diag(samp1))
}
Run the code above in your browser using DataLab