# Load the data used in the Held et al. (2006) paper
data("hepatitisA")
# Fix seed - this is used for the MCMC samplers in twins
set.seed(123)
# Call algorithm and save result (use short chain without filtering for speed)
otwins <- algo.twins(hepatitisA,
control=list(burnin=500, filter=1, sampleSize=1000))
# This shows the entire output (use ask=TRUE for pause between plots)
plot(otwins, ask=FALSE)
# Direct access to MCMC output
hist(otwins$logFile$psi,xlab=expression(psi),main="")
if (require("coda")) {
print(summary(mcmc(otwins$logFile[,c("psi","xipsi","K")])))
}
Run the code above in your browser using DataLab