#First of all we load and attach sldata
library(jomo)
data(sldata)
attach(sldata)
#Then, we define all the inputs:
# nimp, nburn and nbetween are smaller than they should. This is
#just because of CRAN policies on the examples.
Y_cat=data.frame(social)
Y_numcat=matrix(4,1,1)
X=data.frame(rep(1,300),sex)
betap<-matrix(0,2,3)
covp<-diag(1,3)
Sp=diag(1,3);
nburn=as.integer(100);
# Finally we run the sampler:
imp<-jomo1cat.MCMCchain(Y_cat,Y_numcat,X,betap,covp,Sp,nburn)
#We can check the convergence of the first element of beta:
plot(c(1:nburn),imp$collectbeta[1,1,1:nburn],type="l")
Run the code above in your browser using DataLab