It occurred to me that how one writes an interaction term in BUGS depends on the types of predictors that are "interacting". Suppose data that are long (rather than wide). Then, a model with an interaction between two factors, A and B, as in two-way ANOVA, may look something like
y[i] ~ dnorm(mu[i], tau) mu[i] <- A[a_level[i]] + B[b_level[i]] + A.B[a_level[i],b_level[i]] A.B[,] ~ dnorm(0, ab.tau)
However, a model with an interaction between a factor A and a continuous predictor C may look something like
y[i] ~ dnorm(mu[i], tau) mu[i] <- A[a_level[i]] + betaC*C[i] + betaX[a_level[i]]*C[i] betaX ~ dnorm(0, betaX.tau)
So, a few questions:
- Are these interactions written correctly?
- What other important interactions are there? Obviously, two continuous predictors is another case.
- Are there differences for how one would write this for linear regression vs. logistic regression?
- Are there differences in the priors that should be specified for different types of interactions?
This may need to be a community wiki, not sure.