I have a model with a within-subject variable (two levels) and a between-subjects variable (three levels which represent experimental groups). I create two dummy codes to account for the three levels of the between-subject variable.

Here is the model I end up with:

Y = Intercept + WithinVariable + GroupB + GroupC + GroupB:WithinVariable + GroupC:WithinVariable+randomeffects

How do you test differences between group means?

Basically, I want post-hoc comparisons between the means of all three groups in each level of the within-subjects variable.

I know that the GroupB and GroupC coefficients test differences in means of those groups relative to the control group (when the within-subjects variable dummy code = 0). But what about comparing the means of Group B and C?


1 Answer 1


Not sure if this is what you're looking for, or if you're still looking for an answer, and I'm still new to posting on this site, so forgive any errors! If you just want a test of GroupB=GroupC, many programs have some kind of post estimation command you can use to estimate that. For example, in Stata you could do test GroupB=GroupC, or use the margins command. Another solution is to rotate the reference group - in other words, you would include GroupA and GroupB as coefficients and leave GroupC out, so that the GroupB coefficient now tests the difference between GroupB and GroupC.

Hope that helps!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.