# NOT RUN {
# use the bpndata dataset
data(bpndata)
# within-subjects model using the dependent variable : PIC_FIX
res1 <- BANOVA.Poisson(PIC_FIX ~ AD_ID + PIC_SIZE+ PAGE_NUM
+ PAGE_POS, ~1, bpndata, bpndata$RESPONDENT_ID, burnin = 500,
sample = 200, thin = 5)
summary(res1)
# use the goalstudy dataset
data(goalstudy)
goalstudy$bid <- as.integer(goalstudy$bid + 0.5)
res2<-BANOVA.Poisson(bid~1, ~progress*prodvar, goalstudy, goalstudy$id,
burnin = 5000, sample = 2000, thin = 10)
summary(res2)
# or use the BANOVA.run based on 'Stan'
require(rstan)
res3 <- BANOVA.run(bid~progress*prodvar, data = goalstudy,
model_name = 'Poisson', id = 'id', iter = 100, thin = 1, chains = 2)
# }
Run the code above in your browser using DataLab