BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have one continuous variable (X), a categorical variable (Z; treatment condition with three levels), and a continuous outcome variable (Z). X is an individual difference variable.

I have already figured out how to compare the different treatment conditions for different values of X. For example, for comparing treatment 1 and 2 among individuals scoring low on X (Mean of X at -1 SD = 4.2261), I would write the following:

proc glm;
class Z;
model y = Z X Z*X;
ESTIMATE 'Z 1 vs 2 at low X' Z -1 1 0 Z*X -4.2261 4.2261 0;
run;

However, I can't figure out how to test whether individuals that score high versus low on X differ in Y, for each level of Z. (e.g., comparing Y scores for low and high X in treatment condition 1; comparing Y scores for low and high X in treatment condition 2 etc).

Any suggestions?
1 REPLY 1
Dale
Pyrite | Level 9
It usually helps to write out the ESTIMATE statement for each condition that you want to use in a contrast and then take the difference between the coefficients that are involved in that contrast. For instance, for treatment group 1, estimate statements for low and high X would be

estimate "Trt=1, low X"
  z     1 0 0
  x     -4.661
  z*x  -4.661 0 0;

estimate "Trt=1, high X"
  z     1 0 0
  x     4.661
  z*x  4.661 0 0;


The difference between these two is the effect of interest that you are having trouble constructing. But as presented above, the effect of interest would be:

estimate "Trt=1, high vs low X"
  x     9.322
  z*x  9.322 0 0;

Just change the label and the last line to reflect the different treatment conditions.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1335 views
  • 0 likes
  • 2 in conversation