BookmarkSubscribeRSS Feed
smortaheb
Calcite | Level 5

Hello, 

 

I have a dataset which has observations before and after a treatment in 2 conditions. So I have "post" and "Pre" treatment measurements in condition "A" and "post" and "pre" treatment measurements in condition "B". I want to compare (Post - Pre) in condition A with (Post - Pre) in condition B. For that, I wrote the following code(time represents pre and post): 

 

PROC MIXED method=REML, data=my_data;

class subj_id condition time gender;

model value = time condition gender time*condition;

random int / subject=subj_id type=UN;

contrast 'my_contrast' time*condition 1 -1 -1 1;

RUN;


Because I am new to SAS, I don't know whether this code does the same thing that I want or not. Can you help me to understand it better. Thanks! 

1 REPLY 1
PaigeMiller
Diamond | Level 26

Use the E option of the contrast statement, this will tell you what is being multiplied by 1 and what is being multiplied by –1.

 

contrast 'my_contrast' time*condition 1 -1 -1 1/e;

 

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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