This document discusses running a two-way ANOVA in SAS with an unbalanced design. It shows the SAS code to specify a class and model statement to analyze the effects of factors A and B and their interaction on the response variable y. It also provides code examples for generating contrasts and least squares means comparisons. Dummy variable coding is explained as a method for representing categorical variables in the model. Finally, alternative approaches for analyzing main effects and interactions are suggested if contrast analysis cannot be run directly.
10. Dummy variable
? Category variable
? Set reference group
? Set N-1 d.variables:
C 1 if xij belongs to the group specified
C 0 if xij belongs to other groups
? E.g. variable drug in the example:
C 0 0 0 => drug=1
C 1 0 0 => drug=2
C 0 1 0 => drug=3
C 0 0 1 => drug=4
13. Why use d.v. coding?
http://www.sas.com/offices/NA/canada/downloads/presen
tations/VancouverMay11/Variable.pdf
15. If you cannot run contrast
analysisぉ
? Check coefficients
? Separate main effects and interactions into
different models.
? e.g. 2-way ANOVA with interaction:
C model y = A B;
(contrasts for main effects)
C model y = A*B;
(contrasts for interaction)