#We define all the inputs:
Y=sldata[,c("measure", "age")]
X=data.frame(rep(1,300),sldata[,c("sex")])
colnames(X)<-c("const", "sex")
beta.start<-matrix(0,2,2)
l1cov.start<-diag(1,2)
l1cov.prior=diag(1,2);
nburn=as.integer(200);
nbetween=as.integer(200);
nimp=as.integer(5);
# Then we run he function:
imp<-jomo1con(Y,X,beta.start,l1cov.start,l1cov.prior,nburn,nbetween,nimp)
cat("Original value was missing(",imp[1,1],"), imputed value:", imp[301,1])
# Check help page for function jomo to see how to fit the model and
# combine estimates with Rubin's rules
Run the code above in your browser using DataLab