\name{getDeviances} \alias{getDeviances} \title{Fetches the Deviance values from the MCMC statistics database.} \description{ Fetches the calculated deviance values for a given user as a coda \code{mcmc.list} value. } \usage{ getDeviances(subject = "*ALL*", iterations = numeric(0), chain = getChains()) } \arguments{ \item{subject}{Identifier for student or special value \code{"*ALL*"} for total deviance across all subjects.} \item{iterations}{Portion of the MCMC chains to fetch data from.} \item{chain}{Number of chains to use.} } \value{ If only one chain, an \code{mcmc} object containing the data, if more than one chain, an \code{mcmc.list} object. } \details{ The database used is the one referenced by the last call to \code{asp.dbConnect}. } \references{Speighelhalter, Best, Carlin and van der Linde, 2002, "Bayesian measures of model complexity and fit." JRSS B, pp 583--639. } \author{Russell Almond} \note{ Deviance values were not stored in database by versions of StatShop prior to Beta 3. } \seealso{\code{\link[coda]{mcmc.list}}, \code{\link{asp.dbConnect}}} \examples{ ### This example will only run if you have the StatShop test databases ### installed on your machine. StatShop <- Sys.getenv("STATSHOP") if (StatShop == "") { warn("StatShop not installed, skipping test.") } else { asp.dbConnect("parameter_recovery_test","junit") ## Total deviance. summary(getDeviances(iterations=c(101,1000))) ## Deviance for first simulee. summary(getDeviances("Simulee0",iterations=c(101,1000))) asp.dbDisconnect() } } \keyword{database}