/* This program illustrates how analyses of variance can be conducted using regression programs, showing that both ANOVA and regression are both particular cases of the general linear model */ data anova1 ; input group y ; cards ; 1 1 1 2 1 3 2 3 2 4 2 5 3 5 3 6 3 7 ; proc glm data = anova1 ; class group ; model y = group ; run ; data anova2 ; set anova1 ; grp1 = 0 ; grp2 = 0 ; if group = 1 then grp1 = 1 ; if group = 2 then grp2 = 1 ; run ; proc reg ; model y = grp1 grp2 ; run ;