## Finite-population Anova calculations for models with interactions

Jim Thomson writes:

I wonder if you could provide some clarification on the correct way to calculate the finite-population standard deviations for interaction terms in your Bayesian approach to ANOVA (as explained in your 2005 paper, and Gelman and Hill 2007).

I understand that it is the SD of the constrained batch coefficients that is of interest, but in most WinBUGS examples I have seen, the SDs are all calculated directly as sd.fin<-sd(beta.main[]) for main effects and sd(beta.int[,]) for interaction effects, where beta.main and beta.int are the unconstrained coefficients, e.g. beta.int[i,j]~dnorm(0,tau).

For main effects, I can see that it makes no difference, since the constrained value is calculated by subtracting the mean, and sd(B[]) = sd(B[]-mean(B[])).

But the conventional sum-to-zero constraint for interaction terms in linear models is more complicated than subtracting the mean (there are only (n1-1)*(n2-1) free coefficients for an interaction b/w factors with n1 and n2 levels). When I estimate a model with constrained coefficients directly the SD of those constrained coefficients is different to the SD of unconstrained coefficients for the same model, and I am assuming the later are incorrect?

Can you confirm that the finite pop SD must be calculated from the constrained coefficients, and that sd(beta.int[,]) will not be correct for interaction terms?

It would be great if sd(beta.int[,]) were valid, because using constrained coefficients slows WinBUGS down considerably, but I can’t see that it is (unless I am misunderstanding the constraints).