I want to have a beta-binomial Bayesian model, with R2jags
. I understand I need something like this:
for (i in 1:N) {
y[i] ~ dbinom(p,n[i])
p ~ dbeta(a,b)
}
Now suppose I have 2 types of subjects in my observations y, and I want to know whether 'type' makes a difference to p. I imagine I need some way to make a and b depend on my covariate 'type'. How is this done?