# NOT RUN {
library(gammSlice)
set.seed(39402) ; m <- 100 ; n <- 2
beta0True <- 0.5 ; betaxTrue <- 1.7 ; sigsqTrue <- 0.8
idnum <- rep(1:m,each=n) ; x <- runif(m*n)
U <- rep(rnorm(m,0,sqrt(sigsqTrue)),each=n)
mu <- 1/(1+exp(-(beta0True+betaxTrue*x+U)))
y <- rbinom((m*n),1,mu)
fit <- gSlc(y ~ x,random = list(idnum = ~1),family = "binomial")
summary(fit)
# Illustration of user-specified priors:
fitMyPriors <- gSlc(y ~ x,random = list(idnum = ~1),
family = "binomial",
control = gSlc.control(fixedEffPriorVar=1e13,
sdPriorScale=1e3))
summary(fitMyPriors)
# Illustration of specification of larger Markov chain Monte Carlo samples:
fitBigMCMC <- gSlc(y ~ x,random = list(idnum = ~1),family = "binomial",
control = gSlc.control(nBurn=10000,nKept=8000,nThin=10))
summary(fitBigMCMC)
# }
Run the code above in your browser using DataLab