# NOT RUN {
# Use the ipadstudy data set
data(ipadstudy)
# mean center covariates
ipadstudy$age <- ipadstudy$age - mean(ipadstudy$age)
ipadstudy$owner <- ipadstudy$owner - mean(ipadstudy$owner)
ipadstudy$gender <- ipadstudy$gender - mean(ipadstudy$gender)
# }
# NOT RUN {
# or use BANOVA.run based on 'Stan'
require(rstan)
res <- BANOVA.run(attitude~owner + age + gender + selfbrand*conspic,
data = ipadstudy, model_name = 'Normal', id = 'id',
iter = 100, thin = 1, chains = 2)
# }
Run the code above in your browser using DataLab