Chunling,

Assuming that you are modeling the response with both main effects

X1 and X2 and the interaction X1*X2 included in the model, then

you could run

proc glm data=mydata;

class x2;

model y = X1|X2 / solution;

estimate "A increase by 0.1 (1)"

x1 0.1

x2 0 1

x2*x1 0 0.1;

estimate "A increase by 0.5 (2)"

x1 0.5

x2 0 1

x2*x1 0 0.5;

estimate "Diff in A (D1 = 1-2)"

x1 -0.4

x2*x1 0 -0.4;

estimate "B increase by 0.1 (3)"

x1 0.1

x2 1 0

x2*x1 0.1 0;

estimate "B increase by 0.5 (4)"

x1 0.5

x2 1 0

x2*x1 0.5 0;

estimate "Diff in B (D2 = 3-4)"

x1 -0.4

x2*x1 -0.4 0;

estimate "Diff of diff (D1 - D2)"

x2*x1 0.4 -0.4;

run;

Note how I have built up to the final difference of differences.

First, I have constructed the estimate for the response mean

in group A for a change in X1 of 0.1 as well as a change in X1 of

0.5. Next, the estimate of the response mean in group A given

a change of 0.1 minus the estimate of the response mean in group

A given a change of 0.5 is obtained employing an estimate

statement in which the terms of the second estimate statement

are subtracted from the terms of the first estimate statement.

Similarly, one can construct the estimate of the response mean

in group B for a change in X1 of 0.1 as well as a change in

X1 of 0.5 and subsequently compute the difference in group B

for a change of 0.1 vs a change of 0.5. To get the final

solution, we simply construct an estimate statement in which

the coefficients of the difference in B are subtracted from

the coefficients of the difference in A.

The estimate statement will automatically compute both point

estimate and standard error.

HTH,

Dale

=====

---------------------------------------

Dale McLerran

Fred Hutchinson Cancer Research Center

mailto: XXXX@XXXXX.COM

Ph: (206) 667-2926

Fax: (206) 667-5977

---------------------------------------

__________________________________

Do you Yahoo!?

Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

http://hotjobs.sweepstakes.yahoo.com/signingbonus