## Not run:
#
# # Schizophrenia Data
# data(psychiatric)
# attach(psychiatric)
#
# # Prior information
# prior <- list(M=4,
# frstlprob=FALSE,
# alpha=1,
# nu0=4.01,
# tinv=diag(1,1),
# mub=rep(0,1),
# Sb=diag(100,1),
# beta0=rep(0,3),
# Sbeta0=diag(1000,3))
#
# # MCMC parameters
# mcmc <- list(nburn=10000,
# nsave=10000,
# nskip=20,
# ndisplay=100,
# samplef=1)
#
# # Initial state
# state <- NULL
#
# # Fitting the model
# fit1 <- PTolmm(fixed=imps79o~sweek+tx+sweek*tx,random=~1|id,prior=prior,
# mcmc=mcmc,state=state,status=TRUE)
# fit1
#
# # Summary with HPD and Credibility intervals
# summary(fit1)
# summary(fit1,hpd=FALSE)
#
# # Plot model parameters
# plot(fit1)
#
# # Plot an specific model parameter
# plot(fit1,ask=FALSE,nfigr=1,nfigc=2,param="sigma-(Intercept)")
#
# # Extract random effects
# PTrandom(fit1)
#
# # Extract predictive information of random effects
# aa<-PTrandom(fit1,predictive=TRUE)
# aa
#
# # Predictive marginal and joint distributions
# plot(aa)
# ## End(Not run)
Run the code above in your browser using DataLab