-
Recall problem 8 from the text and in the program
diets.sas.
Consider four contrasts that compare
-
control - (average of non-controls)
-
the difference of differences:
[(A-B) at level 1]
- [(A-B) at level 2]
-
the average of A - the average of B
-
the average of level 1 - the average of level 2
-
Are these four contrasts mutually orthogonal?
-
Label them theta_a,theta_b,theta_c,theta_d.
Is it true that their sums of squares add up
to the treatment sum of squares?
SS[Trt] = SS(theta_a) + SS(theta_b) + SS(theta_c) + SS(theta_d)
-
To test whether or not any of these contrasts differ significantly from 0,
code them using CONTRAST statements within PROC GLM.
( diets-contrasts.sas is online for peeks.)
-
Recall the contrasts for the SIMPLE effect of A-B while the level
of the additive ...
is fixed at 1:
theta = mu_A1 - mu_B1 = (0,1,0,-1,0) mu'
is fixed at 2:
theta = mu_A2 - mu_B2 = (0,0,1,0,-1) mu'
The joint hypothesis that both the simple effects are 0 can be
written in terms of the matrix product
K mu = (0,0)'
where K is a (2X4) matrix with two rows given by the contrasts above.
CONTRAST "simple A-B effects"
trt 0 1 0 -1 0,
trt 0 0 1 0 -1;
-
Consider the hypothesis that the VECTOR of contrasts, from 1)
THETA=(theta_a,theta_b,theta_c,theta_d) is equal to the zero
vector (0,0,0,0). This is equivalent to the hypothesis that
K mu = 0 where K is a (4X5) matrix with four rows of contrast
coefficients, one row per contrast from parts 1a)-1d) above.
Code these with an appropriate CONTRAST statement.
-
For future reference, note that the factors ADDITIVE, CONTROL
and ALEVEL may defined in a datastep and then used within a
CLASS statement of PROC GLM to automatically produce the
contrast sums of squares for exactly those contrasts considered
in part 1). This involves nested factors, which we will not
discuss for several more weeks though.
proc glm;
class control additive alevel;
model wtgain=control additive(control) alevel(control) additive*alevel(control);
lsmeans additive*alevel(control);
run;
(SAS code for this last approach may be found in
diets-nested.sas)