## Data-augmented independence Metropolis-Hastings sampling for the
## binary logit model
## load caesarean birth data
data(caesarean_binary)
y <- as.numeric(caesarean_binary[,1])
X <- as.matrix(caesarean_binary[,-1])
## start independence MH sampler
indivMH1 <- IndivdRUMIndMH(y,X)
print(indivMH1)
summary(indivMH1)
plot(indivMH1)
## Not run:
# ## load simulated data set
# data(simul_binary)
# y <- as.numeric(simul_binary[,1])
# X <- as.matrix(simul_binary[,-1])
#
# ## use a small acc>0 (e.g. acc=50), otherwise the sampler gets stuck at
# ## the starting values
# indivMH2 <- IndivdRUMIndMH(y,X,acc=50)
#
# print(indivMH2)
# summary(indivMH2)
# plot(indivMH2)
# ## End(Not run)
Run the code above in your browser using DataLab